TSK-1265: fixed checkstyle
This commit is contained in:
parent
6c4fef7635
commit
005075d852
|
@ -11,7 +11,8 @@ public final class Mapping {
|
|||
public static final String URL_CLASSIFICATIONDEFINITIONS = PRE + "classification-definitions";
|
||||
public static final String URL_MONITOR = PRE + "monitor";
|
||||
public static final String URL_MONITOR_TASKS_STATUS = URL_MONITOR + "/tasks-status-report";
|
||||
public static final String URL_MONITOR_TASKS_WORKBASKET = URL_MONITOR + "/tasks-workbasket-report";
|
||||
public static final String URL_MONITOR_TASKS_WORKBASKET =
|
||||
URL_MONITOR + "/tasks-workbasket-report";
|
||||
public static final String URL_MONITOR_TASKS_WORKBASKET_PLANNED =
|
||||
URL_MONITOR + "/tasks-workbasket-planned-date-report";
|
||||
public static final String URL_MONITOR_TASKS_CLASSIFICATION =
|
||||
|
|
|
@ -2,8 +2,6 @@ package pro.taskana.task.rest.assembler;
|
|||
|
||||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.server.RepresentationModelAssembler;
|
||||
import org.springframework.lang.NonNull;
|
||||
|
@ -16,9 +14,7 @@ import pro.taskana.task.internal.models.AttachmentImpl;
|
|||
import pro.taskana.task.rest.AttachmentController;
|
||||
import pro.taskana.task.rest.models.AttachmentRepresentationModel;
|
||||
|
||||
/**
|
||||
* EntityModel assembler for {@link AttachmentRepresentationModel}.
|
||||
*/
|
||||
/** EntityModel assembler for {@link AttachmentRepresentationModel}. */
|
||||
@Component
|
||||
public class AttachmentRepresentationModelAssembler
|
||||
implements RepresentationModelAssembler<Attachment, AttachmentRepresentationModel> {
|
||||
|
@ -53,8 +49,7 @@ public class AttachmentRepresentationModelAssembler
|
|||
return repModel;
|
||||
}
|
||||
|
||||
public AttachmentImpl toEntityModel(
|
||||
AttachmentRepresentationModel attachmentRepresentationModel) {
|
||||
public AttachmentImpl toEntityModel(AttachmentRepresentationModel attachmentRepresentationModel) {
|
||||
AttachmentImpl attachment = (AttachmentImpl) taskService.newAttachment();
|
||||
attachment.setId(attachmentRepresentationModel.getAttachmentId());
|
||||
attachment.setTaskId(attachmentRepresentationModel.getTaskId());
|
||||
|
@ -70,4 +65,3 @@ public class AttachmentRepresentationModelAssembler
|
|||
return attachment;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,8 @@ import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
|
|||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
|
||||
import static pro.taskana.common.rest.models.TaskanaPagedModelKeys.TASK_COMMENTS;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedModel.PageMetadata;
|
||||
import org.springframework.hateoas.server.RepresentationModelAssembler;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -67,15 +64,15 @@ public class TaskCommentRepresentationModelAssembler
|
|||
return taskComment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskanaPagedModelKeys getProperty() {
|
||||
return TASK_COMMENTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@PageLinks(Mapping.URL_TASK_COMMENTS)
|
||||
public TaskanaPagedModel<TaskCommentRepresentationModel> toPageModel(
|
||||
Iterable<TaskComment> taskComments, PageMetadata pageMetadata) {
|
||||
return TaskanaPagingAssembler.super.toPageModel(taskComments, pageMetadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskanaPagedModelKeys getProperty() {
|
||||
return TASK_COMMENTS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class TaskRepresentationModel extends TaskSummaryRepresentationModel {
|
|||
return of(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
public static CustomAttribute of (String key, String value) {
|
||||
public static CustomAttribute of(String key, String value) {
|
||||
CustomAttribute customAttribute = new CustomAttribute();
|
||||
customAttribute.setKey(key);
|
||||
customAttribute.setValue(value);
|
||||
|
|
|
@ -2,13 +2,11 @@ package pro.taskana.workbasket.rest.assembler;
|
|||
|
||||
import static pro.taskana.common.rest.models.TaskanaPagedModelKeys.DISTRIBUTION_TARGETS;
|
||||
import static pro.taskana.common.rest.models.TaskanaPagedModelKeys.WORKBASKETS;
|
||||
import static pro.taskana.common.rest.models.TaskanaPagedModelKeys.WORKBASKET_DEFINITIONS;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.hateoas.PagedModel.PageMetadata;
|
||||
import org.springframework.hateoas.server.RepresentationModelAssembler;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -22,17 +20,14 @@ import pro.taskana.workbasket.api.models.WorkbasketSummary;
|
|||
import pro.taskana.workbasket.internal.models.WorkbasketImpl;
|
||||
import pro.taskana.workbasket.rest.models.WorkbasketSummaryRepresentationModel;
|
||||
|
||||
/**
|
||||
* EntityModel assembler for {@link WorkbasketSummaryRepresentationModel}.
|
||||
*/
|
||||
/** EntityModel assembler for {@link WorkbasketSummaryRepresentationModel}. */
|
||||
@Component
|
||||
public class WorkbasketSummaryRepresentationModelAssembler implements
|
||||
TaskanaPagingAssembler<WorkbasketSummary, WorkbasketSummaryRepresentationModel> {
|
||||
public class WorkbasketSummaryRepresentationModelAssembler
|
||||
implements TaskanaPagingAssembler<WorkbasketSummary, WorkbasketSummaryRepresentationModel> {
|
||||
|
||||
private WorkbasketService workbasketService;
|
||||
|
||||
public WorkbasketSummaryRepresentationModelAssembler() {
|
||||
}
|
||||
public WorkbasketSummaryRepresentationModelAssembler() {}
|
||||
|
||||
@Autowired
|
||||
public WorkbasketSummaryRepresentationModelAssembler(WorkbasketService workbasketService) {
|
||||
|
@ -83,6 +78,11 @@ public class WorkbasketSummaryRepresentationModelAssembler implements
|
|||
return workbasket;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskanaPagedModelKeys getProperty() {
|
||||
return WORKBASKETS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@PageLinks(Mapping.URL_WORKBASKET)
|
||||
public TaskanaPagedModel<WorkbasketSummaryRepresentationModel> toPageModel(
|
||||
|
@ -90,19 +90,14 @@ public class WorkbasketSummaryRepresentationModelAssembler implements
|
|||
return TaskanaPagingAssembler.super.toPageModel(entities, pageMetadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskanaPagedModelKeys getProperty() {
|
||||
return WORKBASKETS;
|
||||
}
|
||||
|
||||
@PageLinks(Mapping.URL_WORKBASKET_ID_DISTRIBUTION)
|
||||
public TaskanaPagedModel<WorkbasketSummaryRepresentationModel> toDistributionTargetPageModel(
|
||||
List<WorkbasketSummary> workbasketSummaries, PageMetadata pageMetadata) {
|
||||
return workbasketSummaries.stream()
|
||||
.map(this::toModel)
|
||||
.collect(
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toList(),
|
||||
list -> new TaskanaPagedModel<>(DISTRIBUTION_TARGETS, list, pageMetadata)));
|
||||
.map(this::toModel)
|
||||
.collect(
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toList(),
|
||||
list -> new TaskanaPagedModel<>(DISTRIBUTION_TARGETS, list, pageMetadata)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.time.Instant;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
@ -29,9 +28,7 @@ import pro.taskana.workbasket.api.WorkbasketService;
|
|||
import pro.taskana.workbasket.api.models.Workbasket;
|
||||
import pro.taskana.workbasket.rest.models.WorkbasketSummaryRepresentationModel;
|
||||
|
||||
/**
|
||||
* Test for {@link TaskRepresentationModelAssembler}.
|
||||
*/
|
||||
/** Test for {@link TaskRepresentationModelAssembler}. */
|
||||
@TaskanaSpringBootTest
|
||||
class TaskRepresentationModelAssemberTest {
|
||||
|
||||
|
@ -41,7 +38,9 @@ class TaskRepresentationModelAssemberTest {
|
|||
TaskRepresentationModelAssembler taskRepresentationModelAssembler;
|
||||
|
||||
@Autowired
|
||||
TaskRepresentationModelAssemberTest(TaskService taskService, WorkbasketService workbasketService,
|
||||
TaskRepresentationModelAssemberTest(
|
||||
TaskService taskService,
|
||||
WorkbasketService workbasketService,
|
||||
ClassificationService classificationService,
|
||||
TaskRepresentationModelAssembler taskRepresentationModelAssembler) {
|
||||
this.taskService = taskService;
|
||||
|
|
Loading…
Reference in New Issue