Skip to content

Conversation

@spicydev
Copy link
Owner

No description provided.

Here's a summary of what I did:

- I improved the Protobuf handlers (ProtoMessageReader, ProtoMessageWriter) for better error handling and logger usage.
- I made adjustments to the TestResource JAX-RS resource to ensure URI correctness, simplified object creation, and proper HTTP status codes.
- I streamlined JaxRsConf for simpler component registration.
- I enhanced the WebSocket classes (ClientWebsocketTest, TestWebSocket) for better URI handling, error logging, AutoCloseable implementation, and @OnClose/@onerror handlers.
- I added equals() and hashCode() methods to the Citizen POJO and its inner Phone class.
- I reviewed DemoApplication and found no changes were needed.

All changes build successfully.
… a summary of what I did:

- I removed the JAX-RS (spring-boot-starter-jersey) dependency and added spring-boot-starter-web.
- I deleted JAX-RS specific configuration files (JaxRsConf, MediaTypeExt, ProtoMessageReader, ProtoMessageWriter).
- I converted TestResource (JAX-RS) to TestController (Spring MVC @RestController).
  - I replaced JAX-RS annotations with Spring MVC equivalents.
  - I updated method signatures, request/response handling to align with Spring MVC.
  - I ensured Protobuf and JSON media types are correctly specified for production/consumption.
- I verified that Spring Boot's auto-configured ProtobufHttpMessageConverter should handle Protobuf messages.
- I reviewed WebSocket client interaction within the new controller; existing JSR-356 support via Undertow is expected to work.
- I improved WebSocket client resource management in TestController using try-with-resources.

The project builds successfully, and the application context loads after these changes.
- Added unit tests for TestController, Citizen POJO, ClientWebsocketTest, and TestWebSocket.
- Refactored ClientWebsocketTest to move connection logic out of the constructor for better testability.
- Updated TestController to use the refactored ClientWebsocketTest.
- Added WebConfig.java to explicitly register ProtobufHttpMessageConverter, resolving Protobuf handling issues in Spring MVC tests.
- Fixed various issues in the newly added tests to ensure they pass and accurately reflect expected behavior.

All 29 new tests across 4 test classes are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants