changing module settings,
adding unit testing for controllers
This commit is contained in:
@@ -25,7 +25,6 @@ import java.util.UUID;
|
||||
public class EventController {
|
||||
|
||||
private final EtrackService etrackService;
|
||||
private final String sortBy = "messageId";
|
||||
private final List<Event> eventList = new LinkedList<>();
|
||||
|
||||
@GetMapping("/etrack/{uuid}")
|
||||
@@ -44,14 +43,6 @@ public class EventController {
|
||||
return "etrack";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/etrack/{uuid}", params = {"sortBy"})
|
||||
public String sortBy(@Valid EventRequestDto eventRequestDto, final Model model, BindingResult bindingResult,
|
||||
@PathVariable UUID uuid){
|
||||
model.addAttribute("clientUUID", uuid);
|
||||
populateModelWithLists(model, eventRequestDto, false);
|
||||
return "etrack";
|
||||
}
|
||||
|
||||
private void populateModelWithLists(Model model, EventRequestDto eventRequestDto, boolean updateList){
|
||||
if (updateList){
|
||||
eventList.clear();
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.release11.klaus.model;
|
||||
|
||||
import com.release11.klaus.model.constraints.HttpCode;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
import org.springframework.data.redis.core.index.Indexed;
|
||||
|
||||
import javax.validation.constraints.Positive;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@RedisHash("MockedResponseDto")
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public final class MockedResponseDto implements Serializable {
|
||||
@Id
|
||||
private String compositePrimaryKey;
|
||||
@Indexed
|
||||
private UUID clientUUID;
|
||||
@Positive
|
||||
private int mockedResponseId;
|
||||
private String mediaType;
|
||||
private String messageBody;
|
||||
private Map<String, String> httpHeaders;
|
||||
@HttpCode
|
||||
private Integer httpStatus;
|
||||
|
||||
public MockedResponseDto(UUID clientUUID, int mockedResponseId, String mediaType,
|
||||
String messageBody, Map<String, String> httpHeaders, Integer httpStatus) {
|
||||
this.compositePrimaryKey = clientUUID.toString() + "_" + mockedResponseId;
|
||||
this.clientUUID = clientUUID;
|
||||
this.mockedResponseId = mockedResponseId;
|
||||
this.mediaType = mediaType;
|
||||
this.messageBody = messageBody;
|
||||
this.httpHeaders = httpHeaders;
|
||||
this.httpStatus = httpStatus;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user