.. and more code smells 💩 - it stinks
This commit is contained in:
parent
b3add569ff
commit
b321c495ba
|
@ -7,6 +7,7 @@ import java.util.Objects;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.PagedModel.PageMetadata;
|
import org.springframework.hateoas.PagedModel.PageMetadata;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||||
|
@ -92,12 +93,11 @@ public class TaskController extends AbstractPagingController {
|
||||||
|
|
||||||
private static final String INDEFINITE = "";
|
private static final String INDEFINITE = "";
|
||||||
|
|
||||||
private TaskService taskService;
|
private final TaskService taskService;
|
||||||
|
private final TaskRepresentationModelAssembler taskRepresentationModelAssembler;
|
||||||
private TaskRepresentationModelAssembler taskRepresentationModelAssembler;
|
private final TaskSummaryRepresentationModelAssembler taskSummaryRepresentationModelAssembler;
|
||||||
|
|
||||||
private TaskSummaryRepresentationModelAssembler taskSummaryRepresentationModelAssembler;
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
TaskController(
|
TaskController(
|
||||||
TaskService taskService,
|
TaskService taskService,
|
||||||
TaskRepresentationModelAssembler taskRepresentationModelAssembler,
|
TaskRepresentationModelAssembler taskRepresentationModelAssembler,
|
||||||
|
@ -171,8 +171,7 @@ public class TaskController extends AbstractPagingController {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ResponseEntity<TaskRepresentationModel> selectAndClaimTask(
|
public ResponseEntity<TaskRepresentationModel> selectAndClaimTask(
|
||||||
@RequestParam MultiValueMap<String, String> params)
|
@RequestParam MultiValueMap<String, String> params)
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws InvalidOwnerException, NotAuthorizedException, InvalidArgumentException {
|
||||||
NotAuthorizedException, InvalidArgumentException {
|
|
||||||
|
|
||||||
LOGGER.debug("Entry to selectAndClaimTask");
|
LOGGER.debug("Entry to selectAndClaimTask");
|
||||||
|
|
||||||
|
|
|
@ -110,12 +110,10 @@ class ClassificationControllerIntTest {
|
||||||
assertThat(response.getBody().getContent()).hasSize(5);
|
assertThat(response.getBody().getContent()).hasSize(5);
|
||||||
assertThat(response.getBody().getContent().iterator().next().getKey()).isEqualTo("L1050");
|
assertThat(response.getBody().getContent().iterator().next().getKey()).isEqualTo("L1050");
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
String href = response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref();
|
assertThat(response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref())
|
||||||
assertThat(
|
.endsWith(
|
||||||
href.endsWith(
|
"/api/v1/classifications?"
|
||||||
"/api/v1/classifications?"
|
+ "domain=DOMAIN_A&sort-by=key&order=asc&page-size=5&page=2");
|
||||||
+ "domain=DOMAIN_A&sort-by=key&order=asc&page-size=5&page=2"))
|
|
||||||
.isTrue();
|
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.FIRST)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.FIRST)).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.LAST)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.LAST)).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.NEXT)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.NEXT)).isNotNull();
|
||||||
|
|
Loading…
Reference in New Issue