TSK-1282: replaced Collections.singletonMap with Map.of in all tests

This commit is contained in:
Mustapha Zorgati 2020-10-30 11:15:08 +01:00
parent 0eb877705b
commit ab152f87b1
3 changed files with 10 additions and 10 deletions

View File

@ -5,8 +5,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import acceptance.AbstractAccTest;
import java.time.Duration;
import java.time.Instant;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ -178,7 +178,7 @@ class UpdateObjectsUseUtcTimeStampsAccTest extends AbstractAccTest {
void testTimestampsOnCreateScheduledJob() throws Exception {
resetDb(true);
ScheduledJob job = new ScheduledJob();
job.setArguments(Collections.singletonMap("keyBla", "valueBla"));
job.setArguments(Map.of("keyBla", "valueBla"));
job.setType(ScheduledJob.Type.TASKCLEANUPJOB);
job.setDue(Instant.now().minus(Duration.ofHours(5)));
job.setLockExpires(Instant.now().minus(Duration.ofHours(5)));

View File

@ -3,7 +3,7 @@ package pro.taskana.task.rest.assembler;
import static org.assertj.core.api.Assertions.assertThat;
import java.time.Instant;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,7 +45,7 @@ class AttachmentRepresentationModelAssemblerTest {
summary.setDomain("DOMAIN_A");
summary.setType("MANUAL");
AttachmentRepresentationModel repModel = new AttachmentRepresentationModel();
repModel.setCustomAttributes(Collections.singletonMap("abc", "def"));
repModel.setCustomAttributes(Map.of("abc", "def"));
repModel.setClassificationSummary(summary);
repModel.setAttachmentId("id");
repModel.setTaskId("taskId");
@ -67,7 +67,7 @@ class AttachmentRepresentationModelAssemblerTest {
ClassificationSummary summary =
classService.newClassification("ckey", "cdomain", "MANUAL").asSummary();
reference.setId("abc");
attachment.setCustomAttributeMap(Collections.singletonMap("abc", "def"));
attachment.setCustomAttributeMap(Map.of("abc", "def"));
attachment.setClassificationSummary(summary);
attachment.setId("id");
attachment.setTaskId("taskId");
@ -90,7 +90,7 @@ class AttachmentRepresentationModelAssemblerTest {
ClassificationSummary summary =
classService.newClassification("ckey", "cdomain", "MANUAL").asSummary();
reference.setId("abc");
attachment.setCustomAttributeMap(Collections.singletonMap("abc", "def"));
attachment.setCustomAttributeMap(Map.of("abc", "def"));
attachment.setClassificationSummary(summary);
attachment.setId("id");
attachment.setTaskId("taskId");

View File

@ -150,8 +150,8 @@ class TaskRepresentationModelAssemberTest {
task.setPrimaryObjRef(primaryObjRef);
task.setRead(true);
task.setTransferred(true);
task.setCustomAttributeMap(Collections.singletonMap("abc", "def"));
task.setCallbackInfo(Collections.singletonMap("ghi", "jkl"));
task.setCustomAttributeMap(Map.of("abc", "def"));
task.setCallbackInfo(Map.of("ghi", "jkl"));
task.setAttachments(List.of(attachment));
task.setCustomAttribute(TaskCustomField.CUSTOM_1, "custom1");
task.setCustomAttribute(TaskCustomField.CUSTOM_2, "custom2");
@ -211,8 +211,8 @@ class TaskRepresentationModelAssemberTest {
task.setPrimaryObjRef(primaryObjRef);
task.setRead(true);
task.setTransferred(true);
task.setCustomAttributeMap(Collections.singletonMap("abc", "def"));
task.setCallbackInfo(Collections.singletonMap("ghi", "jkl"));
task.setCustomAttributeMap(Map.of("abc", "def"));
task.setCallbackInfo(Map.of("ghi", "jkl"));
task.setAttachments(List.of(attachment));
task.setCustom1("custom1");
task.setCustom2("custom2");