diff --git a/build.gradle b/build.gradle index aaac8d318e..cfd1366a99 100644 --- a/build.gradle +++ b/build.gradle @@ -65,9 +65,9 @@ dependencies { } api platform("com.fasterxml.jackson:jackson-bom:$versions.jackson") api "com.fasterxml.jackson.core:jackson-core", - "com.fasterxml.jackson.core:jackson-annotations", - "com.fasterxml.jackson.core:jackson-databind", - "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" + "com.fasterxml.jackson.core:jackson-annotations", + "com.fasterxml.jackson.core:jackson-databind", + "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" api "org.apache.httpcomponents.client5:httpclient5:5.2.1" api "org.xmlunit:xmlunit-core:$versions.xmlUnit" api "org.xmlunit:xmlunit-legacy:$versions.xmlUnit", { diff --git a/src/main/java/com/github/tomakehurst/wiremock/common/JsonPrettyPrinter.java b/src/main/java/com/github/tomakehurst/wiremock/common/JsonPrettyPrinter.java index 373eeef721..52fb589a97 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/common/JsonPrettyPrinter.java +++ b/src/main/java/com/github/tomakehurst/wiremock/common/JsonPrettyPrinter.java @@ -1,19 +1,33 @@ +/* + * Copyright (C) 2023 Thomas Akehurst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.github.tomakehurst.wiremock.common; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.util.DefaultPrettyPrinter; - import java.io.IOException; public class JsonPrettyPrinter extends DefaultPrettyPrinter { - @Override - public DefaultPrettyPrinter createInstance() { - return new JsonPrettyPrinter(); - } + @Override + public DefaultPrettyPrinter createInstance() { + return new JsonPrettyPrinter(); + } - @Override - public void writeObjectFieldValueSeparator(final JsonGenerator jg) throws IOException { - jg.writeRaw(": "); - } + @Override + public void writeObjectFieldValueSeparator(final JsonGenerator jg) throws IOException { + jg.writeRaw(": "); + } } diff --git a/src/main/java/com/github/tomakehurst/wiremock/core/WireMockApp.java b/src/main/java/com/github/tomakehurst/wiremock/core/WireMockApp.java index 96093e1d8f..2e96ea42e3 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/core/WireMockApp.java +++ b/src/main/java/com/github/tomakehurst/wiremock/core/WireMockApp.java @@ -193,12 +193,11 @@ public StubRequestHandler buildStubRequestHandler() { Map postServeActions = extensions.ofType(PostServeAction.class); Map concatenatedMap = - new HashMap<>(extensions.ofType(ServeEventListener.class)); + new HashMap<>(extensions.ofType(ServeEventListener.class)); concatenatedMap.put("wiremock-gui", new GuiServeEventListener()); Map serveEventListeners = - Collections.unmodifiableMap(concatenatedMap); - + Collections.unmodifiableMap(concatenatedMap); BrowserProxySettings browserProxySettings = options.browserProxySettings(); diff --git a/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java b/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java index 6ce2ca3674..d83885b68a 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java +++ b/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java @@ -24,8 +24,8 @@ import com.github.tomakehurst.wiremock.stubbing.StubMappingCollection; import com.github.tomakehurst.wiremock.stubbing.StubMappings; import java.util.HashMap; -import java.util.List; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.UUID; @@ -151,8 +151,8 @@ private boolean hasFolderDefinition(final StubMapping mapping) { } return metadata.containsKey(WIREMOCK_GUI_KEY) - && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) != null - && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) instanceof String; + && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) != null + && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) instanceof String; } private String getFolderDefinition(final StubMapping mapping) {