B - is not entirely true, Test methods annotated with @SpringBootTest do not recreate the ApplicationContext for each test method. Instead, the ApplicationContext is created once per test class, and it is cached and shared across multiple test methods in the same class (or even across different test classes), unless specifically instructed otherwise.
The correct answers are:
B. Test methods in a @SpringBootTest class are transactional by default. C. @SpringBootTest is typically used for integration testing.
Explanation:
B. Test methods in a @SpringBootTest class are transactional by default. This means that any changes to the database made by a test method will be rolled back by default.
C. @SpringBootTest is typically used for integration testing. It provides a full Spring ApplicationContext, including all of the infrastructure beans, as well as your application's beans. It is also capable of starting a web server, making it ideal for testing web applications, and testing a broad range of application components.
I think the E answere is correct.
see https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/context/SpringBootTest.html
the @SpringBootTest is not applicable at method level.
There is no @TestApplicationContext annotation in Spring Testing.
upvoted 1 times
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Uteman
1 month, 2 weeks agoUteman
1 month, 2 weeks agoEvoila_TrainingMaterial
3 months, 2 weeks ago2211094
5 months, 1 week agoasaladino75
8 months, 3 weeks agoGlothan
11 months, 1 week agoTolo01
1 year, 3 months agonesreenmhd123
1 year, 1 month ago