1 | COMPLETE SPRING BOOT
INVENTORY APPLICATION | 2026/2027 .
150 Questions with Answers and Detailed Rationales
100 PERCENT GUARANTEED PASS
INSTANT DOWNLOAD ANSWERS INCLUDED
IMPORTANCE OF THIS DOCUMENT
This comprehensive examination preparation guide has been meticulously developed to help you succeed in the
WGU D287 JAVA FRAMEWORKS TASK 1 | COMPLETE SPRING BOOT INVENTORY APPLICATION |
2026/2027 .. It contains 150 carefully selected questions that reflect the most current exam content and testing
strategies. Each question is accompanied by a correct answer and a detailed rationale that explains the
underlying pathophysiology, pharmacology, or clinical reasoning.
Self-Assessment – Test your knowledge and Exam Preparation – Familiarize yourself with the
identify areas requiring further question format and content
study areas
Concept Reinforcement – Deepen your Confidence Building – Develop test-taking
understanding through strategies and reduce
evidence-based exam anxiety
rationales
Time Management – Practice answering
questions under simulated
exam conditions
Review Summary 150 Questions
Foundations - Application - WGU D287 JAVA Frameworks TASK 1 Complete Spring BOOT Inventory
Application 2026/2027 JAVA Frameworks Spring BOOT WEB Development Graduate / Advanced
Undergraduate
All answers with rationales
,Table of Contents
Content Area Questions Key Topics
Spring BOOT Fundamentals 1-25 Spring, Application, YOU NEED, Repository, Correctly
Restful WEB Services 26-50 Spring, Application, Inventory, Correctly, Method
Spring DATA JPA AND 51-75 Spring, Application, Method, Controller, Custom
Database Integration
Thymeleaf Templating 76-100 Spring, Application, Method, Inventory, Describes
Spring MVC Controllers AND 101-125 Spring, Application, Inventory, Configuration, Method
Request Mapping
FORM Validation AND Error 126-150 Spring, Application, Inventory, Method, Developer
Handling
TOTAL 150 All questions include answers and detailed rationales
,Section A - Spring BOOT Fundamentals
Q1.
In a Spring Boot REST controller, you have a method that returns a
ResponseEntity<Resource<Item>>. You need to ensure that the response includes a
self-link and a link to the collection resource. Which approach correctly uses Spring
HATEOAS to satisfy this requirement?
A. Use EntityModel.of(item).add(linkTo(meth B. Use
odOn(ItemController.class).getItem(item.getI RepresentationModelAssemblerSupport to
d())).withSelfRel(), linkTo(methodOn(ItemCo convert the entity to a ResourceSupport and
ntroller.class).getAllItems()).withRel("items") manually add links
)
C. Use WebMvcLinkBuilder.linkTo(ItemContr D. Use @EnableHypermediaSupport(type =
oller.class).slash(item.getId()).withSelfRel() HypermediaType.HAL) and return the entity
and add to the ResponseEntity headers directly; Spring will auto-generate links
Correct: A - Use EntityModel.of(item).add(linkTo(methodOn(ItemController.class).getItem(i
tem.getId())).withSelfRel(),
linkTo(methodOn(ItemController.class).getAllItems()).withRel("items"))
Rationale:Option A correctly uses EntityModel and WebMvcLinkBuilder to add self and
collection links. Option B is valid but less direct; C adds links to headers, not body; D requires
configuration but does not auto-generate links without explicit methods.
Q2.
Given a Spring Data JPA repository for an Item entity with fields: id, name, category, price,
and quantity. You need to find items with a price greater than a given value and sort by
name descending, while avoiding N+1 queries on a lazily-loaded category. Which
repository method signature is most efficient and correct?
A. List<Item> findByPriceGreaterThanOrder B. @Query("SELECT i FROM Item i JOIN
ByNameDesc(double price); FETCH i.category WHERE i.price > :price
ORDER BY i.name DESC") List<Item>
findWithCategoryByPrice(@Param("price")
double price);
C. List<Item> D. @Query("SELECT i FROM Item i
findByPriceGreaterThan(double price, Sort WHERE i.price > :price ORDER BY i.name
sort); // with Sort.by(Order.desc("name")) DESC") List<Item>
findItems(@Param("price") double price);
Correct: B - @Query("SELECT i FROM Item i JOIN FETCH i.category WHERE i.price >
:price ORDER BY i.name DESC") List<Item> findWithCategoryByPrice(@Param("price")
double price);
Page 3
, Section A - Spring BOOT Fundamentals
Rationale: Option B uses JOIN FETCH to eagerly fetch the category, avoiding N+1 queries,
and the query is explicit. Option A works but does not fetch category. Option C does not fetch
category. Option D also causes N+1. Thus B is best.
Q3.
In a Spring Boot application secured with Spring Security and OAuth2, you need to
configure JWT validation for an API that uses RS256-signed tokens. Which setup correctly
obtains the public key from the authorization server's JWK Set URI and configures the
resource server?
A. Use NimbusJwtDecoder with a local B. Use
public key file, and set spring.security.oauth JwtDecoders.fromIssuerLocation(issuerUri)
2.resourceserver.jwt.jwk-set-uri in and set spring.security.oauth2.resourceserv
application.yml er.jwt.issuer-uri in application.yml
C. Implement a custom JwtDecoder that D. Use
fetches the JWK Set on every request and spring-security-oauth2-resource-server and
validates the token manually configure a JwtAuthenticationConverter with
a fixed public key
Correct: B - Use JwtDecoders.fromIssuerLocation(issuerUri) and set
spring.security.oauth2.resourceserver.jwt.issuer-uri in application.yml
Rationale:Option B uses the standard Spring Security approach:
JwtDecoders.fromIssuerLocation() automatically fetches the JWK Set from the issuer's
metadata, and the issuer-uri property configures it. Option A is for manual configuration.
Option C is inefficient. Option D lacks key rotation support.
Q4.
You are writing a @WebMvcTest for a controller that uses a service class. Which
combination of annotations and test setup correctly creates a sliced Spring context and
mocks the service dependency?
A. @WebMvcTest(ItemController.class) B. @SpringBootTest
@MockBean ItemService itemService; @AutoConfigureMockMvc @MockBean
@Autowired MockMvc mockMvc; ItemService itemService; @Autowired
MockMvc mockMvc;
C. @WebMvcTest D. @WebMvcTest(ItemController.class)
@Import(ItemService.class) @MockBean @MockBean ItemRepository
ItemRepository itemRepository; itemRepository; @Autowired MockMvc
mockMvc;
Correct: A - @WebMvcTest(ItemController.class) @MockBean ItemService itemService;
@Autowired MockMvc mockMvc;
Page 4