changing index.html and adding Etrack
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
package com.release11.klaus.controller;
|
||||
|
||||
import org.apache.tomcat.jni.Local;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Month;
|
||||
import java.time.Period;
|
||||
|
||||
class KlausControllerTest {
|
||||
|
||||
@Test
|
||||
void getMockedResponse() {
|
||||
LocalDate localDate = LocalDate.now();
|
||||
LocalDate localDate1 = LocalDate.now();
|
||||
|
||||
System.out.println(localDate.compareTo(localDate1));
|
||||
System.out.println(localDate1);
|
||||
Period period = Period.between(localDate, localDate1);
|
||||
System.out.println(period);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.release11.klaus.controller;
|
||||
|
||||
import com.release11.klaus.model.Event;
|
||||
import com.release11.klaus.model.EventRequestDto;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -15,5 +18,8 @@ class KlausMvcControllerTest {
|
||||
@Test
|
||||
void showHome() {
|
||||
|
||||
EventRequestDto eventRequestDto = EventRequestDto.builder().
|
||||
localDateTimeTo(LocalDateTime.now()).build();
|
||||
System.out.println(eventRequestDto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,57 @@
|
||||
package com.release11.klaus.repository;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.release11.klaus.model.Event;
|
||||
import com.release11.klaus.utilis.BusinessKey;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@SpringBootTest
|
||||
class MockedResponseRedisRepositoryTest {
|
||||
@Autowired
|
||||
ObjectMapper objectMapper;
|
||||
|
||||
|
||||
@Test
|
||||
void getMockedResponse() {
|
||||
void getMockedResponse() throws JsonProcessingException {
|
||||
Map<BusinessKey, String> businessKeys = new HashMap<>();
|
||||
String[] businessKeys1 = {"fdsa", "Dsa", "dsa"};
|
||||
businessKeys.put(BusinessKey.CLIENT_UUID, "xxx");
|
||||
businessKeys.put(BusinessKey.INTERFACE_NAME, "interfaceName");
|
||||
businessKeys.put(BusinessKey.MESSAGE_ID, "2323");
|
||||
Event event = Event.builder()
|
||||
.dateTimeStamp(LocalDateTime.now())
|
||||
.businessKeys(businessKeys1)
|
||||
.message("hello")
|
||||
.level("INFO")
|
||||
.thread("main")
|
||||
.build();
|
||||
String eventString = objectMapper.writeValueAsString(event);
|
||||
System.out.println(eventString);
|
||||
|
||||
|
||||
String ddd = "{\"dateTimeStamp\" : \"2020-09-04T15:31:48\", \"businessKeys\":[\"INTERFACE_NAME:setMockedResponse\", \"CLIENT_UUID:436c4774-038f-4540-9c18-2691ca9b53d4\", \"MESSAGE_ID:1\"],\"thread\":\"http-nio-8097-exec-6\",\"level\":\"INFO \", \"message\":\"MockedResponseDto(compositePrimaryKey=null, clientUUID=436c4774-038f-4540-9c18-2691ca9b53d4, mockedResponseId=1, mediaType=application/xml, messageBody=body, httpHeaders=null, httpStatus=200)\" dsads}das";
|
||||
objectMapper.readValue(eventString, Event.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void setMockedResponse() {
|
||||
// System.out.println("Before Test, clearing Redis");
|
||||
// JedisPool pool = new JedisPool("localhost");
|
||||
// redis = pool.getResource();
|
||||
// redis.ltrim(key, 1, 0);
|
||||
|
||||
List<String> stringList = new ArrayList<>();
|
||||
stringList.add("ddddd");
|
||||
stringList.add("www");
|
||||
|
||||
stringList.stream().filter(s -> s.length() > 3).forEach(System.out::println);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user