Search in sources :

Example 16 with IdentifiableTestEntity

use of ca.corefacility.bioinformatics.irida.utils.model.IdentifiableTestEntity in project irida by phac-nml.

the class CRUDServiceImplTest method testRead.

@Test
public void testRead() {
    IdentifiableTestEntity i = new IdentifiableTestEntity();
    i.setId(new Long(1));
    i.setNonNull("Definitely not null");
    when(crudRepository.findOne(i.getId())).thenReturn(i);
    try {
        i = crudService.read(i.getId());
        assertNotNull(i);
    } catch (IllegalArgumentException e) {
        fail();
    }
}
Also used : IdentifiableTestEntity(ca.corefacility.bioinformatics.irida.utils.model.IdentifiableTestEntity) Test(org.junit.Test)

Aggregations

IdentifiableTestEntity (ca.corefacility.bioinformatics.irida.utils.model.IdentifiableTestEntity)16 Test (org.junit.Test)16 IdentifiableTestEntitySpecification (ca.corefacility.bioinformatics.irida.utils.model.IdentifiableTestEntitySpecification)4 HashMap (java.util.HashMap)4 PageImpl (org.springframework.data.domain.PageImpl)4 Pageable (org.springframework.data.domain.Pageable)4 Direction (org.springframework.data.domain.Sort.Direction)4 Order (org.springframework.data.domain.Sort.Order)4 Specification (org.springframework.data.jpa.domain.Specification)4 InvalidPropertyException (ca.corefacility.bioinformatics.irida.exceptions.InvalidPropertyException)2 ConstraintViolationException (javax.validation.ConstraintViolationException)2 EntityNotFoundException (ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 ConstraintViolation (javax.validation.ConstraintViolation)1