Skip to content

Commit

Permalink
svc-bip-api: General cleanup (#2766)
Browse files Browse the repository at this point in the history
* Removed all instances of unused classes and moved things around.

* Spotless java

---------

Co-authored-by: Ponnia <151670616+Ponnia-M@users.noreply.github.com>
  • Loading branch information
dfitchett and Ponnia-M authored Mar 18, 2024
1 parent 140d5d2 commit e6b6c0e
Show file tree
Hide file tree
Showing 38 changed files with 33 additions and 543 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import gov.va.vro.bip.model.BipClaim;
import gov.va.vro.bip.model.BipPayloadRequest;
import gov.va.vro.bip.model.BipPayloadResponse;
import gov.va.vro.bip.model.ExistingContention;
import gov.va.vro.bip.model.claim.BipClaim;
import gov.va.vro.bip.model.claim.GetClaimResponse;
import gov.va.vro.bip.model.contentions.ExistingContention;
import gov.va.vro.bip.model.contentions.GetClaimContentionsResponse;
import gov.va.vro.bip.service.BipResetMockController;
import gov.va.vro.bip.service.IBipApiService;
Expand Down Expand Up @@ -71,16 +71,17 @@ protected <T extends BipPayloadResponse> T sendAndReceive(
return (T) rabbitTemplate.convertSendAndReceive(exchangeName, queue, request);
}

protected ExistingContention getExistingContention(long claimId) {
GetClaimContentionsResponse getResponse = bipApiService.getClaimContentions(claimId);
protected ExistingContention getExistingContention() {
GetClaimContentionsResponse getResponse =
bipApiService.getClaimContentions(BaseIntegrationTest.CLAIM_ID_200);
assertBaseResponseIs2xx(getResponse, HttpStatus.OK);
assertNotNull(getResponse.getContentions());
assertEquals(1, getResponse.getContentions().size());
return getResponse.getContentions().get(0);
}

protected BipClaim getExistingClaim(long claimId) {
GetClaimResponse getResponse = bipApiService.getClaimDetails(claimId);
protected BipClaim getExistingClaim() {
GetClaimResponse getResponse = bipApiService.getClaimDetails(BaseIntegrationTest.CLAIM_ID_200);
assertBaseResponseIs2xx(getResponse, HttpStatus.OK);
assertNotNull(getResponse.getClaim());
return getResponse.getClaim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import gov.va.vro.bip.model.BipClaim;
import gov.va.vro.bip.model.cancel.CancelClaimRequest;
import gov.va.vro.bip.model.cancel.CancelClaimResponse;
import gov.va.vro.bip.model.claim.BipClaim;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;

Expand All @@ -15,7 +15,7 @@ public class CancelClaimTest extends BaseIntegrationTest {

@Test
void testCancelClaim_200() {
BipClaim existingClaim = getExistingClaim(CLAIM_ID_200);
BipClaim existingClaim = getExistingClaim();
assertEquals(OPEN, existingClaim.getClaimLifecycleStatus());

CancelClaimRequest request =
Expand All @@ -27,7 +27,7 @@ void testCancelClaim_200() {
CancelClaimResponse response = sendAndReceive(cancelClaimQueue, request);
assertBaseResponseIs2xx(response, HttpStatus.OK);

BipClaim updatedClaim = getExistingClaim(CLAIM_ID_200);
BipClaim updatedClaim = getExistingClaim();
assertEquals(CANCELLED, updatedClaim.getClaimLifecycleStatus());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import gov.va.vro.bip.model.Contention;
import gov.va.vro.bip.model.contentions.Contention;
import gov.va.vro.bip.model.contentions.CreateClaimContentionsRequest;
import gov.va.vro.bip.model.contentions.CreateClaimContentionsResponse;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

import gov.va.vro.bip.model.ExistingContention;
import gov.va.vro.bip.model.contentions.ExistingContention;
import gov.va.vro.bip.model.contentions.UpdateClaimContentionsRequest;
import gov.va.vro.bip.model.contentions.UpdateClaimContentionsResponse;
import org.junit.jupiter.api.Test;
Expand All @@ -15,7 +15,7 @@ public class UpdateClaimContentionsTest extends BaseIntegrationTest {

@Test
void testUpdateClaimContentions_200() {
ExistingContention original = getExistingContention(CLAIM_ID_200);
ExistingContention original = getExistingContention();
assertNull(original.getAltContentionName());
String altContentionName = "This didnt exist";
ExistingContention modified = original.toBuilder().altContentionName(altContentionName).build();
Expand All @@ -29,7 +29,7 @@ void testUpdateClaimContentions_200() {
sendAndReceive(updateClaimContentionsQueue, updateRequest);
assertBaseResponseIs2xx(updateResponse, HttpStatus.OK);

ExistingContention updated = getExistingContention(CLAIM_ID_200);
ExistingContention updated = getExistingContention();
assertEquals(altContentionName, updated.getAltContentionName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import gov.va.vro.bip.service.BipApiProps;
import gov.va.vro.bip.service.BipException;
import gov.va.vro.bip.service.ClaimProps;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
Expand Down Expand Up @@ -57,11 +56,6 @@ public BipApiProps getBipApiProps() {
return new BipApiProps();
}

@Bean
public ClaimProps getClaimProps() {
return new ClaimProps();
}

private KeyStore getKeyStore(String base64, String password)
throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
KeyStore keyStore = KeyStore.getInstance("PKCS12");
Expand Down
12 changes: 0 additions & 12 deletions svc-bip-api/src/main/java/gov/va/vro/bip/model/BipClaimResp.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

48 changes: 0 additions & 48 deletions svc-bip-api/src/main/java/gov/va/vro/bip/model/ClaimStatus.java

This file was deleted.

Loading

0 comments on commit e6b6c0e

Please sign in to comment.