요청 로그 수정
This commit is contained in:
@@ -41,7 +41,9 @@ public class MockApiController {
|
||||
|
||||
for (MockRoute mockRoute : mockRouteService.getAllRoutes()) {
|
||||
if (isRouteMatch(mockRoute, request)) {
|
||||
logger.debug("===========================");
|
||||
logger.debug(request.getBody());
|
||||
logger.debug("===========================");
|
||||
Map<String, String> pathVariables = pathMatcher.extractUriTemplateVariables(mockRoute.getPathPattern(), request.getUri());
|
||||
MockResponse matchingResponse = findMatchingResponse(mockRoute, request, pathVariables);
|
||||
if (matchingResponse != null) {
|
||||
|
||||
@@ -22,18 +22,46 @@ import java.util.Map;
|
||||
unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
@Component
|
||||
public abstract class MockRouteMapper {
|
||||
|
||||
private static final Map<String, String> XML_ESCAPE_MAP;
|
||||
|
||||
static {
|
||||
XML_ESCAPE_MAP = new HashMap<>();
|
||||
XML_ESCAPE_MAP.put("<", "<");
|
||||
XML_ESCAPE_MAP.put(">", ">");
|
||||
XML_ESCAPE_MAP.put("&", "&");
|
||||
XML_ESCAPE_MAP.put(""", "\"");
|
||||
XML_ESCAPE_MAP.put("'", "'");
|
||||
}
|
||||
|
||||
public abstract MockRoute map(MockRouteDTO dto);
|
||||
|
||||
|
||||
public abstract MockRouteDTO map(MockRoute entity);
|
||||
|
||||
@Mapping(target = "headers", source = "headers", qualifiedByName = "mapHeadersToMap")
|
||||
@Mapping(target ="defaultResponse", source = "defaultResponse", qualifiedByName = "mapEntityDefaultResponse")
|
||||
@Mapping(target = "defaultResponse", source = "defaultResponse", qualifiedByName = "mapEntityDefaultResponse")
|
||||
@Mapping(target = "body", source="body" , qualifiedByName = "unescapeBody")
|
||||
public abstract MockResponse map(MockResponseDTO dto);
|
||||
|
||||
@Mapping(target = "headers", source = "headers", qualifiedByName = "mapHeadersToList")
|
||||
@Mapping(target ="defaultResponse", source = "defaultResponse", qualifiedByName = "mapDTODefaultResponse")
|
||||
@Mapping(target = "defaultResponse", source = "defaultResponse", qualifiedByName = "mapDTODefaultResponse")
|
||||
@Mapping(target = "body", source="body" , qualifiedByName = "unescapeBody")
|
||||
public abstract MockResponseDTO map(MockResponse entity);
|
||||
|
||||
@Named("unescapeBody")
|
||||
public static String unescapeXml(String escapedXml) {
|
||||
if (escapedXml == null || escapedXml.isEmpty()) {
|
||||
return escapedXml;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : XML_ESCAPE_MAP.entrySet()) {
|
||||
escapedXml = escapedXml.replace(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
return escapedXml;
|
||||
}
|
||||
|
||||
@Named("mapDTODefaultResponse")
|
||||
public String map(boolean value) {
|
||||
return value ? "true" : "false";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* 이 파일은 커스텀 파일입니다*/
|
||||
body {
|
||||
font-family: 'Noto Sans KR', sans-serif;
|
||||
font-family: 'NotoSansKR', sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
|
||||
Reference in New Issue
Block a user