use of gov.ca.cwds.rest.api.domain.Address in project API by ca-cwds.
the class AddressServiceTest method testFindReturnsCorrectEntity.
@Override
@Test
public void testFindReturnsCorrectEntity() throws Exception {
when(addressDao.find(new Long(1))).thenReturn(new gov.ca.cwds.data.persistence.ns.Address(1L, "742 Evergreen Terrace", "Springfield", "WA", new Integer(98700), "Home"));
Address expected = new Address("", "", "742 Evergreen Terrace", "Springfield", "WA", 98700, "Home");
Address found = addressService.find(new Long(1));
assertThat(found, is(expected));
}
use of gov.ca.cwds.rest.api.domain.Address in project API by ca-cwds.
the class AddressServiceTest method testCreateReturnsCorrectEntity.
@Override
@Test
public void testCreateReturnsCorrectEntity() throws Exception {
gov.ca.cwds.data.persistence.ns.Address toCreate = new gov.ca.cwds.data.persistence.ns.Address(10L, "742 Evergreen Terrace", "Springfield", "WA", new Integer(98700), "Home");
Address request = new Address(toCreate);
when(addressDao.create(any(gov.ca.cwds.data.persistence.ns.Address.class))).thenReturn(toCreate);
PostedAddress expected = new PostedAddress(10, "", "", "742 Evergreen Terrace", "Springfield", "WA", new Integer(98700), "Home");
PostedAddress returned = addressService.create(request);
assertThat(returned, is(expected));
}
use of gov.ca.cwds.rest.api.domain.Address in project API by ca-cwds.
the class AddressServiceTest method testFindReturnsNullWhenNotFound.
@Override
@Test
public void testFindReturnsNullWhenNotFound() throws Exception {
when(addressDao.find(new Long(-1))).thenReturn(null);
Address found = addressService.find(new Long(-1));
assertThat(found, is(nullValue()));
}
use of gov.ca.cwds.rest.api.domain.Address in project API by ca-cwds.
the class AddressValidationServiceTest method testfetchValidatedAddressesThrowsExceptionWhenSmartyStreetsConfigurationNotProvided.
@Test
public void testfetchValidatedAddressesThrowsExceptionWhenSmartyStreetsConfigurationNotProvided() throws Exception {
thrown.expect(Exception.class);
addressValidationService.fetchValidatedAddresses(new Address("", "", "street", "city", "state", 95555, "Home"));
}
use of gov.ca.cwds.rest.api.domain.Address in project API by ca-cwds.
the class AddressValidationServiceTest method updateThrowsNotImplementedException.
/*
* update tests
*/
@Test
public void updateThrowsNotImplementedException() throws Exception {
thrown.expect(NotImplementedException.class);
addressValidationService.update(1L, new Address("", "", "street", "city", "state", 95555, "Home"));
}
Aggregations