Skip to content

Commit

Permalink
chore: Update to microcks-quarkus 0.2.7 and add APIExamples illustration
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Broudoux <[email protected]>
  • Loading branch information
lbroudoux committed Dec 16, 2024
1 parent 41a8d76 commit 43ec4d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<quarkus.platform.version>3.16.2</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.5.2</surefire-plugin.version>
<quarkus-microcks.version>0.2.6</quarkus-microcks.version>
<quarkus-microcks.version>0.2.7</quarkus-microcks.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
23 changes: 23 additions & 0 deletions src/main/resources/order-events-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: mocks.microcks.io/v1alpha1
kind: APIExamples
metadata:
name: Order Events API
version: '0.1.0'
operations:
PUBLISH orders-reviewed:
Validated OrderEvent 2:
eventMessage:
mediaType: application/json
payload:
timestamp: 1706087114346
order:
id: abc-def-ghi
customerId: yadayac
status: VALIDATED
productQuantities:
- productName: Croissant
quantity: 1
- productName: Pain Chocolat
quantity: 1
totalPrice: 4.2
changeReason: Validation
4 changes: 3 additions & 1 deletion step-5-write-async-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ public class OrderServiceTests extends BaseTest {
try {
// Launch the Microcks test and wait a bit to be sure it actually connects to Kafka.
// Because of Redpanda, it must be >3 sec to ensure the consumer get a refresh of metadata and actually receive messages.
// Update: with Redpanda > 24, this is no longer needed as metadata are refreshed on consumer creation.
CompletableFuture<TestResult> testRequestFuture = MicrocksContainer.testEndpointAsync(microcksContainerUrl, kafkaTest);

TimeUnit.MILLISECONDS.sleep(3500L);
TimeUnit.MILLISECONDS.sleep(500L);

// Invoke the application to create an order.
Order createdOrder = service.placeOrder(info);

// You may check additional stuff on createdOrder...
assertEquals(OrderStatus.CREATED, createdOrder.getStatus());

// Get the Microcks test result.
TestResult testResult = testRequestFuture.get();
Expand Down

0 comments on commit 43ec4d7

Please sign in to comment.