Search in sources :

Example 1 with ContextCriteria

use of org.dotwebstack.framework.core.query.model.ContextCriteria in project dotwebstack-framework by dotwebstack.

the class PostgresBackendLoaderTest method initObjectRequest.

private ObjectRequest initObjectRequest() {
    PostgresObjectType objectType = mock(PostgresObjectType.class);
    when(objectType.getTable()).thenReturn("anyTable");
    Map<String, Object> mapValues = Map.of("a", "bbb");
    ContextCriteria contextCriteria = mock(ContextCriteria.class);
    Context context = mock(Context.class);
    when(context.getFields()).thenReturn(Map.of("a", mock(ContextField.class)));
    when(contextCriteria.getContext()).thenReturn(context);
    when(contextCriteria.getValues()).thenReturn(mapValues);
    when(contextCriteria.getName()).thenReturn("Brewery");
    Map<FieldRequest, ObjectRequest> objectFields = Map.of();
    return ObjectRequest.builder().objectType(objectType).objectFields(objectFields).contextCriteria(contextCriteria).build();
}
Also used : RequestContext(org.dotwebstack.framework.core.query.model.RequestContext) Context(org.dotwebstack.framework.core.model.Context) ObjectRequest(org.dotwebstack.framework.core.query.model.ObjectRequest) PostgresObjectType(org.dotwebstack.framework.backend.postgres.model.PostgresObjectType) FieldRequest(org.dotwebstack.framework.core.query.model.FieldRequest) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ContextCriteria(org.dotwebstack.framework.core.query.model.ContextCriteria)

Aggregations

PostgresObjectType (org.dotwebstack.framework.backend.postgres.model.PostgresObjectType)1 Context (org.dotwebstack.framework.core.model.Context)1 ContextCriteria (org.dotwebstack.framework.core.query.model.ContextCriteria)1 FieldRequest (org.dotwebstack.framework.core.query.model.FieldRequest)1 ObjectRequest (org.dotwebstack.framework.core.query.model.ObjectRequest)1 RequestContext (org.dotwebstack.framework.core.query.model.RequestContext)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1