- default message for user testing,

- updating frontend
This commit is contained in:
Szakalakamaka
2020-11-03 19:38:45 +01:00
parent dff31ab907
commit bbb37e1a9f
13 changed files with 375 additions and 199 deletions

98
.idea/workspace.xml generated
View File

@@ -23,49 +23,14 @@
</component>
<component name="ChangeListManager">
<list default="true" id="458cde88-df3d-44bc-9d57-a33823e2f1a6" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__com_github_feature_flip_flips_core_1_0_1.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_aspectj_aspectjrt_1_9_5.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_30.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/resources/templates/temp.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_springframework_retry_spring_retry_1_2_5_RELEASE.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Klaus.iml" beforeDir="false" afterPath="$PROJECT_DIR$/Klaus.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/KlausController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/KlausController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/KlausMvcController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/release11/klaus/controller/KlausMvcController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/release11/klaus/repository/EventRepositoryImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/release11/klaus/repository/EventRepositoryImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/release11/klaus/service/KlausServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/release11/klaus/service/KlausServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application-DEV.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application-PROD.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/bootstrap.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/bootstrap.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/bootstrap.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/bootstrap.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/logback.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/logback.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/static/css/styles.css" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/css/styles.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/static/js/etrackPaggination.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/js/etrackPaggination.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/static/js/paggination.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/static/js/paggination.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/templates/etrack.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/etrack.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/release11/klaus/controller/KlausMvcControllerTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/release11/klaus/controller/KlausMvcControllerTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/com/release11/klaus/service/KlausServiceImplTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/release11/klaus/service/KlausServiceImplTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/application-DEV.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/application-PROD.properties" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/bootstrap.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/bootstrap.properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/release11/klaus/controller/KlausController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/release11/klaus/controller/KlausController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/release11/klaus/controller/KlausMvcController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/release11/klaus/controller/KlausMvcController.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/release11/klaus/repository/EventRepositoryImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/release11/klaus/repository/EventRepositoryImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/release11/klaus/service/KlausServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/release11/klaus/service/KlausServiceImpl.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/logback.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/logback.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/static/css/styles.css" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/static/css/styles.css" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/static/js/etrackPaggination.js" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/static/js/etrackPaggination.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/static/js/paggination.js" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/static/js/paggination.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/templates/etrack.html" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/templates/etrack.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/templates/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/generated-sources/annotations/com/release11/klaus/mappers/MockedMessageMapperImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/target/generated-sources/annotations/com/release11/klaus/mappers/MockedMessageMapperImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/com/release11/klaus/controller/KlausMvcControllerTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/com/release11/klaus/controller/KlausMvcControllerTest.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/test-classes/com/release11/klaus/service/KlausServiceImplTest.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/test-classes/com/release11/klaus/service/KlausServiceImplTest.class" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -305,13 +270,6 @@
<option name="presentableId" value="Default" />
<updated>1598862102028</updated>
</task>
<task id="LOCAL-00061" summary="clean before the build">
<created>1601300573031</created>
<option name="number" value="00061" />
<option name="presentableId" value="LOCAL-00061" />
<option name="project" value="LOCAL" />
<updated>1601300573031</updated>
</task>
<task id="LOCAL-00062" summary="clean before the build">
<created>1601300898190</created>
<option name="number" value="00062" />
@@ -648,7 +606,14 @@
<option name="project" value="LOCAL" />
<updated>1603886748106</updated>
</task>
<option name="localTasksCounter" value="110" />
<task id="LOCAL-00110" summary="- fix collisions between js script from main page and the application,&#10;- fix problem with special characters for etrack,">
<created>1604413401446</created>
<option name="number" value="00110" />
<option name="presentableId" value="LOCAL-00110" />
<option name="project" value="LOCAL" />
<updated>1604413401446</updated>
</task>
<option name="localTasksCounter" value="111" />
<servers />
</component>
<component name="UnknownFeatures">
@@ -668,7 +633,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="js small fixes" />
<MESSAGE value="js fix sort paggination, show body for etrack" />
<MESSAGE value="changing events describtion" />
<MESSAGE value="swagger" />
@@ -693,7 +657,8 @@
<MESSAGE value="testing config service" />
<MESSAGE value="adding profiles to dockerfile" />
<MESSAGE value="adding profiles to bootstrap.yml" />
<option name="LAST_COMMIT_MESSAGE" value="adding profiles to bootstrap.yml" />
<MESSAGE value="- fix collisions between js script from main page and the application,&#10;- fix problem with special characters for etrack," />
<option name="LAST_COMMIT_MESSAGE" value="- fix collisions between js script from main page and the application,&#10;- fix problem with special characters for etrack," />
</component>
<component name="WindowStateProjectService">
<state x="904" y="236" key="#Notifications" timestamp="1600868491636">
@@ -708,9 +673,10 @@
<screen x="1920" y="0" width="1920" height="1160" />
</state>
<state x="2620" y="382" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603883713801" />
<state x="574" y="128" key="#com.intellij.ide.util.MemberChooser" timestamp="1599641773245">
<screen x="0" y="0" width="1536" height="824" />
<state x="2638" y="162" key="#com.intellij.ide.util.MemberChooser" timestamp="1604428351830">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state x="2638" y="162" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604428351830" />
<state x="574" y="128" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1599641773245" />
<state x="432" y="337" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1599492129736">
<screen x="0" y="0" width="1536" height="824" />
@@ -745,39 +711,39 @@
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1602662342585" />
<state x="2606" y="235" key="FileChooserDialogImpl/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603885972656" />
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1602147205037" />
<state width="1493" height="49" key="GridCell.Tab.0.bottom" timestamp="1604412796289">
<screen x="0" y="0" width="1536" height="824" />
<state width="1877" height="102" key="GridCell.Tab.0.bottom" timestamp="1604427911444">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.bottom/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="49" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604412796289" />
<state width="1877" height="261" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424969" />
<state width="1493" height="217" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604413085479" />
<state width="1877" height="102" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604427911444" />
<state width="1493" height="233" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604328635480" />
<state width="1875" height="151" key="GridCell.Tab.0.bottom/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604317001880" />
<state width="1493" height="217" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1493" height="49" key="GridCell.Tab.0.center" timestamp="1604412796288">
<screen x="0" y="0" width="1536" height="824" />
<state width="1877" height="102" key="GridCell.Tab.0.center" timestamp="1604427911444">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.center/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="49" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604412796288" />
<state width="1877" height="261" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424968" />
<state width="1493" height="217" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604413085478" />
<state width="1877" height="102" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604427911444" />
<state width="1493" height="233" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604328635480" />
<state width="1875" height="151" key="GridCell.Tab.0.center/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604317001880" />
<state width="1493" height="217" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1493" height="49" key="GridCell.Tab.0.left" timestamp="1604412796287">
<screen x="0" y="0" width="1536" height="824" />
<state width="1877" height="102" key="GridCell.Tab.0.left" timestamp="1604427911444">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.left/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="49" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604412796287" />
<state width="1877" height="261" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424967" />
<state width="1493" height="217" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604413085478" />
<state width="1877" height="102" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604427911444" />
<state width="1493" height="233" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604328635480" />
<state width="1875" height="151" key="GridCell.Tab.0.left/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604317001880" />
<state width="1493" height="217" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
<state width="1493" height="49" key="GridCell.Tab.0.right" timestamp="1604412796288">
<screen x="0" y="0" width="1536" height="824" />
<state width="1877" height="102" key="GridCell.Tab.0.right" timestamp="1604427911444">
<screen x="1920" y="0" width="1920" height="1040" />
</state>
<state width="1877" height="239" key="GridCell.Tab.0.right/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275797041" />
<state width="1493" height="49" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604412796288" />
<state width="1877" height="261" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255424969" />
<state width="1493" height="217" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604413085478" />
<state width="1877" height="102" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1604427911444" />
<state width="1493" height="233" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@0.0.1536.824" timestamp="1604328635480" />
<state width="1875" height="151" key="GridCell.Tab.0.right/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1604317001880" />
<state width="1493" height="217" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1602147432366" />
@@ -827,11 +793,11 @@
</state>
<state x="277" y="57" key="SettingsEditor/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600935670743" />
<state x="277" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1601975962923" />
<state x="2371" y="204" key="Vcs.Push.Dialog.v2" timestamp="1603886750020">
<screen x="1920" y="0" width="1920" height="1160" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2" timestamp="1604413405123">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="451" y="183" key="Vcs.Push.Dialog.v2/-1920.0.1536.832/0.0.1920.1040@0.0.1920.1040" timestamp="1600275760386" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1600350277680" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@0.0.1536.824" timestamp="1604413405123" />
<state x="2371" y="183" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1040@1920.0.1920.1040" timestamp="1602255416393" />
<state x="2371" y="204" key="Vcs.Push.Dialog.v2/0.0.1536.824/1920.0.1920.1160@1920.0.1920.1160" timestamp="1603886750020" />
<state x="361" y="145" key="Vcs.Push.Dialog.v2/0.0.1536.824@0.0.1536.824" timestamp="1602145235569" />

View File

@@ -120,9 +120,7 @@ public class KlausMvcController {
return UUID.randomUUID();
}
public void getModelMockedMessageDto(Model model, MockedMessageDto mockedMessageDto) {
System.out.println(mockedMessageDto);
System.out.println(globalMockedMessageDto);
private void getModelMockedMessageDto(Model model, MockedMessageDto mockedMessageDto) {
if (mockedMessageDto.getMockedResponseId() == null){
Map<String, String> headers = new HashMap<>();
headers.put("Keep-Alive", "timeout=60");
@@ -163,4 +161,8 @@ public class KlausMvcController {
getModelMockedMessageDto(model, mockedMessageDto);
}
public static MockedMessageDto getGlobalMockedMessageDto() {
return globalMockedMessageDto;
}
}

View File

@@ -1,5 +1,6 @@
package com.release11.klaus.service;
import com.release11.klaus.controller.KlausMvcController;
import com.release11.klaus.mappers.MockedMessageMapper;
import com.release11.klaus.model.MockedMessage;
import com.release11.klaus.model.MockedMessageDto;
@@ -41,10 +42,10 @@ public class KlausServiceImpl implements KlausService {
public MockedMessageDto getMockedResponse(UUID clientUUID, int mockedResponseId) {
String key = clientUUID.toString() + "_" + mockedResponseId;
Optional<MockedMessage> optionalMockedMessage = mockedResponseRepository.findById(key);
MockedMessageDto mockedMessageDto = new MockedMessageDto();
MockedMessageDto mockedMessageDto = KlausMvcController.getGlobalMockedMessageDto();
if (optionalMockedMessage.isPresent()) {
mockedMessageDto = mockedMessageMapper.mockedMessageToMockedMessageDto(optionalMockedMessage.get());
log.info(mockedMessageDto.toString().replaceAll("\"","\\\""));
log.info(mockedMessageDto.toString().replaceAll("\"","\\\\\""));
return mockedMessageDto;
}
log.info(mockedMessageDto.toString());

View File

@@ -3,7 +3,7 @@
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<!--https://github.com/kmtong/logback-redis-appender-->
<appender name="LOGSTASH" class="com.release11.klaus.utilis.RedisAppender">
<host>localhost</host>
<host>redis</host>
<port>6379</port>
<key>logstash</key>
<layout class="ch.qos.logback.classic.PatternLayout">

View File

@@ -18,33 +18,58 @@
<div class="container">
<section class="page-section" id="main-section">
<div class="container">
<p>With this tool you can create mockups for http requests and use them for integration tests of your system.</p>
<div class="row">
<div class="column">
<p>With this tool you can create mockups for http requests and use them for integration tests of
your system.</p>
<div>
<br>
<p>In order to set mockup response please fill the form below:</p>
<p>You can test the mocked message using the url or the button below:</p>
<table>
<tr>
<td>
<p>
http://[[${localhost}]]:8097/klaus/v1/get/[[${mockedMessageDto.clientUUID}]]/[[${mockedMessageDto.mockedResponseId}]]</p>
</td>
<td>
<form action="#" th:action="@{/home/getMockedResponse}"
th:object="${mockedMessageDto}"
method="get">
<input type="text" th:field="*{clientUUID}" hidden/>
<input type="text" th:field="*{mockedResponseId}" hidden/>
<input type="submit" value="Test your mock"/>
</form>
</td>
</tr>
</table>
<br>
<table>
<p>In order to set or update mockup response please fill the form below and save
your message:</p>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<input type="text" th:field="*{clientUUID}" hidden/>
<tr>
<td>Mocked response id:</td>
<td><input type="text" th:field="*{mockedResponseId}" th:value="*{mockedResponseId}"/></td>
<td th:if="${#fields.hasErrors('mockedResponseId')}" th:errors="*{mockedResponseId}">Id
Error
</td>
<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>Mocked response body:</td>
<td><textarea rows="4" cols="30" th:field="*{messageBody}"
placeholder="Your message body"></textarea></td>
<td th:if="${#fields.hasErrors('messageBody')}" th:errors="*{messageBody}">Body Error</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}" placeholder="200"></td>
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">HttpStatus Error
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">
HttpStatus Error
</td>
</tr>
@@ -53,30 +78,35 @@
<td>Header value</td>
</tr>
<tr>
<td><input type="text" name="headerKey" id="headerKey" placeholder="myHeaderKey"/></td>
<td><input type="text" name="headerKey" id="headerKey"
placeholder="myHeaderKey"/></td>
<td>
<input type="text" name="headerValue" id="headerValue" placeholder="myHeaderValue"/>
<input type="text" name="headerValue" id="headerValue"
placeholder="myHeaderValue"/>
<input type="image" name="addHeader" src="/img/icons8-plus-48.png"
style="width: 20px;"/>
</td>
</tr>
<tr th:each="entry, stats : *{httpHeaders}" bgcolor="#b3ffff">
<td><input type="text" name="value" th:value="${entry.key}" disabled="disabled"/></td>
<td><input type="text" name="value" th:value="${entry.key}"
disabled="disabled"/></td>
<td>
&#9;
<input type="text" name="value" th:field="*{httpHeaders[__${entry.key}__]}"/>
<input type="text" name="value"
th:field="*{httpHeaders[__${entry.key}__]}"/>
<button type="submit" name="removeHeader" th:value="${entry.key}">
<img src="/img/icons8-cancel-64.png" style="width: 20px;"/>
</button>
</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>
<td>Mocked response id:</td>
<td><input type="text" th:field="*{mockedResponseId}"
th:value="*{mockedResponseId}"/></td>
<td th:if="${#fields.hasErrors('mockedResponseId')}"
th:errors="*{mockedResponseId}">Id
Error
</td>
</tr>
<tr>
<td><input type="submit" value="Save my message"/></td>
@@ -97,60 +127,57 @@
<p><input type="submit" value="History"/></p>
</form>
</td>
<td>
<form action="#" th:action="@{/home/getMockedResponse}" th:object="${mockedMessageDto}"
method="get">
<input type="text" th:field="*{clientUUID}" hidden/>
<input type="text" th:field="*{mockedResponseId}" hidden/>
<p th:if="${canTest}"><input type="submit" value="Test your mock"/></p>
</form>
</td>
</tr>
</table>
<p th:if="${mockSaved}">Mock has been saved</p>
</div>
<div class="column">
<br>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<thead>
<tr>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-0">#</p>
</th>
<th class="tr-pageable">
<p class="btn-sort activeButton" id="btn-sort-1">MessageId</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-2">Media Type</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-3">Http Status</p>
</th>
</tr>
</thead>
<input type="text" th:field="*{clientUUID}" hidden/>
<tbody id="table-body">
</tbody>
</table>
</form>
<div class="container ">
<div id="pagination-wrapper"></div>
</div>
</div>
</div>
</div>
</section>
<hr>
</div>
<div>
<p>Here you can see the interactive list of all your mocked messages. You can call all of them. Use the buttons to sort the list and also update or delete messages.</p>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<thead>
<tr>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-0">#</p>
</th>
<th class="tr-pageable">
<p class="btn-sort activeButton" id="btn-sort-1">MessageId</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-2">Media Type</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-3">Http Status</p>
</th>
</tr>
</thead>
<input type="text" th:field="*{clientUUID}" hidden/>
<tbody id="table-body">
</tbody>
</table>
</form>
<div class="container ">
<div id="pagination-wrapper"></div>
</div>
</div>
<hr>
<div>
<br>If you are keen to use the mocking service with bigger amount of messages or automate the process by inserting
high amount of random messages please consider using the tools below:
<br>If you are keen to use the mocking service with bigger amount of messages or automate the process by
inserting
high amount of random messages please consider using swagger or send batch requests on the urls below:
<br><a href="http://[[${localhost}]]:8097/swagger-ui.html">http://[[${localhost}]]:8097/swagger-ui.html</a>
<br><a
href="http://[[${localhost}]]:8097/swagger-ui.html">http://[[${localhost}]]:8097/swagger-ui.html</a>
<br>
<br>http://[[${localhost}]]:8097/klaus/v1/delete/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}
<br>http://[[${localhost}]]:8097/klaus/v1/set/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}?httpStatus={httpStatus}
@@ -160,14 +187,15 @@
</div>
<hr>
</div>
</div>
</div>
<div id="foot"></div>
</div>
<div id="foot"></div>
</div>
<script type="text/javascript" th:inline="javascript">
var listForPagination = /*[[${mockedMessageDtoList}]]*/;
</script>
<script src="/js/paggination.js"></script>
<script>
@@ -181,6 +209,7 @@ $.get("https://raw.githubusercontent.com/Szakalakamaka/viewpresenter/master/src/
$("#foot").html(data);
});
</script>
</body>

View File

@@ -0,0 +1,25 @@
spring:
profiles:
active: PROD
application:
name: klaus
cloud:
spring:
cloud:
config:
fail-fast: false
uri: http://s5000xvn.zipper.release11.com:8888
retry:
max-attempts: 20
max-interval: 15000
initial-interval: 10000
server:
port: 8097
eureka:
client:
enabled: true
register-with-eureka: true
fetch-registry: true
serviceUrl:
defaultZone: http://netflix:eureka@eureka:8761/eureka

View File

@@ -0,0 +1,24 @@
spring:
# profiles:
# active: DEV
application:
name: klaus
cloud:
spring:
cloud:
config:
uri: http://s5000xvn.zipper.release11.com:8888
retry:
max-attempts: 20
max-interval: 15000
initial-interval: 10000
server:
port: 8097
eureka:
client:
enabled: true
register-with-eureka: true
fetch-registry: true
serviceUrl:
defaultZone: http://netflix:eureka@localhost:8761/eureka

View File

@@ -3,7 +3,7 @@
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<!--https://github.com/kmtong/logback-redis-appender-->
<appender name="LOGSTASH" class="com.release11.klaus.utilis.RedisAppender">
<host>localhost</host>
<host>redis</host>
<port>6379</port>
<key>logstash</key>
<layout class="ch.qos.logback.classic.PatternLayout">

View File

@@ -18,33 +18,58 @@
<div class="container">
<section class="page-section" id="main-section">
<div class="container">
<p>With this tool you can create mockups for http requests and use them for integration tests of your system.</p>
<div class="row">
<div class="column">
<p>With this tool you can create mockups for http requests and use them for integration tests of
your system.</p>
<div>
<br>
<p>In order to set mockup response please fill the form below:</p>
<p>You can test the mocked message using the url or the button below:</p>
<table>
<tr>
<td>
<p>
http://[[${localhost}]]:8097/klaus/v1/get/[[${mockedMessageDto.clientUUID}]]/[[${mockedMessageDto.mockedResponseId}]]</p>
</td>
<td>
<form action="#" th:action="@{/home/getMockedResponse}"
th:object="${mockedMessageDto}"
method="get">
<input type="text" th:field="*{clientUUID}" hidden/>
<input type="text" th:field="*{mockedResponseId}" hidden/>
<input type="submit" value="Test your mock"/>
</form>
</td>
</tr>
</table>
<br>
<table>
<p>In order to set or update mockup response please fill the form below and save
your message:</p>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<input type="text" th:field="*{clientUUID}" hidden/>
<tr>
<td>Mocked response id:</td>
<td><input type="text" th:field="*{mockedResponseId}" th:value="*{mockedResponseId}"/></td>
<td th:if="${#fields.hasErrors('mockedResponseId')}" th:errors="*{mockedResponseId}">Id
Error
</td>
<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>Mocked response body:</td>
<td><textarea rows="4" cols="30" th:field="*{messageBody}"
placeholder="Your message body"></textarea></td>
<td th:if="${#fields.hasErrors('messageBody')}" th:errors="*{messageBody}">Body Error</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}" placeholder="200"></td>
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">HttpStatus Error
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">
HttpStatus Error
</td>
</tr>
@@ -53,30 +78,35 @@
<td>Header value</td>
</tr>
<tr>
<td><input type="text" name="headerKey" id="headerKey" placeholder="myHeaderKey"/></td>
<td><input type="text" name="headerKey" id="headerKey"
placeholder="myHeaderKey"/></td>
<td>
<input type="text" name="headerValue" id="headerValue" placeholder="myHeaderValue"/>
<input type="text" name="headerValue" id="headerValue"
placeholder="myHeaderValue"/>
<input type="image" name="addHeader" src="/img/icons8-plus-48.png"
style="width: 20px;"/>
</td>
</tr>
<tr th:each="entry, stats : *{httpHeaders}" bgcolor="#b3ffff">
<td><input type="text" name="value" th:value="${entry.key}" disabled="disabled"/></td>
<td><input type="text" name="value" th:value="${entry.key}"
disabled="disabled"/></td>
<td>
&#9;
<input type="text" name="value" th:field="*{httpHeaders[__${entry.key}__]}"/>
<input type="text" name="value"
th:field="*{httpHeaders[__${entry.key}__]}"/>
<button type="submit" name="removeHeader" th:value="${entry.key}">
<img src="/img/icons8-cancel-64.png" style="width: 20px;"/>
</button>
</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>
<td>Mocked response id:</td>
<td><input type="text" th:field="*{mockedResponseId}"
th:value="*{mockedResponseId}"/></td>
<td th:if="${#fields.hasErrors('mockedResponseId')}"
th:errors="*{mockedResponseId}">Id
Error
</td>
</tr>
<tr>
<td><input type="submit" value="Save my message"/></td>
@@ -97,60 +127,57 @@
<p><input type="submit" value="History"/></p>
</form>
</td>
<td>
<form action="#" th:action="@{/home/getMockedResponse}" th:object="${mockedMessageDto}"
method="get">
<input type="text" th:field="*{clientUUID}" hidden/>
<input type="text" th:field="*{mockedResponseId}" hidden/>
<p th:if="${canTest}"><input type="submit" value="Test your mock"/></p>
</form>
</td>
</tr>
</table>
<p th:if="${mockSaved}">Mock has been saved</p>
</div>
<div class="column">
<br>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<thead>
<tr>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-0">#</p>
</th>
<th class="tr-pageable">
<p class="btn-sort activeButton" id="btn-sort-1">MessageId</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-2">Media Type</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-3">Http Status</p>
</th>
</tr>
</thead>
<input type="text" th:field="*{clientUUID}" hidden/>
<tbody id="table-body">
</tbody>
</table>
</form>
<div class="container ">
<div id="pagination-wrapper"></div>
</div>
</div>
</div>
</div>
</section>
<hr>
</div>
<div>
<p>Here you can see the interactive list of all your mocked messages. You can call all of them. Use the buttons to sort the list and also update or delete messages.</p>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<thead>
<tr>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-0">#</p>
</th>
<th class="tr-pageable">
<p class="btn-sort activeButton" id="btn-sort-1">MessageId</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-2">Media Type</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-3">Http Status</p>
</th>
</tr>
</thead>
<input type="text" th:field="*{clientUUID}" hidden/>
<tbody id="table-body">
</tbody>
</table>
</form>
<div class="container ">
<div id="pagination-wrapper"></div>
</div>
</div>
<hr>
<div>
<br>If you are keen to use the mocking service with bigger amount of messages or automate the process by inserting
high amount of random messages please consider using the tools below:
<br>If you are keen to use the mocking service with bigger amount of messages or automate the process by
inserting
high amount of random messages please consider using swagger or send batch requests on the urls below:
<br><a href="http://[[${localhost}]]:8097/swagger-ui.html">http://[[${localhost}]]:8097/swagger-ui.html</a>
<br><a
href="http://[[${localhost}]]:8097/swagger-ui.html">http://[[${localhost}]]:8097/swagger-ui.html</a>
<br>
<br>http://[[${localhost}]]:8097/klaus/v1/delete/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}
<br>http://[[${localhost}]]:8097/klaus/v1/set/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}?httpStatus={httpStatus}
@@ -160,14 +187,15 @@
</div>
<hr>
</div>
</div>
</div>
<div id="foot"></div>
</div>
<div id="foot"></div>
</div>
<script type="text/javascript" th:inline="javascript">
var listForPagination = /*[[${mockedMessageDtoList}]]*/;
</script>
<script src="/js/paggination.js"></script>
<script>
@@ -181,6 +209,7 @@ $.get("https://raw.githubusercontent.com/Szakalakamaka/viewpresenter/master/src/
$("#foot").html(data);
});
</script>
</body>

View File

@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="container1">
<div id="sidebar"></div>
<div id="child-body">
<div class="container">
<div id="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et
commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.
Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec
lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est
euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec
fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget,
consequat quis, neque</p>
</div>
<br>
<div id="content1">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et
commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.
Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec
lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est
euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec
fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget,
consequat quis, neque</p>
</div>
<br>
<div id="content2">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et
commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.
Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec
lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est
euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec
fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget,
consequat quis, neque</p>
</div>
<br>
<div id="content3">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et
commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.
Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec
lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est
euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec
fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget,
consequat quis, neque</p>
</div>
</div>
</div>
</div>
<div id="foot"></div>
</div>
<script>
$.get("https://raw.githubusercontent.com/Szakalakamaka/viewpresenter/master/src/main/resources/templates/navbar.html", function(data){
$("#header").html(data);
});
$.get("https://raw.githubusercontent.com/Szakalakamaka/viewpresenter/master/src/main/resources/templates/sidebar.html", function(data){
$("#sidebar").html(data);
});
$.get("https://raw.githubusercontent.com/Szakalakamaka/viewpresenter/master/src/main/resources/templates/footer.html", function(data){
$("#foot").html(data);
});
</script>
<script>
var list = document.getElementById("parentPage");
<!--list.removeChild(list.childNodes[0]);-->
var table = document.getElementById('parentPage');
var table1 = document.getElementById('parentPage');
console.log(table1);
</script>
</body>
</html>