use of io.crnk.core.engine.repository.mock.NewInstanceRepositoryMethodParameterProvider in project crnk-framework by crnk-project.
the class RepositoryAdapterTest method setUp.
@Before
public void setUp() throws Exception {
queryParams = new QueryParams();
queryAdapter = new QueryParamsAdapter(queryParams);
parameterFactory = new ParametersFactory(new NewInstanceRepositoryMethodParameterProvider());
}
use of io.crnk.core.engine.repository.mock.NewInstanceRepositoryMethodParameterProvider in project crnk-framework by crnk-project.
the class AnnotatedResourceRepositoryAdapterTest method setUp.
@Before
public void setUp() throws Exception {
queryParams = new QueryParams();
queryAdapter = new QueryParamsAdapter(queryParams);
parameterProvider = new ParametersFactory(new NewInstanceRepositoryMethodParameterProvider());
}
use of io.crnk.core.engine.repository.mock.NewInstanceRepositoryMethodParameterProvider in project crnk-framework by crnk-project.
the class FilterTest method test.
@Test
public void test() throws Exception {
// WHEN
ArgumentCaptor<DocumentFilterContext> captor = ArgumentCaptor.forClass(DocumentFilterContext.class);
when(collectionGet.isAcceptable(any(JsonPath.class), eq(requestType))).thenCallRealMethod();
when(filter.filter(any(DocumentFilterContext.class), any(DocumentFilterChain.class))).thenCallRealMethod();
Map<String, Set<String>> queryParams = new HashMap<>();
RepositoryMethodParameterProvider parameterProvider = new NewInstanceRepositoryMethodParameterProvider();
Document requestBody = new Document();
dispatcher.dispatchRequest(path, requestType, queryParams, parameterProvider, requestBody);
// THEN
verify(filter).filter(captor.capture(), any(DocumentFilterChain.class));
verify(collectionGet, times(1)).handle(any(JsonPath.class), any(QueryAdapter.class), any(RepositoryMethodParameterProvider.class), any(Document.class));
verify(filter, times(1)).filter(any(DocumentFilterContext.class), any(DocumentFilterChain.class));
DocumentFilterContext value = captor.getValue();
Assert.assertEquals("tasks", value.getJsonPath().getElementName());
Assert.assertEquals(parameterProvider, value.getParameterProvider());
Assert.assertEquals(requestBody, value.getRequestBody());
Assert.assertEquals("GET", value.getMethod());
}
use of io.crnk.core.engine.repository.mock.NewInstanceRepositoryMethodParameterProvider in project crnk-framework by crnk-project.
the class AnnotatedRelationshipRepositoryAdapterTest method setUp.
@Before
public void setUp() throws Exception {
queryParams = new QueryParams();
queryAdapter = new QueryParamsAdapter(queryParams);
parameterProvider = new ParametersFactory(new NewInstanceRepositoryMethodParameterProvider());
}
Aggregations