Spring Certified Professional 2023 · Free Practice Question Easy
Question 34
Which testing libraries come with the spring-boot-starter-test starter? (select 2)
-
A
Robot Framework
-
B
Hamcrest
-
C
powerMock
-
D
JsonPath
Reveal correct answers
Correct answers: B, D
Explanation
Test scope dependencies
If you use the spring-boot-starter-test ‘Starter’ (in the test scope), you will find the following provided libraries:
JUnit — The de-facto standard for unit testing Java applications.
Spring Test & Spring Boot Test — Utilities and integration test support for Spring Boot applications.
AssertJ — A fluent assertion library.
Hamcrest — A library of matcher objects (also known as constraints or predicates).
Mockito — A Java mocking framework.
JSONassert — An assertion library for JSON.
JsonPath — XPath for JSON.
By default, Spring Boot uses Mockito 1.x. However it’s also possible to use 2.x if you wish.
These are common libraries that we generally find useful when writing tests. You are free to add additional test dependencies of your own if these don’t suit your needs.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
