3‑02 페이징 테스터데이터 만들때 코드 질문좀할게요

@SpringBootTest
class SbbApplicationTests {

@Autowired
private QuestionRepository questionRepository;

@Autowired
private AnswerRepository answerRepository;

@Autowired
private QuestionService questionService;

@Test
void testJpa() {
    for (int i = 1; i <= 300; i++) {
        String subject = String.format("테스트 데이터입니다:[%03d]", i);
        String content = "내용무";
        this.questionService.create(subject, content);
    }
}

}

여기서요 testJpa()메서드에서 @Transactional 애너테이션을 빼셨는데요 이유가있을까요? 그리고 @Transactional가있으면 데이터가 추가가 안돼는데요 왜인지 궁금합니다

az0362320 611

2023년 10월 1일 10:50 오후

목록으로