Skip to content

Commit

Permalink
Closes #2246 - add grouping by sors and pors
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzheboka committed Jun 9, 2023
1 parent f81b54f commit c43ddbe
Show file tree
Hide file tree
Showing 23 changed files with 804 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ void should_PopulateEveryTaskanaConfiguration_When_EveryBuilderFunctionIsCalled(
boolean expectedAddAdditionalUserInfo = true;
Set<WorkbasketPermission> expectedMinimalPermissionsToAssignDomains =
Set.of(WorkbasketPermission.CUSTOM_2);
// database configuration
boolean expectedUseSpecificDb2Taskquery = false;

// when
TaskanaConfiguration configuration =
Expand Down Expand Up @@ -346,6 +348,7 @@ void should_PopulateEveryTaskanaConfiguration_When_EveryBuilderFunctionIsCalled(
// user configuration
.addAdditionalUserInfo(expectedAddAdditionalUserInfo)
.minimalPermissionsToAssignDomains(expectedMinimalPermissionsToAssignDomains)
.useSpecificDb2Taskquery(expectedUseSpecificDb2Taskquery)
.build();

// then
Expand Down Expand Up @@ -478,6 +481,8 @@ void should_PopulateEveryConfigurationProperty_When_UsingCopyConstructor() {
// user configuration
.addAdditionalUserInfo(true)
.minimalPermissionsToAssignDomains(Set.of(WorkbasketPermission.CUSTOM_2))
//database configuration
.useSpecificDb2Taskquery(false)
.build();

TaskanaConfiguration copyConfiguration = new Builder(configuration).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ void should_ReturnTask_When_RequestingTaskByTaskId() throws Exception {
assertThat(readTask.getCustomField(TaskCustomField.CUSTOM_16)).isEqualTo("custom16");
assertThatCode(() -> readTask.getCustomAttributeMap().put("X", "Y")).doesNotThrowAnyException();
assertThatCode(() -> readTask.getCallbackInfo().put("X", "Y")).doesNotThrowAnyException();
assertThat(readTask).hasNoNullFieldsOrPropertiesExcept("ownerLongName", "completed");
assertThat(readTask)
.hasNoNullFieldsOrPropertiesExcept("ownerLongName", "completed", "groupByCount");
}

@WithAccessId(user = "user-1-1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void should_ReturnAllTasksWithAllAttributesSet_When_NotApplyingAnyFilter() throw
List<TaskSummary> list = taskService.createTaskQuery().workbasketIdIn(wb.getId()).list();

assertThat(list).containsExactlyInAnyOrder(taskSummary1, taskSummary2);
assertThat(taskSummary1).hasNoNullFieldsOrPropertiesExcept("ownerLongName");
assertThat(taskSummary1).hasNoNullFieldsOrPropertiesExcept("ownerLongName", "groupByCount");
}

@WithAccessId(user = "user-1-1")
Expand Down Expand Up @@ -697,6 +697,9 @@ void setup() throws Exception {
taskInWorkbasket(wb)
.completed(Instant.parse("2020-02-01T00:00:00Z"))
.buildAndStoreAsSummary(taskService);
taskInWorkbasket(wb)
.completed(null)
.buildAndStoreAsSummary(taskService);
}

@WithAccessId(user = "user-1-1")
Expand Down Expand Up @@ -871,6 +874,7 @@ void setup() throws Exception {
taskSummary1 = taskInWorkbasket(wb).note("Note1").buildAndStoreAsSummary(taskService);
taskSummary2 = taskInWorkbasket(wb).note("Note2").buildAndStoreAsSummary(taskService);
taskSummary3 = taskInWorkbasket(wb).note("Lorem ipsum").buildAndStoreAsSummary(taskService);
taskInWorkbasket(wb).note(null).buildAndStoreAsSummary(taskService);
}

@WithAccessId(user = "user-1-1")
Expand Down Expand Up @@ -1772,8 +1776,16 @@ void setup() throws Exception {
wb = createWorkbasketWithPermission();
por1 = defaultTestObjectReference().company("15").build();
ObjectReference por2 = defaultTestObjectReference().build();
taskSummary1 = taskInWorkbasket(wb).primaryObjRef(por1).buildAndStoreAsSummary(taskService);
taskSummary2 = taskInWorkbasket(wb).primaryObjRef(por2).buildAndStoreAsSummary(taskService);
taskSummary1 =
taskInWorkbasket(wb)
.primaryObjRef(por1)
.due(Instant.parse("2022-11-15T09:42:00.000Z"))
.buildAndStoreAsSummary(taskService);
taskSummary2 =
taskInWorkbasket(wb)
.primaryObjRef(por2)
.due(Instant.parse("2022-11-15T09:45:00.000Z"))
.buildAndStoreAsSummary(taskService);
}

@WithAccessId(user = "user-1-1")
Expand Down Expand Up @@ -3066,13 +3078,17 @@ void setup() throws Exception {
.type("SecondType")
.build();
taskSummary2 =
taskInWorkbasket(wb).objectReferences(sor2).buildAndStoreAsSummary(taskService);
taskInWorkbasket(wb)
.objectReferences(sor2)
.due(Instant.parse("2022-11-15T09:42:00.000Z"))
.buildAndStoreAsSummary(taskService);

ObjectReference sor2copy = sor2.copy();
ObjectReference sor1copy = sor1.copy();
taskSummary3 =
taskInWorkbasket(wb)
.objectReferences(sor2copy, sor1copy)
.due(Instant.parse("2022-11-15T09:45:00.000Z"))
.buildAndStoreAsSummary(taskService);

ObjectReference sor3 =
Expand Down
Loading

0 comments on commit c43ddbe

Please sign in to comment.