TSK-1429: automatically formatted all backend code
This commit is contained in:
parent
8437b1fd6e
commit
3849ee385f
|
@ -34,8 +34,7 @@ class JaasExtensionTest {
|
|||
private static final DynamicTest NOT_NULL_DYNAMIC_TEST =
|
||||
dynamicTest("dynamic test", () -> assertThat(CURRENT_USER_CONTEXT.getUserid()).isNotNull());
|
||||
private static final DynamicTest NULL_DYNAMIC_TEST =
|
||||
dynamicTest(
|
||||
"dynamic test", () -> assertThat(CURRENT_USER_CONTEXT.getUserid()).isNull());
|
||||
dynamicTest("dynamic test", () -> assertThat(CURRENT_USER_CONTEXT.getUserid()).isNull());
|
||||
private static final DynamicTest DYNAMIC_TEST_USER_DYNAMIC_TEST =
|
||||
dynamicTest(
|
||||
"dynamic test",
|
||||
|
|
|
@ -51,8 +51,7 @@ public class TaskanaHistoryEngineImpl implements TaskanaHistoryEngine {
|
|||
sessionManager = createSqlSessionManager();
|
||||
}
|
||||
|
||||
public static TaskanaHistoryEngineImpl createTaskanaEngine(
|
||||
TaskanaEngine taskanaEngine) {
|
||||
public static TaskanaHistoryEngineImpl createTaskanaEngine(TaskanaEngine taskanaEngine) {
|
||||
return new TaskanaHistoryEngineImpl(taskanaEngine);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,31 +68,32 @@ public interface ClassificationHistoryQueryMapper {
|
|||
+ "</script>")
|
||||
@Results(
|
||||
value = {
|
||||
@Result(property = "id", column = "ID"),
|
||||
@Result(property = "eventType", column = "EVENT_TYPE"),
|
||||
@Result(property = "created", column = "CREATED"),
|
||||
@Result(property = "userId", column = "USER_ID"),
|
||||
@Result(property = "classificationId", column = "CLASSIFICATION_ID"),
|
||||
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"),
|
||||
@Result(property = "category", column = "CATEGORY"),
|
||||
@Result(property = "domain", column = "DOMAIN"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "name", column = "NAME"),
|
||||
@Result(property = "parentId", column = "PARENT_ID"),
|
||||
@Result(property = "parentKey", column = "PARENT_KEY"),
|
||||
@Result(property = "priority", column = "PRIORITY"),
|
||||
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "custom1", column = "CUSTOM_1"),
|
||||
@Result(property = "custom2", column = "CUSTOM_2"),
|
||||
@Result(property = "custom3", column = "CUSTOM_3"),
|
||||
@Result(property = "custom4", column = "CUSTOM_4"),
|
||||
@Result(property = "custom5", column = "CUSTOM_5"),
|
||||
@Result(property = "custom6", column = "CUSTOM_6"),
|
||||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8")
|
||||
@Result(property = "id", column = "ID"),
|
||||
@Result(property = "eventType", column = "EVENT_TYPE"),
|
||||
@Result(property = "created", column = "CREATED"),
|
||||
@Result(property = "userId", column = "USER_ID"),
|
||||
@Result(property = "classificationId", column = "CLASSIFICATION_ID"),
|
||||
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"),
|
||||
@Result(property = "category", column = "CATEGORY"),
|
||||
@Result(property = "domain", column = "DOMAIN"),
|
||||
@Result(property = "key", column = "KEY"),
|
||||
@Result(property = "name", column = "NAME"),
|
||||
@Result(property = "parentId", column = "PARENT_ID"),
|
||||
@Result(property = "parentKey", column = "PARENT_KEY"),
|
||||
@Result(property = "priority", column = "PRIORITY"),
|
||||
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"),
|
||||
@Result(property = "type", column = "TYPE"),
|
||||
@Result(property = "custom1", column = "CUSTOM_1"),
|
||||
@Result(property = "custom2", column = "CUSTOM_2"),
|
||||
@Result(property = "custom3", column = "CUSTOM_3"),
|
||||
@Result(property = "custom4", column = "CUSTOM_4"),
|
||||
@Result(property = "custom5", column = "CUSTOM_5"),
|
||||
@Result(property = "custom6", column = "CUSTOM_6"),
|
||||
@Result(property = "custom7", column = "CUSTOM_7"),
|
||||
@Result(property = "custom8", column = "CUSTOM_8")
|
||||
})
|
||||
List<ClassificationHistoryEvent> queryHistoryEvents(ClassificationHistoryQueryImpl historyEventQuery);
|
||||
List<ClassificationHistoryEvent> queryHistoryEvents(
|
||||
ClassificationHistoryQueryImpl historyEventQuery);
|
||||
|
||||
@Select(
|
||||
"<script>"
|
||||
|
@ -200,5 +201,4 @@ public interface ClassificationHistoryQueryMapper {
|
|||
+ "<if test='!orderBy.isEmpty()'>ORDER BY <foreach item='item' collection='orderBy' separator=',' >${item}</foreach></if> "
|
||||
+ "</script>")
|
||||
List<String> queryHistoryColumnValues(ClassificationHistoryQueryImpl historyQuery);
|
||||
|
||||
}
|
||||
|
|
|
@ -177,7 +177,9 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
|||
.getValue()
|
||||
.get(TaskHistoryEventType.CREATED.getName())
|
||||
.size()
|
||||
== idsOfTasksInSameParentBusinessProcessGroupedByType.getValue().entrySet()
|
||||
== idsOfTasksInSameParentBusinessProcessGroupedByType
|
||||
.getValue()
|
||||
.entrySet()
|
||||
.stream()
|
||||
.filter(
|
||||
entry -> !entry.getKey().equals(TaskHistoryEventType.CREATED.getName()))
|
||||
|
|
|
@ -51,6 +51,5 @@ class CreateHistoryEventOnTaskCancelClaimAccTest extends AbstractAccTest {
|
|||
String eventType = events.get(0).getEventType();
|
||||
|
||||
assertThat(eventType).isEqualTo(TaskHistoryEventType.CLAIM_CANCELLED.getName());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,8 +48,7 @@ class CreateHistoryEventOnTaskCancellationAccTest extends AbstractAccTest {
|
|||
|
||||
final String taskId = "TKI:000000000000000000000000000000000003";
|
||||
|
||||
List<TaskHistoryEvent> events =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
List<TaskHistoryEvent> events = historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
|
||||
assertThat(events).isEmpty();
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@ class CreateHistoryEventOnTaskTerminationAccTest extends AbstractAccTest {
|
|||
|
||||
final String taskId = "TKI:000000000000000000000000000000000001";
|
||||
|
||||
List<TaskHistoryEvent> events =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
List<TaskHistoryEvent> events = historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
|
||||
assertThat(events).isEmpty();
|
||||
|
||||
|
@ -48,8 +47,7 @@ class CreateHistoryEventOnTaskTerminationAccTest extends AbstractAccTest {
|
|||
|
||||
final String taskId = "TKI:000000000000000000000000000000000003";
|
||||
|
||||
List<TaskHistoryEvent> events =
|
||||
historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
List<TaskHistoryEvent> events = historyService.createTaskHistoryQuery().taskIdIn(taskId).list();
|
||||
|
||||
assertThat(events).isEmpty();
|
||||
|
||||
|
|
|
@ -95,6 +95,5 @@ class CreateHistoryEventOnTaskTransferAccTest extends AbstractAccTest {
|
|||
assertThat(events)
|
||||
.extracting(TaskHistoryEvent::getNewValue)
|
||||
.containsOnly("WBI:100000000000000000000000000000000007");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,5 @@ class CreateHistoryEventOnTaskUpdateAccTest extends AbstractAccTest {
|
|||
String eventType = events.get(0).getEventType();
|
||||
|
||||
assertThat(eventType).isEqualTo(TaskHistoryEventType.UPDATED.getName());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import org.junit.jupiter.api.Test;
|
|||
import pro.taskana.spi.history.api.events.task.TaskHistoryEvent;
|
||||
import pro.taskana.spi.history.api.events.task.TaskHistoryEventType;
|
||||
|
||||
|
||||
class GetTaskHistoryEventAccTest extends AbstractAccTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -62,8 +62,7 @@ class CreateHistoryEventOnWorkbasketAccessItemsSetAccTest extends AbstractAccTes
|
|||
String eventType = events.get(0).getEventType();
|
||||
String details = workbasketHistoryEventMapper.findById(events.get(0).getId()).getDetails();
|
||||
|
||||
assertThat(eventType)
|
||||
.isEqualTo(WorkbasketHistoryEventType.ACCESS_ITEMS_UPDATED.getName());
|
||||
assertThat(eventType).isEqualTo(WorkbasketHistoryEventType.ACCESS_ITEMS_UPDATED.getName());
|
||||
|
||||
assertThat(details).contains("peter");
|
||||
}
|
||||
|
|
|
@ -46,8 +46,7 @@ class CreateHistoryEventOnWorkbasketDistributionTargetAddedAccTest extends Abstr
|
|||
String eventType = events.get(0).getEventType();
|
||||
String details = workbasketHistoryEventMapper.findById(events.get(0).getId()).getDetails();
|
||||
|
||||
assertThat(eventType)
|
||||
.isEqualTo(WorkbasketHistoryEventType.DISTRIBUTION_TARGET_ADDED.getName());
|
||||
assertThat(eventType).isEqualTo(WorkbasketHistoryEventType.DISTRIBUTION_TARGET_ADDED.getName());
|
||||
|
||||
assertThat(details).contains("\"newValue\":\"WBI:100000000000000000000000000000000001\"");
|
||||
}
|
||||
|
|
|
@ -45,8 +45,7 @@ class CreateHistoryEventOnWorkbasketMarkedForDeletionAccTest extends AbstractAcc
|
|||
String eventWorkbasketId = events.get(0).getWorkbasketId();
|
||||
String details = workbasketHistoryEventMapper.findById(events.get(0).getId()).getDetails();
|
||||
|
||||
assertThat(eventType)
|
||||
.isEqualTo(WorkbasketHistoryEventType.MARKED_FOR_DELETION.getName());
|
||||
assertThat(eventType).isEqualTo(WorkbasketHistoryEventType.MARKED_FOR_DELETION.getName());
|
||||
|
||||
assertThat(eventWorkbasketId).isEqualTo(workbasketId);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,9 @@ public class TaskHistoryEventListResourceAssembler {
|
|||
|
||||
private UriComponentsBuilder getBaseUri() {
|
||||
HttpServletRequest request =
|
||||
((ServletRequestAttributes) Objects.requireNonNull(
|
||||
RequestContextHolder.getRequestAttributes())).getRequest();
|
||||
((ServletRequestAttributes)
|
||||
Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))
|
||||
.getRequest();
|
||||
UriComponentsBuilder baseUri =
|
||||
ServletUriComponentsBuilder.fromServletMapping(request).path(request.getRequestURI());
|
||||
|
||||
|
|
|
@ -60,9 +60,7 @@ public class ClassificationReport extends Report<MonitorQueryItem, TimeIntervalC
|
|||
|
||||
public DetailedClassificationReport(
|
||||
List<TimeIntervalColumnHeader> workbasketLevelReportColumnHeaders) {
|
||||
super(
|
||||
workbasketLevelReportColumnHeaders,
|
||||
new String[] {"TASK CLASSIFICATION", "ATTACHMENT"});
|
||||
super(workbasketLevelReportColumnHeaders, new String[] {"TASK CLASSIFICATION", "ATTACHMENT"});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,9 +11,7 @@ public class DetailedClassificationRow extends FoldableRow<DetailedMonitorQueryI
|
|||
|
||||
public DetailedClassificationRow(String key, int columnSize) {
|
||||
super(
|
||||
key,
|
||||
columnSize,
|
||||
item -> item.getAttachmentKey() != null ? item.getAttachmentKey() : "N/A");
|
||||
key, columnSize, item -> item.getAttachmentKey() != null ? item.getAttachmentKey() : "N/A");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -71,7 +71,7 @@ public class TimestampRow extends FoldableRow<TimestampQueryItem> {
|
|||
*/
|
||||
public static final class OrgLevel3Row extends FoldableRow<TimestampQueryItem> {
|
||||
|
||||
private OrgLevel3Row(String key, int columnSize) {
|
||||
private OrgLevel3Row(String key, int columnSize) {
|
||||
super(key, columnSize, TimestampQueryItem::getOrgLevel4);
|
||||
}
|
||||
|
||||
|
|
|
@ -426,7 +426,7 @@ public interface MonitorMapper {
|
|||
@Param("excludedClassificationIds") List<String> excludedClassificationIds,
|
||||
@Param("customAttributeFilter") Map<TaskCustomField, String> customAttributeFilter,
|
||||
@Param("combinedClassificationFilter")
|
||||
List<CombinedClassificationFilter> combinedClassificationFilter,
|
||||
List<CombinedClassificationFilter> combinedClassificationFilter,
|
||||
@Param("customField") TaskCustomField taskCustomField);
|
||||
|
||||
@Select(
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package pro.taskana.spi.history.api.events.classification;
|
||||
|
||||
public enum ClassificationHistoryEventType {
|
||||
|
||||
CREATED("CREATED"),
|
||||
UPDATED("UPDATED"),
|
||||
DELETED("DELETED");
|
||||
|
|
|
@ -12,5 +12,4 @@ public class WorkbasketDistributionTargetsUpdatedEvent extends WorkbasketHistory
|
|||
eventType = WorkbasketHistoryEventType.DISTRIBUTION_TARGETS_UPDATED.getName();
|
||||
created = Instant.now();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ public enum WorkbasketHistoryEventType {
|
|||
DISTRIBUTION_TARGET_REMOVED("DISTRIBUTION_TARGET_REMOVED"),
|
||||
DISTRIBUTION_TARGETS_UPDATED("DISTRIBUTION_TARGETS_UPDATED");
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
WorkbasketHistoryEventType(String name) {
|
||||
|
|
|
@ -23,9 +23,9 @@ public final class TaskRoutingManager {
|
|||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskRoutingManager.class);
|
||||
private static TaskRoutingManager singleton;
|
||||
private boolean enabled = false;
|
||||
private final List<TaskRoutingProvider> theTaskRoutingProviders = new ArrayList<>();
|
||||
private final ServiceLoader<TaskRoutingProvider> serviceLoader;
|
||||
private boolean enabled = false;
|
||||
|
||||
private TaskRoutingManager(TaskanaEngine taskanaEngine) {
|
||||
serviceLoader = ServiceLoader.load(TaskRoutingProvider.class);
|
||||
|
|
|
@ -13,8 +13,8 @@ public class CreateTaskPreprocessorManager {
|
|||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CreateTaskPreprocessorManager.class);
|
||||
private static CreateTaskPreprocessorManager singleton;
|
||||
private boolean enabled = false;
|
||||
private final ServiceLoader<CreateTaskPreprocessor> serviceLoader;
|
||||
private boolean enabled = false;
|
||||
|
||||
private CreateTaskPreprocessorManager() {
|
||||
serviceLoader = ServiceLoader.load(CreateTaskPreprocessor.class);
|
||||
|
|
|
@ -206,7 +206,7 @@ public interface TaskQuery extends BaseQuery<TaskSummary, TaskQueryColumnName> {
|
|||
* Add the owner for pattern matching to your query. It will be compared in SQL with the LIKE
|
||||
* operator. You may use a wildcard like % to specify the pattern.
|
||||
*
|
||||
* <p>If you specify multiple arguments they are combined with the OR keyword.</p>
|
||||
* <p>If you specify multiple arguments they are combined with the OR keyword.
|
||||
*
|
||||
* @param owners the owners of the searched tasks
|
||||
* @return the query
|
||||
|
@ -215,10 +215,10 @@ public interface TaskQuery extends BaseQuery<TaskSummary, TaskQueryColumnName> {
|
|||
|
||||
/**
|
||||
* Add the {@link ObjectReference} to exact match to your query. Each individual value has to
|
||||
* match. Fields with the value 'null' will be ignored.
|
||||
* The id of each ObjectReference will be ignored
|
||||
* match. Fields with the value 'null' will be ignored. The id of each ObjectReference will be
|
||||
* ignored
|
||||
*
|
||||
* <p>If you specify multiple arguments they are combined with the OR keyword.</p>
|
||||
* <p>If you specify multiple arguments they are combined with the OR keyword.
|
||||
*
|
||||
* @param objectReferences the combined values which are searched together.
|
||||
* @return the query
|
||||
|
|
|
@ -3,9 +3,7 @@ package pro.taskana.task.internal;
|
|||
import pro.taskana.common.api.exceptions.SystemException;
|
||||
import pro.taskana.task.api.TaskCustomField;
|
||||
|
||||
/**
|
||||
* Determines which custom properties are to be updated.
|
||||
*/
|
||||
/** Determines which custom properties are to be updated. */
|
||||
public class TaskCustomPropertySelector {
|
||||
|
||||
boolean custom1 = false;
|
||||
|
|
|
@ -168,8 +168,7 @@ class TaskTransferrer {
|
|||
taskId,
|
||||
destinationWorkbasketId);
|
||||
if (HistoryEventManager.isHistoryEnabled()) {
|
||||
createTaskTransferredEvent(
|
||||
task, oldWorkbasketSummary.getId(), destinationWorkbasketId);
|
||||
createTaskTransferredEvent(task, oldWorkbasketSummary.getId(), destinationWorkbasketId);
|
||||
}
|
||||
return task;
|
||||
} finally {
|
||||
|
@ -407,23 +406,19 @@ class TaskTransferrer {
|
|||
|
||||
private void createTasksTransferredEvents(
|
||||
List<MinimalTaskSummary> taskSummaries, TaskSummaryImpl updateObject) {
|
||||
taskSummaries
|
||||
.forEach(
|
||||
task -> {
|
||||
|
||||
TaskImpl transferredTask = (TaskImpl) taskService.newTask(task.getWorkbasketId());
|
||||
transferredTask.setId(task.getTaskId());
|
||||
transferredTask.setRead(updateObject.isRead());
|
||||
transferredTask.setTransferred(updateObject.isTransferred());
|
||||
transferredTask.setWorkbasketSummary(updateObject.getWorkbasketSummary());
|
||||
transferredTask.setDomain(updateObject.getDomain());
|
||||
transferredTask.setModified(updateObject.getModified());
|
||||
transferredTask.setState(updateObject.getState());
|
||||
transferredTask.setOwner(updateObject.getOwner());
|
||||
createTaskTransferredEvent(
|
||||
transferredTask,
|
||||
task.getWorkbasketId(),
|
||||
updateObject.getWorkbasketSummary().getId());
|
||||
});
|
||||
taskSummaries.forEach(
|
||||
task -> {
|
||||
TaskImpl transferredTask = (TaskImpl) taskService.newTask(task.getWorkbasketId());
|
||||
transferredTask.setId(task.getTaskId());
|
||||
transferredTask.setRead(updateObject.isRead());
|
||||
transferredTask.setTransferred(updateObject.isTransferred());
|
||||
transferredTask.setWorkbasketSummary(updateObject.getWorkbasketSummary());
|
||||
transferredTask.setDomain(updateObject.getDomain());
|
||||
transferredTask.setModified(updateObject.getModified());
|
||||
transferredTask.setState(updateObject.getState());
|
||||
transferredTask.setOwner(updateObject.getOwner());
|
||||
createTaskTransferredEvent(
|
||||
transferredTask, task.getWorkbasketId(), updateObject.getWorkbasketSummary().getId());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,28 +86,28 @@ public interface WorkbasketAccessMapper {
|
|||
+ "</script>")
|
||||
@Results(
|
||||
value = {
|
||||
@Result(property = "id", column = "ID"),
|
||||
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
|
||||
@Result(property = "workbasketKey", column = "KEY"),
|
||||
@Result(property = "accessId", column = "ACCESS_ID"),
|
||||
@Result(property = "accessName", column = "ACCESS_NAME"),
|
||||
@Result(property = "permRead", column = "PERM_READ"),
|
||||
@Result(property = "permOpen", column = "PERM_OPEN"),
|
||||
@Result(property = "permAppend", column = "PERM_APPEND"),
|
||||
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
|
||||
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
|
||||
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
|
||||
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
|
||||
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
|
||||
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
|
||||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"),
|
||||
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"),
|
||||
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"),
|
||||
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
|
||||
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
|
||||
@Result(property = "id", column = "ID"),
|
||||
@Result(property = "workbasketId", column = "WORKBASKET_ID"),
|
||||
@Result(property = "workbasketKey", column = "KEY"),
|
||||
@Result(property = "accessId", column = "ACCESS_ID"),
|
||||
@Result(property = "accessName", column = "ACCESS_NAME"),
|
||||
@Result(property = "permRead", column = "PERM_READ"),
|
||||
@Result(property = "permOpen", column = "PERM_OPEN"),
|
||||
@Result(property = "permAppend", column = "PERM_APPEND"),
|
||||
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
|
||||
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
|
||||
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
|
||||
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
|
||||
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
|
||||
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
|
||||
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
|
||||
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
|
||||
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
|
||||
@Result(property = "permCustom8", column = "PERM_CUSTOM_8"),
|
||||
@Result(property = "permCustom9", column = "PERM_CUSTOM_9"),
|
||||
@Result(property = "permCustom10", column = "PERM_CUSTOM_10"),
|
||||
@Result(property = "permCustom11", column = "PERM_CUSTOM_11"),
|
||||
@Result(property = "permCustom12", column = "PERM_CUSTOM_12")
|
||||
})
|
||||
List<WorkbasketAccessItemImpl> findByAccessId(@Param("id") String id);
|
||||
|
||||
|
|
|
@ -592,39 +592,41 @@ class QueryClassificationAccTest extends AbstractAccTest {
|
|||
|
||||
@TestFactory
|
||||
Stream<DynamicTest> should_SortQueryAsc_When_OrderingByCustomAttribute() {
|
||||
Iterator<ClassificationCustomField> iterator = Arrays.stream(ClassificationCustomField.values())
|
||||
.iterator();
|
||||
ThrowingConsumer<ClassificationCustomField> test = customField -> {
|
||||
List<ClassificationSummary> results =
|
||||
classificationService
|
||||
.createClassificationQuery()
|
||||
.orderByCustomAttribute(customField, ASCENDING)
|
||||
.list();
|
||||
Iterator<ClassificationCustomField> iterator =
|
||||
Arrays.stream(ClassificationCustomField.values()).iterator();
|
||||
ThrowingConsumer<ClassificationCustomField> test =
|
||||
customField -> {
|
||||
List<ClassificationSummary> results =
|
||||
classificationService
|
||||
.createClassificationQuery()
|
||||
.orderByCustomAttribute(customField, ASCENDING)
|
||||
.list();
|
||||
|
||||
assertThat(results)
|
||||
.hasSizeGreaterThan(2)
|
||||
.extracting(c -> c.getCustomAttribute(customField))
|
||||
.isSortedAccordingTo(CASE_INSENSITIVE_ORDER);
|
||||
};
|
||||
assertThat(results)
|
||||
.hasSizeGreaterThan(2)
|
||||
.extracting(c -> c.getCustomAttribute(customField))
|
||||
.isSortedAccordingTo(CASE_INSENSITIVE_ORDER);
|
||||
};
|
||||
return DynamicTest.stream(iterator, c -> "for " + c, test);
|
||||
}
|
||||
|
||||
@TestFactory
|
||||
Stream<DynamicTest> should_SortQueryDesc_When_OrderingByCustomAttribute() {
|
||||
Iterator<ClassificationCustomField> iterator = Arrays.stream(ClassificationCustomField.values())
|
||||
.iterator();
|
||||
ThrowingConsumer<ClassificationCustomField> test = customField -> {
|
||||
List<ClassificationSummary> results =
|
||||
classificationService
|
||||
.createClassificationQuery()
|
||||
.orderByCustomAttribute(customField, DESCENDING)
|
||||
.list();
|
||||
Iterator<ClassificationCustomField> iterator =
|
||||
Arrays.stream(ClassificationCustomField.values()).iterator();
|
||||
ThrowingConsumer<ClassificationCustomField> test =
|
||||
customField -> {
|
||||
List<ClassificationSummary> results =
|
||||
classificationService
|
||||
.createClassificationQuery()
|
||||
.orderByCustomAttribute(customField, DESCENDING)
|
||||
.list();
|
||||
|
||||
assertThat(results)
|
||||
.hasSizeGreaterThan(2)
|
||||
.extracting(c -> c.getCustomAttribute(customField))
|
||||
.isSortedAccordingTo(CASE_INSENSITIVE_ORDER.reversed());
|
||||
};
|
||||
assertThat(results)
|
||||
.hasSizeGreaterThan(2)
|
||||
.extracting(c -> c.getCustomAttribute(customField))
|
||||
.isSortedAccordingTo(CASE_INSENSITIVE_ORDER.reversed());
|
||||
};
|
||||
return DynamicTest.stream(iterator, c -> "for " + c, test);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,10 +144,9 @@ class GetTaskIdsOfClassificationReportAccTest extends AbstractReportAccTest {
|
|||
.inWorkingDays()
|
||||
.listTaskIdsForSelectedItems(selectedItems, TaskTimestamp.DUE);
|
||||
|
||||
assertThat(ids).containsExactlyInAnyOrder(
|
||||
"TKI:000000000000000000000000000000000006",
|
||||
"TKI:000000000000000000000000000000000033"
|
||||
);
|
||||
assertThat(ids)
|
||||
.containsExactlyInAnyOrder(
|
||||
"TKI:000000000000000000000000000000000006", "TKI:000000000000000000000000000000000033");
|
||||
}
|
||||
|
||||
@WithAccessId(user = "monitor")
|
||||
|
|
|
@ -77,8 +77,8 @@ class GetTaskIdsOfTaskCustomFieldValueReportAccTest extends AbstractReportAccTes
|
|||
void should_SelectCompletedItems_When_CompletedTimeStampIsRequested() throws Exception {
|
||||
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
|
||||
List<SelectedItem> selectedItems =
|
||||
Collections
|
||||
.singletonList(new SelectedItem("Geschaeftsstelle A", null, Integer.MIN_VALUE, -5));
|
||||
Collections.singletonList(
|
||||
new SelectedItem("Geschaeftsstelle A", null, Integer.MIN_VALUE, -5));
|
||||
|
||||
List<String> ids =
|
||||
MONITOR_SERVICE
|
||||
|
|
|
@ -85,7 +85,8 @@ class QueryTasksByObjectReferenceAccTest extends AbstractAccTest {
|
|||
ObjectReference objectReference1 = new ObjectReference();
|
||||
objectReference1.setValue("11223344");
|
||||
List<TaskSummary> results =
|
||||
TASK_SERVICE.createTaskQuery()
|
||||
TASK_SERVICE
|
||||
.createTaskQuery()
|
||||
.primaryObjectReferenceIn(objectReference, objectReference1)
|
||||
.list();
|
||||
assertThat(results).hasSize(56);
|
||||
|
@ -101,9 +102,7 @@ class QueryTasksByObjectReferenceAccTest extends AbstractAccTest {
|
|||
objectReference.setType("VNR");
|
||||
objectReference.setValue("67890123");
|
||||
List<TaskSummary> results =
|
||||
TASK_SERVICE.createTaskQuery()
|
||||
.primaryObjectReferenceIn(objectReference)
|
||||
.list();
|
||||
TASK_SERVICE.createTaskQuery().primaryObjectReferenceIn(objectReference).list();
|
||||
assertThat(results).hasSize(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ public class TestCreateTaskPreprocessorProvider implements CreateTaskPreprocesso
|
|||
|
||||
@Override
|
||||
public void processTaskBeforeCreation(Task taskToProcess) {
|
||||
taskToProcess
|
||||
.setCustomAttribute(TaskCustomField.CUSTOM_1, "preprocessedCustomField");
|
||||
taskToProcess.setCustomAttribute(TaskCustomField.CUSTOM_1, "preprocessedCustomField");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,8 +49,7 @@ class ArchitectureTest {
|
|||
"pro.taskana.spi.routing.api",
|
||||
"pro.taskana.spi.routing.internal",
|
||||
"pro.taskana.spi.task.api",
|
||||
"pro.taskana.spi.task.internal"
|
||||
);
|
||||
"pro.taskana.spi.task.internal");
|
||||
private static JavaClasses importedClasses;
|
||||
|
||||
@BeforeAll
|
||||
|
|
|
@ -36,7 +36,6 @@ import pro.taskana.sampledata.SampleDataGenerator;
|
|||
*/
|
||||
class ClassificationServiceImplIntExplicitTest {
|
||||
|
||||
|
||||
static int counter = 0;
|
||||
|
||||
private DataSource dataSource;
|
||||
|
@ -47,8 +46,8 @@ class ClassificationServiceImplIntExplicitTest {
|
|||
void setup() throws Exception {
|
||||
dataSource = TaskanaEngineTestConfiguration.getDataSource();
|
||||
String schemaName = TaskanaEngineTestConfiguration.getSchemaName();
|
||||
TaskanaEngineConfiguration taskanaEngineConfiguration = new TaskanaEngineConfiguration(
|
||||
dataSource, false, false, schemaName);
|
||||
TaskanaEngineConfiguration taskanaEngineConfiguration =
|
||||
new TaskanaEngineConfiguration(dataSource, false, false, schemaName);
|
||||
taskanaEngine = (TaskanaEngineImpl) taskanaEngineConfiguration.buildTaskanaEngine();
|
||||
taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.EXPLICIT);
|
||||
classificationService = taskanaEngine.getClassificationService();
|
||||
|
|
|
@ -37,8 +37,6 @@ public class ExampleRestConfiguration {
|
|||
// only required to let the adapter example connect to the same database
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
public Server inMemoryH2DatabaseaServer() throws SQLException {
|
||||
return Server.createTcpServer(
|
||||
"-tcp", "-tcpAllowOthers", "-tcpPort", "9095");
|
||||
return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9095");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -128,5 +128,4 @@ public class AbstractAccTest {
|
|||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -112,5 +112,4 @@ public class TaskanaWildflyTest extends AbstractAccTest {
|
|||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(response.getBody()).isNotNull();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -99,5 +99,4 @@ public class TaskanaWildflyWithSimpleHistoryEnabledTest extends AbstractAccTest
|
|||
assertThat(getHistoryEventsResponse.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||
assertThat(getHistoryEventsResponse.getBody().getContent()).hasSize(46);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ public class ClassificationController extends AbstractPagingController {
|
|||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationController.class);
|
||||
|
||||
|
||||
private static final String LIKE = "%";
|
||||
private static final String NAME = "name";
|
||||
private static final String NAME_LIKE = "name-like";
|
||||
|
|
|
@ -109,16 +109,12 @@ public class ReportRepresentationModelAssembler {
|
|||
List<ReportRepresentationModel.RowResource> rows =
|
||||
report.getRows().values().stream()
|
||||
.sorted(Comparator.comparing(e -> e.getKey().toLowerCase()))
|
||||
.map(
|
||||
i ->
|
||||
transformRow(
|
||||
i, new String[report.getRowDesc().length], 0))
|
||||
.map(i -> transformRow(i, new String[report.getRowDesc().length], 0))
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<ReportRepresentationModel.RowResource> sumRow =
|
||||
transformRow(
|
||||
report.getSumRow(), new String[report.getRowDesc().length], 0);
|
||||
transformRow(report.getSumRow(), new String[report.getRowDesc().length], 0);
|
||||
|
||||
return new ReportRepresentationModel(meta, rows, sumRow);
|
||||
}
|
||||
|
@ -135,8 +131,7 @@ public class ReportRepresentationModelAssembler {
|
|||
// is not
|
||||
// a reason to append code somewhere where it doesn't belong.
|
||||
if (row.getClass() == SingleRow.class) {
|
||||
return Collections.singletonList(
|
||||
transformSingleRow((SingleRow<I>) row, desc, depth));
|
||||
return Collections.singletonList(transformSingleRow((SingleRow<I>) row, desc, depth));
|
||||
}
|
||||
return transformFoldableRow((FoldableRow<I>) row, desc, depth);
|
||||
}
|
||||
|
@ -152,8 +147,7 @@ public class ReportRepresentationModelAssembler {
|
|||
|
||||
private <I extends QueryItem> List<ReportRepresentationModel.RowResource> transformFoldableRow(
|
||||
FoldableRow<I> row, String[] previousRowDesc, int depth) {
|
||||
ReportRepresentationModel.RowResource baseRow =
|
||||
transformSingleRow(row, previousRowDesc, depth);
|
||||
ReportRepresentationModel.RowResource baseRow = transformSingleRow(row, previousRowDesc, depth);
|
||||
List<ReportRepresentationModel.RowResource> rowList = new LinkedList<>();
|
||||
rowList.add(baseRow);
|
||||
row.getFoldableRowKeySet().stream()
|
||||
|
|
|
@ -701,7 +701,6 @@ public class TaskController extends AbstractPagingController {
|
|||
if (LOGGER.isDebugEnabled()) {
|
||||
LOGGER.debug("Exit from applySortingParams(), returning {}", query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int[] extractPriorities(String[] prioritiesInString) {
|
||||
|
|
|
@ -26,8 +26,7 @@ class GeneralExceptionHandlingTest {
|
|||
new ParameterizedTypeReference<
|
||||
TaskanaPagedModel<ClassificationSummaryRepresentationModel>>() {};
|
||||
private static RestTemplate template;
|
||||
@Autowired
|
||||
RestHelper restHelper;
|
||||
@Autowired RestHelper restHelper;
|
||||
|
||||
@BeforeAll
|
||||
static void init() {
|
||||
|
|
|
@ -28,7 +28,6 @@ class TaskanaEngineControllerIntTest {
|
|||
this.restHelper = restHelper;
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void testDomains() {
|
||||
ResponseEntity<List<String>> response =
|
||||
|
|
|
@ -353,8 +353,11 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
|
|||
.accept("application/hal+json")
|
||||
.header("Authorization", TEAMLEAD_1_CREDENTIALS))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("_links.self.href",
|
||||
is("http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001")))
|
||||
.andExpect(
|
||||
MockMvcResultMatchers.jsonPath(
|
||||
"_links.self.href",
|
||||
is(
|
||||
"http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001")))
|
||||
.andDo(
|
||||
MockMvcRestDocumentation.document(
|
||||
"GetSpecificWorkbasketDocTest", responseFields(workbasketFieldDescriptors)));
|
||||
|
@ -387,8 +390,11 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
|
|||
.accept("application/hal+json")
|
||||
.header("Authorization", TEAMLEAD_1_CREDENTIALS))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("_links.self.href",
|
||||
is("http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001")))
|
||||
.andExpect(
|
||||
MockMvcResultMatchers.jsonPath(
|
||||
"_links.self.href",
|
||||
is(
|
||||
"http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001")))
|
||||
.andDo(
|
||||
MockMvcRestDocumentation.document(
|
||||
"WorkbasketSubset", responseFields(workbasketSubsetFieldDescriptors)));
|
||||
|
@ -417,8 +423,11 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
|
|||
"WBI:100000000000000000000000000000000002"))
|
||||
.header("Authorization", TEAMLEAD_1_CREDENTIALS))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("_links.self.href",
|
||||
is("http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000002/distribution-targets")))
|
||||
.andExpect(
|
||||
MockMvcResultMatchers.jsonPath(
|
||||
"_links.self.href",
|
||||
is(
|
||||
"http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000002/distribution-targets")))
|
||||
.andDo(
|
||||
MockMvcRestDocumentation.document(
|
||||
"GetAllWorkbasketDistributionTargets",
|
||||
|
@ -478,8 +487,11 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
|
|||
.contentType("application/json")
|
||||
.content(modifiedWorkbasket))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("_links.self.href",
|
||||
is("http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000002")))
|
||||
.andExpect(
|
||||
MockMvcResultMatchers.jsonPath(
|
||||
"_links.self.href",
|
||||
is(
|
||||
"http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000002")))
|
||||
.andDo(
|
||||
MockMvcRestDocumentation.document(
|
||||
"UpdateWorkbasketDocTest",
|
||||
|
@ -510,8 +522,11 @@ class WorkbasketControllerRestDocumentation extends BaseRestDocumentation {
|
|||
.accept("application/hal+json")
|
||||
.header("Authorization", TEAMLEAD_1_CREDENTIALS))
|
||||
.andExpect(MockMvcResultMatchers.status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("_links.self.href",
|
||||
is("http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001/workbasketAccessItems")))
|
||||
.andExpect(
|
||||
MockMvcResultMatchers.jsonPath(
|
||||
"_links.self.href",
|
||||
is(
|
||||
"http://localhost:8080/api/v1/workbaskets/WBI:100000000000000000000000000000000001/workbasketAccessItems")))
|
||||
.andDo(
|
||||
MockMvcRestDocumentation.document(
|
||||
"AccessItemsDocTest", responseFields(accessItemFieldDescriptors)));
|
||||
|
|
Loading…
Reference in New Issue