use of org.orcid.pojo.ajaxForm.Client in project ORCID-Source by ORCID.
the class GroupAdministratorControllerTest method testInvalidName.
@Test
public void testInvalidName() {
Client client = controller.getClient();
client.setRedirectUris(new ArrayList<RedirectUri>());
client.setDisplayName(Text.valueOf("This is a <a>invalid</a> name"));
client.setShortDescription(Text.valueOf("This is a valid description"));
client.setWebsite(Text.valueOf("http://www.orcid.org"));
client = controller.createClient(client);
assertNotNull(client);
assertEquals(1, client.getErrors().size());
assertEquals(controller.getMessage("manage.developer_tools.group.error.display_name.html"), client.getErrors().get(0));
}
use of org.orcid.pojo.ajaxForm.Client in project ORCID-Source by ORCID.
the class GroupAdministratorControllerTest method emptyClientTest.
@Test
@Transactional("transactionManager")
@Rollback(true)
public void emptyClientTest() {
Client client = controller.getClient();
client = controller.createClient(client);
assertNotNull(client);
List<String> errors = client.getErrors();
assertEquals(4, errors.size());
assertTrue(errors.contains(controller.getMessage("manage.developer_tools.group.error.display_name.empty")));
assertTrue(errors.contains(controller.getMessage("manage.developer_tools.group.error.website.empty")));
assertTrue(errors.contains(controller.getMessage("manage.developer_tools.group.error.short_description.empty")));
assertTrue(errors.contains(controller.getMessage("common.invalid_url")));
}
Aggregations