Search in sources :

Example 1 with GenericsException

use of ca.corefacility.bioinformatics.irida.web.controller.api.exception.GenericsException in project irida by phac-nml.

the class GenericControllerTest method testGetResource.

@Test
public void testGetResource() {
    when(crudService.read(identifier)).thenReturn(entity);
    ModelMap model = null;
    try {
        model = controller.getResource(identifier);
    } catch (GenericsException e) {
        fail();
    }
    assertTrue(model.containsKey("resource"));
    IdentifiableTestEntity resource = (IdentifiableTestEntity) model.get("resource");
    assertTrue(resource.getLink(Link.REL_SELF).getHref().endsWith(identifier.toString()));
}
Also used : IdentifiableTestEntity(ca.corefacility.bioinformatics.irida.web.controller.test.unit.support.IdentifiableTestEntity) GenericsException(ca.corefacility.bioinformatics.irida.web.controller.api.exception.GenericsException) ModelMap(org.springframework.ui.ModelMap) Test(org.junit.Test)

Aggregations

GenericsException (ca.corefacility.bioinformatics.irida.web.controller.api.exception.GenericsException)1 IdentifiableTestEntity (ca.corefacility.bioinformatics.irida.web.controller.test.unit.support.IdentifiableTestEntity)1 Test (org.junit.Test)1 ModelMap (org.springframework.ui.ModelMap)1