Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to correctly serialize datetimes & refactor lifecycle status endpoint #2251

Merged
merged 11 commits into from
Nov 28, 2023

Conversation

dfitchett
Copy link
Contributor

Contained in this PR:

  1. Changes code to correctly serialize/deserialize fields expressed as a datetime, i.e., 2023-09-27T00:00:00-06:00
  2. This change forced refactor of putClaimLifecycleStatus status due to using the same Beans configured for the restTemplate/rabbitTemplate for message conversion.
  1. Removal of endpoint to set the claim status to RFD, since the putClaimLifecycleStatus endpoint can handle that request

What was the problem?

Date times are not being de/serialized into a date time expressed as a string, but instead as a number of seconds.

Associated tickets or Slack threads:

How does this fix it?1

Updates the jackson2JsonMessageConverter with an objectMapper configured to use the JavaTimeModule which supports serialization/deserialization of datetime strings into java Instants.

How to test this PR

  • Run the unit tests via ./gradlew :svc-bip-api:check
  • Start the platform base docker containers to start RabbitMq and start the BIP Mock container (see Docker Compose)
    • run the integration tests via ./gradlew :svc-bip-api:integrationTest
    • build and compose the svc-bip-api docker and run a test by:
      • create a new queue on the bip-api exchange called response
      • open to the rabbitmq console to the putClaimLifecycleStatus
      • publish a message with the body {"claimId":1010,"claimLifecycleStatus":"test"} and add a message property called reply_to with the value response
      • open the response queue page and perform the get message action
      • verify it is a 200 and the response is the mocked response
      • verify time fields
        • open to the rabbitmq console to the getClaimDetailsQueue
        • publish a message with the body {"claimId":1001} and add a message property called reply_to with the value response
        • open the response queue page and perform the get message action
        • verify it is a 200 and the response is the mocked response
        • verify time fields are timestamp formats

Footnotes

  1. Pull-Requests guidelines. If PR is significant, update Current Software State wiki page.

@dfitchett dfitchett requested a review from a team as a code owner November 22, 2023 21:16
@dfitchett dfitchett changed the title Updated to correctly serialize datetimes. Forced update of endpoint t… Updated to correctly serialize datetimes & refactor lifecycle status endpoint Nov 27, 2023
Base automatically changed from dfitchett/svc-bip-api/refactor-cancel-claim to develop November 27, 2023 23:28
Copy link
Contributor

@greene858 greene858 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…api/integration-fixes

# Conflicts:
#	svc-bip-api/src/integrationTest/java/gov/va/vro/bip/BaseIntegrationTest.java
#	svc-bip-api/src/integrationTest/java/gov/va/vro/bip/RabbitMqIntegrationTest.java
#	svc-bip-api/src/main/java/gov/va/vro/bip/service/BipApiService.java
#	svc-bip-api/src/main/java/gov/va/vro/bip/service/IBipApiService.java
#	svc-bip-api/src/main/java/gov/va/vro/bip/service/RabbitMqController.java
#	svc-bip-api/src/test/java/gov/va/vro/bip/service/BipApiServiceTest.java
Copy link
Contributor

Test Results

143 tests  +3   143 ✔️ +3   46s ⏱️ -1s
  38 suites ±0       0 💤 ±0 
  38 files   ±0       0 ±0 

Results for commit e27c3ec. ± Comparison against base commit 57e5553.

This pull request removes 2 and adds 5 tests. Note that renamed tests count towards both.
gov.va.vro.bip.service.BipApiServiceTest ‑ testSetClaimToRfdStatus()
gov.va.vro.bip.service.BipApiServiceTest ‑ testSetClaimToRfdStatus_500()
gov.va.vro.bip.service.BipApiServiceTest ‑ testCancelClaimInternalServerError_500()
gov.va.vro.bip.service.BipApiServiceTest ‑ testPutLifecycleStatusInternalServerError_500()
gov.va.vro.bip.service.BipApiServiceTest ‑ testPutLifecycleStatus_200()
gov.va.vro.bip.service.BipApiServiceTest ‑ testPutLifecycleStatus_DOWNSTREAM_ERROR
gov.va.vro.bip.service.BipApiServiceTest ‑ testPutLifecycleStatus_NOT_FOUND


@Getter
@Jacksonized
@SuperBuilder(toBuilder = true)

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'instance' is never used.
The parameter 'b' is never used.

@Getter
@Jacksonized
@SuperBuilder(toBuilder = true)

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
BipPayloadResponse.toBuilder
; it is advisable to add an Override annotation.
Copy link
Contributor

JaCoCo Test Coverage

File Coverage [89.8%] 🍏
BipApiService.java 99.79% 🍏
BipRequestErrorHandler.java 81.4% 🍏
RabbitMqController.java 0%
Total Project Coverage 76.26%

@dfitchett dfitchett merged commit 6201ea6 into develop Nov 28, 2023
1 check passed
@dfitchett dfitchett deleted the dfitchett/svc-bip-api/integration-fixes branch November 28, 2023 00:30
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.

3 participants