Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 7 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 7
Topic #: 1
[All 2V0-72.22 Questions]

Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)

  • A. EasyMock is supported out of the box.
  • B. @SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.
  • C. Mockito spy is not supported in Spring Boot testing by default.
  • D. The spring-test dependency provides annotations such as @Mock and @MockBean.
  • E. Integration and slice testing are both supported.
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
2211094
4 months, 3 weeks ago
BD is most accurate and correct answer. Because of E does not elaborate clearly how slice and integration tests differs in spring and spring boot.
upvoted 1 times
stefumies
1 month ago
WebMvc is an example of a SliceTest as it is merely testing the web controller layer
upvoted 1 times
...
...
2211094
5 months, 2 weeks ago
Correct answer is B and E
upvoted 2 times
...
Azuni
1 year, 3 months ago
Selected Answer: BC
I have reviewed this question over again and it seems that B and C are the most likely of answers due by process of illumination. A is incorrect for obvious reasons B is correct because @SpringBootTest *OR* @SpringJUnitConfig can be used. I had to wrong in my comment below. That OR makes a big difference. C is correct as Mockito Spy is not supported (only by Spring Framework), but Mockito SpyBean is supported by default. D is incorrect for the same reason as specified in my comment below. E is incorrect for the same reason as specified in my comment below.
upvoted 2 times
...
Azuni
1 year, 3 months ago
Selected Answer: C
It seems that C . It is a very tricky question. The Spring AND Spring Boot is where the trick lies. A) INCORRECT: Of course EasyBox is a dependency that is not out of the box. B) INCORRECT: If you consider Spring AND Spring Boot. @SpringBootTest and @SpringJUnitConfig both work in a Spring Boot application, but you cannot use @SpringBootTest in a plain Spring application. C) CORRECT: Mockito spy does come with Spring Boot, but it isn't supported by defualt. D) INCORRECT: spring-boot-starter-test does in fact provide annotations for @Mock and @MockBean, but spring-test by itself doesn't. E) INCORRECT: Only integration testing are supported by both. Slice testing is only a concept in Spring Boot, not in plain Spring.
upvoted 1 times
...
qqoo
1 year, 4 months ago
Selected Answer: BE
D - it is not chosen because @Mock is commonly associated with other mocking frameworks like Mockito.
upvoted 3 times
Tolo01
1 year, 3 months ago
E is not correct While integration testing and slice testing are both supported in Spring and Spring Boot, they are not both supported by default using a single testing annotation. Integration Testing: Integration testing with Spring is supported using @SpringBootTest or @SpringJUnitConfig. Slice Testing: Slice testing is performed using specialized annotations like @WebMvcTest, @DataJpaTest, etc. These annotations load only a part of the application context to focus
upvoted 1 times
...
...
rhuanca
1 year, 8 months ago
B and D mockito is supported
upvoted 3 times
...
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.

SaveCancel
Loading ...