I need to know how to implement registry exclusion through Junit (Unit Testing) with Spring Boot, I'm having difficulty, the inclusion is working as you can see below;
@Autowired
private PessoaRepository pessoaRepository;
@Autowired
private PessoaService pessoaService;
@Test
public void testAdicionarPessoa() throws Exception {
Pessoa pessoa1 = new Pessoa("Douglas", "399.536.640-64");
this.pessoaService.salvar(pessoa1);
// Assertions.assertThat(pessoa1.getName()).isNotNull();
}
I tried to delete the registry this way, but I did not succeed.
@Test
public void testeDeletePessoa() throws Exception {
Pessoa pessoa2 = new Pessoa();
this.pessoaRepository.delete((long) 4);
}
I accept suggestions and am open to questions
Attempting to insert code generated this error;