Search in sources :

Example 6 with AnnotatedResourceRepositoryAdapter

use of io.crnk.legacy.internal.AnnotatedResourceRepositoryAdapter in project crnk-framework by crnk-project.

the class AnnotatedResourceRepositoryAdapterTest method onClassWithoutSaveShouldThrowException.

@Test(expected = RepositoryAnnotationNotFoundException.class)
public void onClassWithoutSaveShouldThrowException() throws Exception {
    // GIVEN
    ResourceRepositoryWithoutAnyMethods repo = new ResourceRepositoryWithoutAnyMethods();
    AnnotatedResourceRepositoryAdapter<Project, Long> sut = new AnnotatedResourceRepositoryAdapter<>(repo, parameterProvider);
    // WHEN
    sut.save(new Project());
}
Also used : Project(io.crnk.core.mock.models.Project) AnnotatedResourceRepositoryAdapter(io.crnk.legacy.internal.AnnotatedResourceRepositoryAdapter) Test(org.junit.Test)

Aggregations

AnnotatedResourceRepositoryAdapter (io.crnk.legacy.internal.AnnotatedResourceRepositoryAdapter)6 Project (io.crnk.core.mock.models.Project)5 Test (org.junit.Test)5 RepositoryRequestSpec (io.crnk.core.engine.dispatcher.RepositoryRequestSpec)1 RepositoryFilterContext (io.crnk.core.engine.filter.RepositoryFilterContext)1 QueryAdapter (io.crnk.core.engine.query.QueryAdapter)1 ResourceRepositoryV2 (io.crnk.core.repository.ResourceRepositoryV2)1 JsonApiResponse (io.crnk.core.repository.response.JsonApiResponse)1 Serializable (java.io.Serializable)1