81 lines
3.4 KiB
HTML
81 lines
3.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" xmlns:th="http://thymeleaf.org">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<script src="/js/main.js"></script>
|
|
</head>
|
|
<body>
|
|
<hr>
|
|
<div><br>In order to set mockup response. Please send the response, that you want to receive, on:
|
|
<br>http://localhost:8097/klaus/v1/set/ <a th:text="${mockedResponseDto.clientUUID}">clientUUID should be here</a>/{mockedResponseId}?httpStatus=200
|
|
<br>or simply fill and submit the below form:</div>
|
|
|
|
<div class="col-lg-4 form-max">
|
|
sayHi('John');
|
|
<form action="#" th:action="@{/home}" th:object="${mockedResponseDto}" method="post">
|
|
<table>
|
|
<input type="text" th:field="*{clientUUID}" th:placeholder="*{clientUUID}" hidden/>
|
|
<tr>
|
|
<td>Mocked response id:</td>
|
|
<td><input type="text" th:field="*{mockedResponseId}" th:value=1/></td>
|
|
<td th:if="${#fields.hasErrors('mockedResponseId')}" th:errors="*{mockedResponseId}">Id Error</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Mocked response body:</td>
|
|
<td><textarea rows="4" cols="50" th:field="*{messageBody}" th:placeholder='messageBody'></textarea></td>
|
|
<td th:if="${#fields.hasErrors('messageBody')}" th:errors="*{messageBody}">Body Error</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Mocked response http code status:</td>
|
|
<td><input type="text" th:field="*{httpStatus}" th:value='200'></td>
|
|
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">HttpStatus Error</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Provide mocked response headers:</td>
|
|
<td><a href="#" id="addHeader" onclick="addFields()">Add a new header</a>
|
|
<table>
|
|
<tr>
|
|
<td><div id="headers"></div></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Media type:</td>
|
|
<td><select th:field="*{mediaType}">
|
|
<option value="application/xml">application/xml</option>
|
|
<option value="application/json">application/json</option>
|
|
<option value="text/xml">text/xml</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td><input type="submit" value="Save mocked response"/></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<p th:if="${mockSaved}">Mock has been saved</p>
|
|
|
|
|
|
<hr>
|
|
|
|
<div><br>In order to use the mocked response in your integration tests or simply
|
|
get your mocked response please send a request to
|
|
<br>http://localhost:8097/klaus/v1/get/<a th:text="${mockedResponseDto.clientUUID}">clientUUID should be here</a>/{mockedResponseId}
|
|
</div>
|
|
|
|
<div><br>You will receive the same body and headers as you sent them in the step 1.</div>
|
|
<div><br>You can also use the form below:</div>
|
|
<form action="#" th:action="@{/home/getMockedResponse}" th:object="${mockedResponseDto}" method="get">
|
|
<input type="text" th:field="*{clientUUID}" th:placeholder="*{clientUUID}" hidden/>
|
|
<br><label >Mocked response id:</label><br/>
|
|
<input type="text" th:field="*{mockedResponseId}" th:placeholder="12345"/>
|
|
<input type="submit" value="Get mocked response"/>
|
|
</form>
|
|
<hr>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |