assertFalse(validator.supports(String.class));
}
@Test
public void testValid() {
Domain domain = new Organization();
domain.setId(1L);
domain.getUuid();
form.setDomainUUID(domain.getUuid());
form.setAddress("testAddress");
form.setCompanyName("testCompany");
form.setEmailAddress("test@test.com");
form.setFirstName("firstName");
form.setLastName("lastName");
form.setRegion(1L);
form.setDeviceType(DeviceType.IPAD_1);
form.setPhoneNumber("1231231234");
form.getLanguages().add(Language.ENGLISH);
Mockito.when(domainService.getByUUID(form.getDomainUUID())).thenReturn(domain);
Mockito.when(domainService.getDomainForRegion(form.getRegion())).thenReturn(domain);
Mockito.when(domainRequestService.doesDomainRequestExist(domain.getId(), form.getEmailAddress())).thenReturn(false);
validator.validate(form, errors);
assertEquals(errors.getErrorCount(), 0);
}