그처럼 봄 부팅 단위 테스트에 존재 404 오류를 확인합니다. 하지만 이상한 결과가 나타납니다 (아마도 거래 효과로 인해). 후 내 시험에서이 작업을 수행하는 경우, 항목 # 1을 삭제합니다삭제 된 엔티티 인스턴스는 여전히 jhipster 샘플 봄 부팅 응용 프로그램 (<a href="https://github.com/jhipster/jhipster-sample-app" rel="nofollow noreferrer">https://github.com/jhipster/jhipster-sample-app</a>), 테스트를 삭제에서
bankAccountRepository.findAll() // item 1 is not present => OK
bankAccountRepository.findOne(1) // item 1 is present => BAD
restBankAccountMockMvc.perform(get("/api/bank-accounts/{id}", bankAccount.getId())) // HTTP code 200 => BAD
findall은 삭제 된 항목이없는 목록을 반환하지만 삭제 된 항목을 반환 findOne 왜 이해가 안 돼요.
어떻게하면됩니까?
bankAccountRepository.findOne(1) // null
restBankAccountMockMvc.perform(get("/api/bank-accounts/{id}", bankAccount.getId())) // HTTP code 404
참고 : 저는 jhipster 프로젝트에서 내 응용 프로그램을 시작하지 않았으며 좋은 아이디어를 얻기 위해 생성 된 코드를 보았습니다. 그래서 빈 maven/spring-boot 프로젝트에서 프로젝트를 시작했습니다.