Apply test-driven development to Quarkus 3.x features, fixes, and refactors.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "quarkus-tdd" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/quarkus-tdd/SKILL.md 2. Save it as ~/.claude/skills/quarkus-tdd/SKILL.md 3. Reload skills and tell me it's ready
Using TDD for Quarkus 3.x, design the implementation steps for a create-order REST API: write JUnit 5 and REST Assured tests first, then add the minimal implementation, mock the repository with Mockito, and provide the folder structure and sample code.
A red-green-refactor walkthrough with test and implementation samples, including API tests, service mocks, minimal runnable code, and project structure.
I have a Camel-based Quarkus event processing service that writes duplicate records when consuming messages. Use TDD to first create a failing test that reproduces the issue, then provide a fix with Camel tests, Mockito mocks, and regression tests.
A failing reproduction test, fix strategy, and regression test cases that verify the duplicate-write bug is reliably resolved.
Propose a TDD-driven refactoring plan for an existing Quarkus 3.x service: identify refactoring opportunities, add JUnit 5, Mockito, and REST Assured tests, and configure JaCoCo coverage reporting with a target above 80%.
A step-by-step refactoring plan, test addition recommendations, JaCoCo configuration examples, and a path to higher coverage.
TDD guidance for Quarkus 3.x services with 80%+ coverage (unit + integration). Optimized for event-driven architectures with Apache Camel.
Follow this structured approach for comprehensive, readable tests:
@ExtendWith(MockitoExtension.class)
@DisplayName("OrderService Unit Tests")
class OrderServiceTest {
@Mock
private OrderRepository orderRepository;
@Mock
private EventService eventService;
@Mock
private FulfillmentPublisher fulfillmentPublisher;
@InjectMocks
private OrderService orderService;
private CreateOrderCommand validCommand;
@BeforeEach
void setUp() {
validCommand = new CreateOrderCommand(
"customer-123",
List.of(new OrderLine("sku-123", 2))
);
}
@Nested
@DisplayName("Tests for createOrder")
class CreateOrder {
@Test
@DisplayName("Should persist order and publish fulfillment event")
void givenValidCommand_whenCreateOrder_thenPersistsAndPublishes() {
// ARRANGE
doNothing().when(orderRepository).persist(any(Order.class));
// ACT
OrderReceipt receipt = orderService.createOrder(validCommand);
// ASSERT
assertThat(receipt).isNotNull();
assertThat(receipt.customerId()).isEqualTo("customer-123");
verify(orderRepository).persist(any(Order.class));
verify(fulfillmentPublisher).publishAsync(receipt);
verify(eventService).createSuccessEvent(receipt, "ORDER_CREATED");
}
@Test
@DisplayName("Should reject missing customer id")
void givenMissingCustomerId_whenCreateOrder_thenThrowsBadRequest() {
// ARRANGE
CreateOrderCommand invalid = new CreateOrderCommand("", validCommand.lines());
// ACT & ASSERT
WebApplicationException exception = assertThrows(
WebApplicationException.class,
() -> orderService.createOrder(invalid)
);
assertThat(exception.getResponse().getStatus()).isEqualTo(400);
verify(orderRepository, never()).persist(any(Order.class));
verify(fulfillmentPublisher, never()).publishAsync(any());
}
@Test
@DisplayName("Should record error event when persistence fails")
void givenPersistenceFailure_whenCreateOrder_thenRecordsErrorEvent() {
// ARRANGE
doThrow(new PersistenceException("database unavailable"))
.when(orderRepository).persist(any(Order.class));
// ACT & ASSERT
PersistenceException exception = assertThrows(
PersistenceException.class,
() -> orderService.createOrder(validCommand)
);
assertThat(exception.getMessage()).contains("database unavailable");
verify(eventService).createErrorEvent(
eq(validCommand),
eq("ORDER_CREATE_FAILED"),
contains("database unavailable")
);
verify(fulfillmentPublisher, never()).publishAsync(any());
}
@Test
@DisplayName("Should reject null commands")
void givenNullCommand_whenCreateOrder_thenThrowsNullPointerException() {
// ACT & ASSERT
assertThrows(
NullPointerException.class,
() -> orderService.createOrder(null)
);
verify(orderRepository, never()).persist(any(Order.class));
}
}
}
givenX_whenY_thenZ for clarity…
Conduct multi-source web research and produce cited, source-attributed reports.
Unify multi-channel notifications for routing, deduplication, escalation, and inbox consolidation.
Audit, plan, and implement SEO improvements for better search visibility.
Refine retrieved context iteratively to improve subagent understanding and output quality.
Fetches up-to-date framework docs for setup, APIs, and code examples.
Design adaptive agent workflows with eval gates and reusable skill extraction.
Design Quarkus 3 backend patterns for messaging, APIs, data, and async workflows.
Practice test-driven development for Spring Boot features, fixes, and refactoring.
Run a pre-release verification loop for Quarkus builds, tests, scans, and reviews.
Apply consistent Java coding standards for Spring Boot and Quarkus services.
Build features, fix bugs, and refactor code with test-driven development.
Build high-quality Kotlin tests with Kotest, MockK, coroutines, and coverage.