SpringBootTest

전승원·2020년 12월 13일
0

강의출처- 김영한 강사님(https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81-%EC%9E%85%EB%AC%B8-%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8)
This post is just for taking notes on what I learned today.

  • One tip when making integratedTestCase

    Normally it is recommended to register bean through constructor, but in test case, just for convenience, it is okay to register bean directly to the property.

  • MemberServiceIntegrationTest(통합테스트 케이스)

  • SpringBootTest annotation enables test class to execute it with the Spring container.

  • Transactional annotation in Test class enables us to rollback the result of transaction whether it has failed or succeeded as opposed to actual service class.( In case of actual service class, it rolls back if it's failed, commit if it's succeeded.)

  • This kind of Transaction is called "Declarative Transaction". Rollback enables us to do the test case separately.

profile
No pleasure, No gain

0개의 댓글