T157 POST request works. Need sleep time before GET
This commit is contained in:
3
.idea/workspace.xml
generated
3
.idea/workspace.xml
generated
@@ -23,7 +23,6 @@
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/MockController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/MockController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/static/js/datatransfer.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/js/datatransfer.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/templates/mock.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/mock.html" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -312,7 +311,7 @@
|
||||
<workItem from="1612259068808" duration="10440000" />
|
||||
<workItem from="1612279535476" duration="5692000" />
|
||||
<workItem from="1612442837870" duration="8318000" />
|
||||
<workItem from="1612609113694" duration="11380000" />
|
||||
<workItem from="1612609113694" duration="13936000" />
|
||||
</task>
|
||||
<task id="LOCAL-00077" summary="testing jenkins docker">
|
||||
<created>1601453886631</created>
|
||||
|
||||
@@ -58,18 +58,20 @@ public class MockController {
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@GetMapping({"/mock/json", "/mock/json/{uuid}"})
|
||||
public List<MockedMessageDto> getJson(@PathVariable(required = false) UUID uuid){
|
||||
if(uuid == null) uuid = UUID.randomUUID();
|
||||
List<MockedMessageDto> messages = klausService.getAllMockedResponses(uuid);
|
||||
@GetMapping({"/mock/json", "/mock/json/{uuidValue}"})
|
||||
public List<MockedMessageDto> getJson(@PathVariable(required = false) String uuidValue){
|
||||
UUID clientUUID = UUID.fromString(uuidValue);
|
||||
if(clientUUID == null) clientUUID = UUID.randomUUID();
|
||||
List<MockedMessageDto> messages = klausService.getAllMockedResponses(clientUUID);
|
||||
if(messages.size() == 0) {
|
||||
klausService.setMockedResponse(buildDefaultMessage(uuid));
|
||||
messages = klausService.getAllMockedResponses(uuid);
|
||||
klausService.setMockedResponse(buildDefaultMessage(clientUUID));
|
||||
messages = klausService.getAllMockedResponses(clientUUID);
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
|
||||
@PostMapping("/mock/json/{uuid}")
|
||||
@ResponseBody
|
||||
@PostMapping("/mock/json/{uuidValue}")
|
||||
public ResponseEntity<String> addNewMessage(@PathVariable String uuidValue){
|
||||
UUID clientUUID = UUID.fromString(uuidValue);
|
||||
List<MockedMessageDto> messages = klausService.getAllMockedResponses(clientUUID);
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
//TODO: Add sleep after PUT,POST,DELETE request. Data might not be processed before GET request
|
||||
//TODO: Add button to add new header
|
||||
//TODO: Add PUT request to Save button
|
||||
//TODO: Add POST request to new message button
|
||||
//TODO: Add cookie check when getting the data in getData()
|
||||
//TODO: Add cookie update after receiving data
|
||||
//TODO: Update cookie when displayed message is changed
|
||||
//TODO: Add getData() recall after PUT, POST or DELETE
|
||||
//TODO: Add delete buttons for headers
|
||||
//TODO: Add delete buttons for messages
|
||||
var clientUUID;
|
||||
|
||||
Reference in New Issue
Block a user