No tests for java quarkus websocket client, if server is not provided in the params
In the integration test for core websocket templates. As in JS testing, it would be nice to have an additional test for Java Quarkus when the server is not provided as a parameter. Because not providing the parameter results in an Error.
How to reproduce?
- Create an asyncapi file with the below content.
asyncapi: 3.0.0
info:
title: Quarkus WebSocket API
version: 1.0.0
description: Simple WebSocket API with JWT security.
servers:
production:
host: api.example.com
pathname: /ws
protocol: wss
description: Production WebSocket server
security:
- type: userPassword
channels:
chat:
address: /chat
messages:
chatMessage:
$ref: '#/components/messages/ChatMessage'
operations:
sendChatMessage:
action: send
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/chatMessage'
receiveChatMessage:
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/chatMessage'
components:
securitySchemes:
jwtAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Send JWT in `Authorization Bearer <token>` header.
messages:
ChatMessage:
name: ChatMessage
contentType: application/json
payload:
type: object
required:
- sender
- content
properties:
sender:
type: string
example: alice
content:
type: string
example: Hello world
-
Run the command
node ./apps/generator/test/cli.js ./asyncapi.yaml ./packages/templates/clients/websocket/java/quarkus --force-write -
You will see the error similar to this
Thanks for the detailed report and reproduction steps.I’d like to work on this issue and add the missing integration test for the Java Quarkus WebSocket client when the server parameter is not provided.
@derberg @Adi-204 , please take a look at this!
hey @batchu5 you can create PR to add additional test-case of java template like JS.
@Adi-204 I checked other core templates, Python and Dart, also have server param as required: true in their respective .ageneratorrc config file, so I think I need to add this additional test to the runCommonTestsfunction. What do you say? Should I take this approach?
hey @batchu5 ok make sense to add it in runCommonTests function. Please go ahead and create PR.