Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package gov.va.med.ewv.service.impl;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;

import gov.va.med.ars.exceptions.GenericException;
import gov.va.med.ewv.model.response.PatientHeaderInfo;
import gov.va.med.ewv.model.response.PatientInfo;
import gov.va.med.ewv.model.response.VendorInfo;
import gov.va.med.ewv.util.EwvUtils;


@RunWith(MockitoJUnitRunner.class)
public class EwvPatientAndVendorInfoServiceImplTest extends AbstractEwvClaimServiceImplTest {

@Mock
EwvPatientAndVendorInfoServiceImpl ewvPatientAndVendorInfoService;

@Test
public void test_populatePatientHeaderInfo_success() throws GenericException {

PatientHeaderInfo patientHeaderInfo = new PatientHeaderInfo(claimFormat.getValueOf(), claimType, medicareCrossover, "RODGERS-CROMARTIE, DOMINIQUE",
"1234567890", memberId, "1234567890", pdi, "1721590-2", EwvUtils.shorten("1721590-2", 20), Boolean.FALSE);

when(ewvPatientAndVendorInfoService.populatePatientHeaderInfo(ewvClaim)).thenReturn(patientHeaderInfo);
PatientHeaderInfo info = ewvPatientAndVendorInfoService.populatePatientHeaderInfo(ewvClaim);
assertEquals(patientHeaderInfo, info);
}

@Test
public void test_populatePatientInfo() throws GenericException {

PatientInfo patientInfo = new PatientInfo("RODGERS-CROMARTIE, DOMINIQUE", "1234567890", "01/01/1935", "", "M", "1122 Maple Street",
"Apt. B", "NEW YORK", "NY", "12345", "USA");

when(ewvPatientAndVendorInfoService.populatePatientInfo(ewvClaim)).thenReturn(patientInfo);
PatientInfo info = ewvPatientAndVendorInfoService.populatePatientInfo(ewvClaim);
assertEquals(patientInfo, info);
}

@Test
public void test_populateBillingProviderInfo() throws GenericException{
VendorInfo billingProviderInfo = new VendorInfo("GENERAL MEMORIAL HOSPITAL", "1234567890", "1234567890", "",
"1212 SOUTH US HIGHWAY 1", null, "NEW YORK", "NY", "12345", "");

when(ewvPatientAndVendorInfoService.populateBillingProviderInfo(ewvClaim)).thenReturn(billingProviderInfo);
VendorInfo vendorInfo = ewvPatientAndVendorInfoService.populateBillingProviderInfo(ewvClaim);
assertEquals(billingProviderInfo, vendorInfo);
}

@Test
public void test_populateServiceLocationInfo() throws GenericException{
VendorInfo serviceLocationInfo = new VendorInfo("GENERAL DIAGNOSTIC HOSPITAL", "1234567890", "1234567890", "",
"2000 SOUTH US HIGHWAY 1", "SUITE 100", "NEW YORK", "NY", "12345", "");

when(ewvPatientAndVendorInfoService.populateServiceLocationInfo(ewvClaim)).thenReturn(serviceLocationInfo);

VendorInfo vendorInfo = ewvPatientAndVendorInfoService.populateServiceLocationInfo(ewvClaim);
assertEquals(serviceLocationInfo, vendorInfo);
}
}