@Test public void testExecuteSingleResultWithExtendingOrQuery() { given() .header(ACCEPT_JSON_HEADER) .pathParam("id", EXAMPLE_FILTER_ID) .contentType(POST_JSON_CONTENT_TYPE) .body(extendingOrQueryDto) .then().expect() .statusCode(Status.OK.getStatusCode()) .when() .post(EXECUTE_SINGLE_RESULT_FILTER_URL); ArgumentCaptor<TaskQueryImpl> argument = ArgumentCaptor.forClass(TaskQueryImpl.class); verify(filterServiceMock).singleResult(eq(EXAMPLE_FILTER_ID), argument.capture()); assertEquals(MockProvider.EXAMPLE_TASK_DESCRIPTION, argument.getValue().getQueries().get(1).getDescription()); assertEquals(MockProvider.EXAMPLE_TASK_NAME, argument.getValue().getQueries().get(2).getName()); }
dto.taskDefinitionKeyIn = taskQuery.getKeys(); dto.taskDefinitionKeyLike = taskQuery.getKeyLike(); dto.description = taskQuery.getDescription(); dto.descriptionLike = taskQuery.getDescriptionLike(); dto.involvedUser = taskQuery.getInvolvedUser();
dto.taskDefinitionKeyIn = taskQuery.getKeys(); dto.taskDefinitionKeyLike = taskQuery.getKeyLike(); dto.description = taskQuery.getDescription(); dto.descriptionLike = taskQuery.getDescriptionLike(); dto.involvedUser = taskQuery.getInvolvedUser();
@Test public void testOrQuery() { TaskQueryDto queryDto = TaskQueryDto.fromQuery(new TaskQueryImpl() .or() .taskName(MockProvider.EXAMPLE_TASK_NAME) .taskDescription(MockProvider.EXAMPLE_TASK_DESCRIPTION) .endOr()); given() .contentType(POST_JSON_CONTENT_TYPE) .header(ACCEPT_JSON_HEADER) .body(queryDto) .then().expect() .statusCode(Status.OK.getStatusCode()) .when() .post(TASK_QUERY_URL); ArgumentCaptor<TaskQueryImpl> argument = ArgumentCaptor.forClass(TaskQueryImpl.class); verify(((TaskQueryImpl) mockQuery)).addOrQuery(argument.capture()); assertEquals(MockProvider.EXAMPLE_TASK_NAME, argument.getValue().getName()); assertEquals(MockProvider.EXAMPLE_TASK_DESCRIPTION, argument.getValue().getDescription()); }
when(query.getKeys()).thenReturn(new String[]{MockProvider.EXAMPLE_TASK_DEFINITION_KEY, MockProvider.EXAMPLE_TASK_DEFINITION_KEY}); when(query.getKeyLike()).thenReturn(MockProvider.EXAMPLE_TASK_DEFINITION_KEY); when(query.getDescription()).thenReturn(MockProvider.EXAMPLE_TASK_DESCRIPTION); when(query.getDescriptionLike()).thenReturn(MockProvider.EXAMPLE_TASK_DESCRIPTION); when(query.getInvolvedUser()).thenReturn(MockProvider.EXAMPLE_USER_ID);
JsonUtil.addField(json, NAME_LIKE, query.getNameLike()); JsonUtil.addField(json, NAME_NOT_LIKE, query.getNameNotLike()); JsonUtil.addField(json, DESCRIPTION, query.getDescription()); JsonUtil.addField(json, DESCRIPTION_LIKE, query.getDescriptionLike()); JsonUtil.addField(json, PRIORITY, query.getPriority());
JsonUtil.addField(json, NAME_LIKE, query.getNameLike()); JsonUtil.addField(json, NAME_NOT_LIKE, query.getNameNotLike()); JsonUtil.addField(json, DESCRIPTION, query.getDescription()); JsonUtil.addField(json, DESCRIPTION_LIKE, query.getDescriptionLike()); JsonUtil.addField(json, PRIORITY, query.getPriority());
if (extendingQuery.getDescription() != null) { extendedQuery.taskDescription(extendingQuery.getDescription()); else if (this.getDescription() != null) { extendedQuery.taskDescription(this.getDescription());
if (extendingQuery.getDescription() != null) { extendedQuery.taskDescription(extendingQuery.getDescription()); else if (this.getDescription() != null) { extendedQuery.taskDescription(this.getDescription());
assertEquals(testString, query.getNameNotLike()); assertEquals(testString, query.getNameLike()); assertEquals(testString, query.getDescription()); assertEquals(testString, query.getDescriptionLike()); assertEquals(testInteger, query.getPriority());
dto.taskDefinitionKeyIn = taskQuery.getKeys(); dto.taskDefinitionKeyLike = taskQuery.getKeyLike(); dto.description = taskQuery.getDescription(); dto.descriptionLike = taskQuery.getDescriptionLike(); dto.involvedUser = taskQuery.getInvolvedUser();
addField(json, NAME_LIKE, query.getNameLike()); addField(json, NAME_NOT_LIKE, query.getNameNotLike()); addField(json, DESCRIPTION, query.getDescription()); addField(json, DESCRIPTION_LIKE, query.getDescriptionLike()); addField(json, PRIORITY, query.getPriority());
if (extendingQuery.getDescription() != null) { extendedQuery.taskDescription(extendingQuery.getDescription()); else if (this.getDescription() != null) { extendedQuery.taskDescription(this.getDescription());
assertEquals(testString, query.getNameNotLike()); assertEquals(testString, query.getNameLike()); assertEquals(testString, query.getDescription()); assertEquals(testString, query.getDescriptionLike()); assertEquals(testInteger, query.getPriority());