Search in sources :

Example 1 with UnknownResource

use of io.crnk.test.mock.models.UnknownResource in project crnk-framework by crnk-project.

the class ExceptionTest method testUnknownRepository.

@Test
public void testUnknownRepository() {
    UnknownResource task = new UnknownResource();
    task.setId("test");
    ResourceRepositoryV2<UnknownResource, String> taskRepo = client.getRepositoryForType(UnknownResource.class);
    try {
        taskRepo.create(task);
        Assert.fail();
    } catch (ResourceNotFoundException e) {
    // ok
    }
}
Also used : UnknownResource(io.crnk.test.mock.models.UnknownResource) ResourceNotFoundException(io.crnk.core.exception.ResourceNotFoundException) Test(org.junit.Test)

Aggregations

ResourceNotFoundException (io.crnk.core.exception.ResourceNotFoundException)1 UnknownResource (io.crnk.test.mock.models.UnknownResource)1 Test (org.junit.Test)1