CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/spring-boot-4

Build Spring Boot 4.0 applications - project setup, REST controllers, dependency injection, configuration, actuator, and testing

91

1.79x
Quality

90%

Does it follow best practices?

Impact

97%

1.79x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Build a Product Catalog REST API

Problem/Feature Description

Your company is launching a new product catalog microservice that will power the storefront's browsing and search experience. The service needs to expose a REST API for managing products (create, read, update, delete, and search) and must be production-ready from day one, meaning it should include observability endpoints so the platform team can monitor health, collect metrics, and wire it into the Kubernetes readiness/liveness probe system.

The service must also handle errors gracefully, returning structured error responses that front-end and API gateway consumers can parse uniformly. Use Spring Boot 4 for the implementation. Provide all relevant source files including the build descriptor, main application class, controller, service layer, exception handler, and configuration.

Output Specification

Produce a complete, self-contained Spring Boot 4 project that includes:

  • Build file (pom.xml or build.gradle.kts) with correct dependencies and Java version
  • src/main/resources/application.properties with server, actuator, and JSON configuration
  • Main application class with the standard Spring Boot entry point
  • ProductController with endpoints: GET /api/products, GET /api/products/{id}, POST /api/products, PUT /api/products/{id}, DELETE /api/products/{id}, GET /api/products/search?q={query}
  • ProductService (interface or class) with the business logic stub
  • GlobalExceptionHandler that handles at minimum a ProductNotFoundException and returns structured error responses
  • A Product model (record or class)

The project should compile without errors and follow modern Spring Boot 4 conventions throughout.

evals

tile.json