Docsity

WGU D287 JAVA FRAMEWORKS TASK 1 | COMPLETE SPRING BOOT INVENTORY APPLICATION | 2026/2027, Exams of Nursing

Toggle sidebar
bg1
WGU D287 JAVA FRAMEWORKS TASK
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
identify areas requiring further
study
Exam Preparation – Familiarize yourself with the
question format and content
areas
Concept Reinforcement – Deepen your
understanding through
evidence-based
rationales
Confidence Building – Develop test-taking
strategies and reduce
exam anxiety
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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45

Partial preview of the text

Download WGU D287 JAVA FRAMEWORKS TASK 1 | COMPLETE SPRING BOOT INVENTORY APPLICATION | 2026/2027 and more Exams Nursing in PDF only on Docsity!

WGU D287 JAVA FRAMEWORKS TASK

1 | COMPLETE SPRING BOOT

INVENTORY APPLICATION | 2026/.

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 identify areas requiring further study

Exam Preparation – Familiarize yourself with the question format and content areas Concept Reinforcement – Deepen your understanding through evidence-based rationales

Confidence Building – Develop test-taking strategies and reduce exam anxiety 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 Database Integration

51-75 Spring, Application, Method, Controller, Custom

Thymeleaf Templating 76-100 Spring, Application, Method, Inventory, Describes

Spring MVC Controllers AND Request Mapping

101-125 Spring, Application, Inventory, Configuration, Method

FORM Validation AND Error Handling

126-150 Spring, Application, Inventory, Method, Developer

TOTAL 150 All questions include answers and detailed rationales

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 public key file, and set spring.security.oauth 2.resourceserver.jwt.jwk-set-uri in application.yml

B. Use JwtDecoders.fromIssuerLocation(issuerUri) and set spring.security.oauth2.resourceserv er.jwt.issuer-uri in application.yml

C. Implement a custom JwtDecoder that fetches the JWK Set on every request and validates the token manually

D. Use spring-security-oauth2-resource-server and 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) @MockBean ItemService itemService; @Autowired MockMvc mockMvc;

B. @SpringBootTest @AutoConfigureMockMvc @MockBean ItemService itemService; @Autowired MockMvc mockMvc;

C. @WebMvcTest @Import(ItemService.class) @MockBean ItemRepository itemRepository;

D. @WebMvcTest(ItemController.class) @MockBean ItemRepository itemRepository; @Autowired MockMvc mockMvc; Correct: A - @WebMvcTest(ItemController.class) @MockBean ItemService itemService; @Autowired MockMvc mockMvc;

Section A - Spring BOOT Fundamentals

Rationale: Option A correctly uses @WebMvcTest to load only web layer beans, @MockBean to replace the service, and autowires MockMvc. B loads full context, not sliced. C imports the real service, defeating mocking. D mocks the repository but not the service.

Q5. In a Spring Boot application, you have a repository method that updates item quantities. You need to ensure that concurrent updates do not cause lost updates. Which strategy should you implement to achieve optimistic locking?

A. Add @Version private Long version; to the Item entity and use the repository's save() method

B. Use @Lock(LockModeType.PESSIMISTI C_WRITE) on the repository method

C. Use synchronized blocks around the update logic in the service layer

D. Set spring.jpa.properties.hibernate.jdbc.b atch_versioned_data=true Correct: A - Add @Version private Long version; to the Item entity and use the repository's save() method

Rationale:Option A uses a @Version field, which is the standard JPA optimistic locking mechanism. Option B is pessimistic locking, not optimistic. Option C is not scalable across instances. Option D is a performance hint, not a locking strategy.

Q6. You have a Spring Boot application that uses a connection pool. You want to monitor the pool's health and ensure it is properly configured for production. Which of the following is the most appropriate way to expose and configure the HikariCP pool metrics?

A. Add spring-boot-starter-actuator and set management.endpoint.health.show-details= always; enable HikariCP metrics via spring.d atasource.hikari.metrics.enabled=true

B. Add spring-boot-starter-actuator and expose the /actuator/metrics/hikaricp endpoint; configure pool size via spring.datasource.hikari.maximum-pool-size

C. Use Micrometer directly to register HikariCP metrics and add a custom HealthIndicator

D. Add spring-boot-starter-jdbc and use JdbcTemplate to query the pool's active connections Correct: B - Add spring-boot-starter-actuator and expose the /actuator/metrics/hikaricp endpoint; configure pool size via spring.datasource.hikari.maximum-pool-size

Rationale:Option B correctly uses Actuator and Micrometer, which automatically exposes HikariCP metrics when the pool is on the classpath. Option A is incorrect because HikariCP metrics are not enabled via a specific property; they are auto-configured. Option C is more manual than needed. Option D is not a monitoring solution.

Section A - Spring BOOT Fundamentals recommended practices?

A. Use @ExceptionHandler in the controller to catch the exception and return a ResponseEntity with a Map body

B. Implement a @RestControllerAdvice class with @ExceptionHandler methods for each exception

C. Use @ControllerAdvice and implement ErrorController to override the default error response

D. Let Spring Boot's default error handling return a generic error response

Correct: B - Implement a @RestControllerAdvice class with @ExceptionHandler methods for each exception

Rationale:Option B uses @RestControllerAdvice, which centralizes exception handling and is the recommended approach. Option A works but scatters handling across controllers. Option C is for global error paths, not ideal for API exceptions. Option D does not provide structured custom responses.

Q10. You are developing a Spring Boot application that uses Spring Data JPA with a PostgreSQL database. You have an entity with a field that is a Java enum. You want to store the enum as a string in the database. Which annotation configuration is correct?

A. @Enumerated(EnumType.STRING) on the enum field

B. @Convert(converter = EnumConverter.class) on the enum field

C. Use @Column(columnDefinition = "varchar") on the enum field

D. Both A and B are valid, but A is simpler if no custom mapping is needed Correct: D - Both A and B are valid, but A is simpler if no custom mapping is needed

Rationale:Option A uses @Enumerated(EnumType.STRING), which is the standard way to store enum names. Option B uses a converter, which is useful for custom mappings. Option C is not sufficient alone. D is correct because both A and B are valid, but A is the simplest.

Q11. In a Spring Boot inventory service, an entity is annotated with @Version. A client submits an update using a stale version number. Which outcome is guaranteed under JPA optimistic locking?

A. The update overwrites the record and increments the version

B. The update fails with OptimisticLockException and the transaction rolls back

C. The update is silently ignored and the version remains unchanged

D. The update merges changes and forces a new version number Correct: B - The update fails with OptimisticLockException and the transaction rolls back

Section A - Spring BOOT Fundamentals

Rationale: JPA optimistic locking uses the @Version field to detect concurrent modifications. If the version in the update request does not match the current version in the database, the persistence provider throws OptimisticLockException, and the transaction is marked for rollback. The other options describe behaviors of pessimistic locking or no locking.

Q12. A Spring Boot application uses an H2 in-memory database. During testing, you need to verify the exact SQL statements generated by a repository method. Which approach provides the most direct and reliable evidence?

A. Enable H2's TRACE_LEVEL_SYSTEM_OUT=2 and inspect the console logs

B. Set spring.jpa.show-sql=true and read the Hibernate output

C. Add a custom interceptor that logs PreparedStatement parameters

D. Use a spy on the DataSource to capture all executed SQL Correct: B - Set spring.jpa.show-sql=true and read the Hibernate output

Rationale:Setting spring.jpa.show-sql=true configures Hibernate to log the generated SQL statements directly to the console, providing the exact SQL before execution. H2's TRACE_LEVEL_SYSTEM_OUT=2 logs JDBC trace information, not necessarily the SQL string. A custom interceptor or DataSource spy requires additional code and may not capture the exact Hibernate-generated SQL.

Q13. In a Spring Boot REST controller, you want to ensure that a request body is validated only for the create operation, not for the update operation. Both operations use the same DTO class. Which strategy best achieves this without duplicating the DTO?

A. Use @Validated on the controller and @Valid on the method parameter for create only

B. Define two separate DTO classes with different validation annotations

C. Use validation groups: assign constraints to a Create group and apply @Validated(Create.class) on the create method

D. Perform manual validation inside the create method and skip validation on update

Correct: C - Use validation groups: assign constraints to a Create group and apply @Validated(Create.class) on the create method

Rationale:Bean Validation groups allow you to assign constraints to specific groups (e.g., Create) and then activate those groups using @Validated(Create.class) on the method parameter. This enables different validation rules for different operations without duplicating the DTO. Using @Valid alone applies the default group to all operations. Manual validation is error-prone and less maintainable.

Section A - Spring BOOT Fundamentals

Q16. In a Spring Boot application, you have a repository method that returns Optional. You call orElseThrow(() -> new ProductNotFoundException(id)). What is the primary benefit of this pattern compared to returning null?

A. It avoids a NullPointerException by returning a default product

B. It makes the possibility of absence explicit and enforces a functional recovery path

C. It improves performance by avoiding database round-trips

D. It allows the method to return a primitive type instead of an object Correct: B - It makes the possibility of absence explicit and enforces a functional recovery path

Rationale:Using Optional and orElseThrow makes the possibility of no result explicit and forces the caller to handle absence by throwing an exception. This prevents NullPointerException and improves code clarity. It does not return a default product (that would be orElse), nor does it affect performance or change return types.

Q17. You need to schedule a daily inventory report at 2:30 AM. Which Cron expression correctly represents this schedule in Spring's @Scheduled annotation?

A. 0 30 2 * *? B. 0 30 2 * * *

C. 0 0 2 30 *? D. 30 0 2 * *?

Correct: A - 0 30 2 * *?

Rationale:Spring's cron syntax uses six fields: second, minute, hour, day of month, month, day of week. '0 30 2 * * ?' means at 2:30:00 AM every day (the '?' is used for day of week when day of month is '*'). Option B is invalid because it has seven fields. Option C would trigger at 2:00 on the 30th of every month. Option D has minutes and seconds swapped.

Q18. You are designing a Spring Boot service that sends email notifications. You want to ensure that if sending the email fails, the transaction that updated the inventory is rolled back. Which annotation combination achieves this?

A. @Transactional on the service method that performs both operations

B. @Transactional on the repository method that updates inventory

C. @Async on the email sending method D. @Retryable on the email sending method Correct: A - @Transactional on the service method that performs both operations

Section A - Spring BOOT Fundamentals

Rationale: By placing @Transactional on the service method that performs both the inventory update and the email sending, any runtime exception (including from the email service) will cause the transaction to roll back, undoing the inventory change. Annotating only the repository method commits the inventory update before the email is sent. @Async and @Retryable do not affect transaction boundaries.

Q19. Given the following property in application.yml:

spring: datasource: url: jdbc:mysql://localhost:3306/inventory username: root password: secret jpa: hibernate: ddl-auto: update

A developer accidentally commits this file to a public repository. Which practice is the best immediate mitigation?

A. Change the password in the file and commit the change

B. Remove the file from the repository and rotate the database password

C. Use environment variables for the password and keep the file

D. Set ddl-auto to none to prevent schema changes Correct: B - Remove the file from the repository and rotate the database password

Rationale:Once credentials are exposed, the only safe action is to rotate the password and remove the secret from the repository. Simply changing the password in the file does not revoke the already-leaked credential. Using environment variables is good practice but does not mitigate the exposure that already occurred. Setting ddl-auto to none is unrelated to security.

Q20. You are writing a unit test for a service class that depends on a ProductRepository. You want to verify that the service calls repository.save() with an entity that has a non-null id. Which testing approach is most appropriate?

A. Use Mockito to mock the repository and verify the save() call with an ArgumentCaptor

B. Use @DataJpaTest to load the Spring context and test against a real H2 database

C. Use AssertJ's assertThat on the returned entity to check the id

D. Use a spy on the repository to track interactions

Section A - Spring BOOT Fundamentals

Q23. In a Thymeleaf template, you need to dynamically render a table row for each part in a list, but only if the part's inventory is below its minimum. Which Thymeleaf attribute and syntax correctly accomplishes this?

A. th:each="part : ${parts}" with th:if="${part.inventory < part.minInv}" on the

B. th:for="part : ${parts}" with th:when="${part.inventory < part.minInv}" on the

C. th:each="part : ${parts}" with th:unless="${part.inventory < part.minInv}" on the

D. th:iterate="part : ${parts}" with th:if="${part.inventory} < ${part.minInv}" on the Correct: A - th:each="part : ${parts}" with th:if="${part.inventory < part.minInv}" on the

Rationale:Thymeleaf uses th:each for iteration and th:if to conditionally render content. Option A correctly uses both. Option B uses incorrect attributes. Option C uses th:unless which would render when the condition is false. Option D uses invalid syntax for both attributes.

Q24. You are designing a REST controller in Spring Boot. Which annotation combination is required to create a POST endpoint that accepts JSON and returns HTTP 201 Created with a Location header?

A. @PostMapping, @RequestBody, ResponseEntity with status Created and header Location

B. @RequestMapping(method = RequestMethod.POST), @ResponseBody, ResponseEntity with status OK

C. @PostMapping, @RequestParam, ModelAndView with status Created and header Location

D. @PostMapping, @RequestBody, @ResponseStatus(HttpStatus.CREATED) with void return type Correct: A - @PostMapping, @RequestBody, ResponseEntity with status Created and header Location

Rationale:To return a Location header, you need a ResponseEntity with the status and header set. @ResponseStatus alone cannot set headers. Option B returns OK instead of Created and uses @ResponseBody unnecessarily. Option C uses @RequestParam for query parameters, not JSON body. Option D cannot set the Location header.

Q25. In a Spring Boot application, you have a service class that needs to interact with both a repository and an external REST API. Which annotation is best to use on the service class to enable dependency injection and transactional behavior?

Section A - Spring BOOT Fundamentals

A. @Service and @Transactional B. @Component and @Transactional

C. @Repository and @Transactional D. @Controller and @Transactional Correct: A - @Service and @Transactional

Rationale:@Service is the stereotype annotation for service layer classes, making them candidates for component scanning. @Transactional enables transaction management on methods. @Component also works but @Service is more semantically correct. @Repository is for data access, @Controller is for web layer.

Section B - Restful WEB Services

Rationale: ddl-auto=update tells Hibernate to update the schema automatically, adding new tables or columns as needed without dropping data. create-drop drops and recreates the schema each time, which is not suitable for production. validate only checks the schema without changes. none disables DDL generation.

Q29. In a Spring Boot application, you have a custom application.properties file in an external directory. Which command-line argument correctly points Spring Boot to this external configuration file?

A. --spring.config.location=file:/path/to/applic ation.properties

B. --spring.config.additional-location=classp ath:application.properties

C. --spring.config.name=external D. --spring.config.path=file:/path/to/applicati on.properties Correct: A - --spring.config.location=file:/path/to/application.properties

Rationale:The property spring.config.location overrides the default config file location. Using file: prefix specifies a file system path. additional-location adds to the default locations, not replaces. spring.config.name changes the file name, not location. spring.config.path is not a valid property.

Q30. You are building a Spring Boot application that uses Spring Security. Which configuration class correctly defines a security filter chain that permits all requests to /api/public and requires authentication for /api/private?

A. @EnableWebSecurity and a SecurityFilterChain bean with requestMatchers("/api/public").permitAll() and anyRequest().authenticated()

B. @EnableWebSecurity and a WebSecurityConfigurerAdapter with authoriz eRequests().antMatchers("/api/public").perm itAll().anyRequest().authenticated()

C. @Configuration and a SecurityFilterChain bean with requestMatchers("/api/public").permitAll() and anyRequest().permitAll()

D. @EnableWebSecurity and a SecurityFilterChain bean with requestMatch ers("/api/private").authenticated() and anyRequest().permitAll() Correct: A - @EnableWebSecurity and a SecurityFilterChain bean with requestMatchers("/api/public").permitAll() and anyRequest().authenticated()

Section B - Restful WEB Services

Rationale: In Spring Security 5.7+, the recommended approach is to define a SecurityFilterChain bean with requestMatchers. Option B uses deprecated WebSecurityConfigurerAdapter. Option C permits all requests, which is incorrect. Option D reverses the rules, making only /api/private require auth but all others permitted, which would expose /api/private? Actually it would require auth for /api/private, but anyRequest().permitAll() would allow others, but the question asks for /api/public permitAll and /api/private authenticated, so D is wrong.

Q31. In a Spring Boot inventory application using Spring Data JPA, which annotation combination on an entity ensures optimistic locking with a version column and prevents lost updates during concurrent stock adjustments?

A. @Version on a Long field; @Entity on the class; @Id on the primary key

B. @Lock(LockModeType.PESSIMISTIC_W RITE) on the repository method; @Transactional on the service

C. @OptimisticLocking on the class; @Version on a Timestamp field

D. @Column(unique=true) on the stock quantity field; @Entity on the class Correct: A - @Version on a Long field; @Entity on the class; @Id on the primary key

Rationale:Optimistic locking in JPA is enabled by annotating a numeric or timestamp field with @Version, which JPA increments on each update and checks during merge to detect concurrent modifications. Pessimistic locking (B) is a different strategy and not annotation-based on the entity. @OptimisticLocking (C) is not a standard JPA annotation. A unique constraint (D) does not provide versioning.

Q32. Given a Spring Boot REST controller that returns inventory items, which HTTP status code should be returned when a client sends a request with a malformed JSON body that fails bean validation?

A. 400 Bad Request B. 422 Unprocessable Entity

C. 500 Internal Server Error D. 409 Conflict Correct: A - 400 Bad Request

Rationale:Malformed JSON or validation failures on the request body result in a 400 Bad Request because the client's request is syntactically incorrect or fails validation. 422 is sometimes used for semantic errors, but Spring Boot's default for @Valid failures is 400. 500 indicates server errors, and 409 indicates a conflict with the current state.

Section B - Restful WEB Services

Rationale: @Transactional by default rolls back on RuntimeException and Error, but not on checked exceptions. Option B forces rollback on all exceptions, including checked. Option C disables rollback on runtime exceptions, which is incorrect. Option D is not a Spring annotation; it is from EJB.

Q36. In a Spring Boot application that exposes a GraphQL API for inventory queries, which dependency is required to enable GraphQL support?

A. spring-boot-starter-graphql B. spring-boot-starter-web

C. spring-boot-starter-data-rest D. spring-boot-starter-actuator Correct: A - spring-boot-starter-graphql

Rationale:Spring Boot provides GraphQL support through the spring-boot-starter-graphql dependency, which auto-configures GraphQL endpoints and schema handling. The web starter (B) is for REST, data-rest (C) exposes JPA repositories as REST, and actuator (D) provides monitoring endpoints.

Q37. When deploying a Spring Boot inventory application as a Docker container, which of the following is the best practice for passing database credentials to avoid hardcoding them in the application.properties?

A. Use environment variables with Spring's ${DB_URL} placeholder

B. Hardcode credentials in a configmap

C. Use a random password generated at build time

D. Store credentials in the image labels

Correct: A - Use environment variables with Spring's ${DB_URL} placeholder

Rationale:Environment variables are the recommended way to externalize configuration in containerized Spring Boot apps, using placeholders like ${DB_URL} to resolve them. Hardcoding in a configmap (B) is not secure, random passwords (C) would break connections, and image labels (D) are not a secure or standard method.

Q38. In a Spring Boot inventory app, you need to log every request and response with a correlation ID for tracing. Which Spring Boot feature is most appropriate to implement this cross-cutting concern?

A. A HandlerInterceptor with a OncePerRequestFilter

B. A @RestControllerAdvice exception handler

Section B - Restful WEB Services

C. A @Component that implements CommandLineRunner

D. A scheduled task using @Scheduled

Correct: A - A HandlerInterceptor with a OncePerRequestFilter

Rationale:A HandlerInterceptor or a OncePerRequestFilter can intercept HTTP requests and responses to add a correlation ID and log them. @RestControllerAdvice handles exceptions, CommandLineRunner runs at startup, and @Scheduled is for scheduled tasks-none of these provide request/response logging.

Q39. Which Spring Data JPA query method name would correctly find inventory items where the quantity is less than a given reorder level, and return the results sorted by name?

A. findByQuantityLessThanOrderByNameAs c(int reorderLevel)

B. findByQuantityLessThanEqualOrderByNa meDesc(int reorderLevel)

C. findAllByReorderLevelGreaterThanOrder ByNameAsc(int quantity)

D. findByQuantityGreaterThanOrderByNam eAsc(int reorderLevel) Correct: A - findByQuantityLessThanOrderByNameAsc(int reorderLevel)

Rationale:The method name 'findByQuantityLessThanOrderByNameAsc' defines a query for entities where quantity < reorderLevel, sorted by name ascending. Option B uses <=, which is not the same. Option C checks reorderLevel > quantity, and option D uses >, both incorrect.

Q40. In a Spring Boot application, which actuator endpoint provides the most detailed information about the application's health, including disk space and database status, when configured with the 'show-details' property?

A. /actuator/health B. /actuator/info

C. /actuator/metrics D. /actuator/env Correct: A - /actuator/health

Rationale:/actuator/health shows the health status of the application, and with management.endpoint.health.show-details=always, it includes details about disk space, database, and other components. /actuator/info shows static application info, /actuator/metrics exposes runtime metrics, and /actuator/env shows environment properties.

Q41. In a Spring Boot inventory application using Spring Data JPA, which annotation combination correctly defines an entity with a composite primary key and enables optimistic locking?