Permalink
Browse files

Optimised imports

  • Loading branch information...
1 parent 9d9c0d5 commit 1116786d3211d2ce9ae8a5e353f14b61add35d0d @tomakehurst committed May 11, 2013
Showing with 239 additions and 341 deletions.
  1. +2 −5 src/main/java/com/github/tomakehurst/wiremock/Log4jConfiguration.java
  2. +0 −1 src/main/java/com/github/tomakehurst/wiremock/WireMockServer.java
  3. +2 −2 src/main/java/com/github/tomakehurst/wiremock/common/Json.java
  4. +8 −8 src/main/java/com/github/tomakehurst/wiremock/http/HttpHeaders.java
  5. +6 −6 src/main/java/com/github/tomakehurst/wiremock/http/HttpHeadersJsonDeserializer.java
  6. +2 −2 src/main/java/com/github/tomakehurst/wiremock/http/HttpHeadersJsonSerializer.java
  7. +7 −9 src/main/java/com/github/tomakehurst/wiremock/http/ResponseDefinition.java
  8. +2 −3 src/main/java/com/github/tomakehurst/wiremock/junit/WireMockClassRule.java
  9. +10 −14 src/main/java/com/github/tomakehurst/wiremock/matching/RequestPattern.java
  10. +4 −4 src/main/java/com/github/tomakehurst/wiremock/matching/ValuePattern.java
  11. +0 −4 src/main/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptions.java
  12. +2 −2 src/main/java/com/github/tomakehurst/wiremock/verification/FindRequestsResult.java
  13. +6 −10 src/main/java/com/github/tomakehurst/wiremock/verification/LoggedRequest.java
  14. +2 −3 src/test/java/com/github/tomakehurst/wiremock/AcceptanceTestBase.java
  15. +9 −25 src/test/java/com/github/tomakehurst/wiremock/Examples.java
  16. +4 −8 src/test/java/com/github/tomakehurst/wiremock/GlobalSettingsAcceptanceTest.java
  17. +4 −5 src/test/java/com/github/tomakehurst/wiremock/HeaderMatchingAcceptanceTest.java
  18. +0 −2 src/test/java/com/github/tomakehurst/wiremock/HttpsAcceptanceTest.java
  19. +1 −3 src/test/java/com/github/tomakehurst/wiremock/MappingsAcceptanceTest.java
  20. +6 −7 src/test/java/com/github/tomakehurst/wiremock/MappingsLoaderAcceptanceTest.java
  21. +5 −6 src/test/java/com/github/tomakehurst/wiremock/PortNumberTest.java
  22. +5 −6 src/test/java/com/github/tomakehurst/wiremock/ProxyAcceptanceTest.java
  23. +5 −10 src/test/java/com/github/tomakehurst/wiremock/ScenarioAcceptanceTest.java
  24. +8 −8 src/test/java/com/github/tomakehurst/wiremock/StubbingAcceptanceTest.java
  25. +3 −4 src/test/java/com/github/tomakehurst/wiremock/UrlMatchingAcceptanceTest.java
  26. +0 −1 src/test/java/com/github/tomakehurst/wiremock/VerificationAcceptanceTest.java
  27. +8 −12 src/test/java/com/github/tomakehurst/wiremock/WarDeploymentAcceptanceTest.java
  28. +7 −7 src/test/java/com/github/tomakehurst/wiremock/WireMockJUnitRuleTest.java
  29. +5 −9 src/test/java/com/github/tomakehurst/wiremock/WireMockStaticJUnitRuleTest.java
  30. +1 −1 src/test/java/com/github/tomakehurst/wiremock/client/MappingBuilderTest.java
  31. +7 −11 src/test/java/com/github/tomakehurst/wiremock/client/WireMockAltHostAndPortAcceptanceTest.java
  32. +5 −9 src/test/java/com/github/tomakehurst/wiremock/client/WireMockClientAcceptanceTest.java
  33. +3 −4 src/test/java/com/github/tomakehurst/wiremock/client/WireMockClientTest.java
  34. +9 −10 src/test/java/com/github/tomakehurst/wiremock/common/ServletContextFileSourceTest.java
  35. +5 −5 src/test/java/com/github/tomakehurst/wiremock/common/SingleRootFileSourceTest.java
  36. +2 −2 src/test/java/com/github/tomakehurst/wiremock/common/VeryShortIdGeneratorTest.java
  37. +6 −7 src/test/java/com/github/tomakehurst/wiremock/http/ContentTypeHeaderTest.java
  38. +3 −4 src/test/java/com/github/tomakehurst/wiremock/http/ServletContainerUtilsTest.java
  39. +3 −6 src/test/java/com/github/tomakehurst/wiremock/standalone/CommandLineOptionsTest.java
  40. +11 −16 src/test/java/com/github/tomakehurst/wiremock/stubbing/AdminRequestHandlerTest.java
  41. +8 −12 src/test/java/com/github/tomakehurst/wiremock/stubbing/InMemoryMappingsTest.java
  42. +5 −5 src/test/java/com/github/tomakehurst/wiremock/stubbing/SortedConcurrentMappingSetTest.java
  43. +11 −12 src/test/java/com/github/tomakehurst/wiremock/stubbing/StubMappingJsonRecorderTest.java
  44. +5 −7 src/test/java/com/github/tomakehurst/wiremock/stubbing/StubRequestHandlerTest.java
  45. +3 −3 src/test/java/com/github/tomakehurst/wiremock/stubbing/ValuePatternTest.java
  46. +5 −6 src/test/java/com/github/tomakehurst/wiremock/testsupport/MockHttpServletRequest.java
  47. +1 −5 src/test/java/com/github/tomakehurst/wiremock/testsupport/MockRequestBuilder.java
  48. +4 −4 src/test/java/com/github/tomakehurst/wiremock/testsupport/RequestResponseMappingBuilder.java
  49. +4 −4 src/test/java/com/github/tomakehurst/wiremock/testsupport/WireMockResponse.java
  50. +7 −11 src/test/java/com/github/tomakehurst/wiremock/verification/LoggedRequestTest.java
  51. +8 −11 testlogging/src/test/java/WiremockTest.java
@@ -1,14 +1,11 @@
package com.github.tomakehurst.wiremock;
+import com.github.tomakehurst.wiremock.common.Log4jNotifier;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
-import com.github.tomakehurst.wiremock.common.Log4jNotifier;
-
-import static org.apache.log4j.Level.ERROR;
-import static org.apache.log4j.Level.INFO;
-import static org.apache.log4j.Level.TRACE;
+import static org.apache.log4j.Level.*;
public class Log4jConfiguration {
public static void configureLogging(boolean verbose) {
@@ -40,7 +40,6 @@
import org.mortbay.jetty.servlet.ServletHolder;
import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
import static com.github.tomakehurst.wiremock.core.WireMockApp.ADMIN_CONTEXT_ROOT;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
@@ -15,11 +15,11 @@
*/
package com.github.tomakehurst.wiremock.common;
-import java.io.IOException;
-
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+
public final class Json {
private Json() {}
@@ -15,21 +15,21 @@
*/
package com.github.tomakehurst.wiremock.http;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-import static com.google.common.collect.Sets.newHashSet;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import static com.google.common.collect.Iterables.transform;
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Sets.newHashSet;
+
@JsonSerialize(using = HttpHeadersJsonSerializer.class)
@JsonDeserialize(using = HttpHeadersJsonDeserializer.class)
public class HttpHeaders {
@@ -15,19 +15,19 @@
*/
package com.github.tomakehurst.wiremock.http;
-import static com.google.common.collect.Iterables.transform;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+
+import static com.google.common.collect.Iterables.transform;
+
public class HttpHeadersJsonDeserializer extends JsonDeserializer<HttpHeaders> {
@Override
@@ -15,12 +15,12 @@
*/
package com.github.tomakehurst.wiremock.http;
-import java.io.IOException;
-
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
+import java.io.IOException;
+
public class HttpHeadersJsonSerializer extends JsonSerializer<HttpHeaders> {
@Override
@@ -15,21 +15,19 @@
*/
package com.github.tomakehurst.wiremock.http;
-import static com.google.common.base.Charsets.UTF_8;
-import static java.net.HttpURLConnection.HTTP_CREATED;
-import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
-import static java.net.HttpURLConnection.HTTP_OK;
-import static javax.xml.bind.DatatypeConverter.parseBase64Binary;
-import static javax.xml.bind.DatatypeConverter.printBase64Binary;
-
-import java.nio.charset.Charset;
-
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
import com.github.tomakehurst.wiremock.common.Json;
+import java.nio.charset.Charset;
+
+import static com.google.common.base.Charsets.UTF_8;
+import static java.net.HttpURLConnection.*;
+import static javax.xml.bind.DatatypeConverter.parseBase64Binary;
+import static javax.xml.bind.DatatypeConverter.printBase64Binary;
+
@JsonSerialize(include=Inclusion.NON_NULL)
public class ResponseDefinition {
@@ -1,15 +1,14 @@
package com.github.tomakehurst.wiremock.junit;
+import com.github.tomakehurst.wiremock.WireMockServer;
+import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.core.Options;
import org.junit.rules.MethodRule;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;
-import com.github.tomakehurst.wiremock.WireMockServer;
-import com.github.tomakehurst.wiremock.client.WireMock;
-
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
public class WireMockClassRule implements MethodRule, TestRule {
@@ -15,20 +15,6 @@
*/
package com.github.tomakehurst.wiremock.matching;
-import static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;
-import static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;
-import static com.github.tomakehurst.wiremock.matching.ValuePattern.matching;
-import static com.google.common.collect.Iterables.all;
-import static com.google.common.collect.Iterables.any;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.size;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Maps.newLinkedHashMap;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
import com.github.tomakehurst.wiremock.common.Json;
@@ -39,6 +25,16 @@
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static com.github.tomakehurst.wiremock.common.LocalNotifier.notifier;
+import static com.github.tomakehurst.wiremock.http.RequestMethod.ANY;
+import static com.github.tomakehurst.wiremock.matching.ValuePattern.matching;
+import static com.google.common.collect.Iterables.*;
+import static com.google.common.collect.Maps.newLinkedHashMap;
+
@JsonSerialize(include=Inclusion.NON_NULL)
public class RequestPattern {
@@ -15,14 +15,14 @@
*/
package com.github.tomakehurst.wiremock.matching;
-import static java.util.regex.Pattern.DOTALL;
-
-import java.util.regex.Pattern;
-
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
import com.google.common.base.Predicate;
+import java.util.regex.Pattern;
+
+import static java.util.regex.Pattern.DOTALL;
+
@JsonSerialize(include=Inclusion.NON_NULL)
public class ValuePattern {
@@ -18,17 +18,13 @@
import com.github.tomakehurst.wiremock.common.*;
import com.github.tomakehurst.wiremock.core.Options;
import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
import java.io.IOException;
import java.io.StringWriter;
-import static com.google.common.base.Splitter.on;
-import static com.google.common.collect.Iterables.getLast;
-
public class CommandLineOptions implements Options {
private static final String HELP = "help";
@@ -15,11 +15,11 @@
*/
package com.github.tomakehurst.wiremock.verification;
-import java.util.List;
-
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
public class FindRequestsResult {
private List<LoggedRequest> requests;
@@ -15,21 +15,17 @@
*/
package com.github.tomakehurst.wiremock.verification;
-import static com.github.tomakehurst.wiremock.http.HttpHeaders.copyOf;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.github.tomakehurst.wiremock.http.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.github.tomakehurst.wiremock.http.ContentTypeHeader;
-import com.github.tomakehurst.wiremock.http.HttpHeader;
-import com.github.tomakehurst.wiremock.http.HttpHeaders;
-import com.github.tomakehurst.wiremock.http.Request;
-import com.github.tomakehurst.wiremock.http.RequestMethod;
+import static com.github.tomakehurst.wiremock.http.HttpHeaders.copyOf;
@JsonIgnoreProperties(ignoreUnknown=true)
public class LoggedRequest implements Request {
@@ -15,13 +15,12 @@
*/
package com.github.tomakehurst.wiremock;
+import com.github.tomakehurst.wiremock.client.WireMock;
+import com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import com.github.tomakehurst.wiremock.client.WireMock;
-import com.github.tomakehurst.wiremock.testsupport.WireMockTestClient;
-
public class AcceptanceTestBase {
protected static WireMockServer wireMockServer;
@@ -15,35 +15,19 @@
*/
package com.github.tomakehurst.wiremock;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.containing;
-import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.findAll;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.matching;
-import static com.github.tomakehurst.wiremock.client.WireMock.notMatching;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.put;
-import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
-import static com.github.tomakehurst.wiremock.client.WireMock.verify;
-import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.junit.Assert.assertThat;
-
-import java.util.List;
-
-import org.junit.Test;
-
import com.github.tomakehurst.wiremock.client.VerificationException;
import com.github.tomakehurst.wiremock.http.Fault;
import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
import com.github.tomakehurst.wiremock.verification.LoggedRequest;
+import org.junit.Test;
+
+import java.util.List;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
+import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
+import static org.hamcrest.Matchers.*;
+import static org.junit.Assert.assertThat;
public class Examples extends AcceptanceTestBase {
@@ -15,16 +15,12 @@
*/
package com.github.tomakehurst.wiremock;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.givenThat;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.junit.Assert.assertThat;
-
+import com.github.tomakehurst.wiremock.client.WireMock;
import org.junit.Test;
-import com.github.tomakehurst.wiremock.client.WireMock;
+import static com.github.tomakehurst.wiremock.client.WireMock.*;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.junit.Assert.assertThat;
public class GlobalSettingsAcceptanceTest extends AcceptanceTestBase {
@@ -15,16 +15,15 @@
*/
package com.github.tomakehurst.wiremock;
+import com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;
+import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
+import org.junit.Test;
+
import static com.github.tomakehurst.wiremock.testsupport.TestHttpHeader.withHeader;
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
-import org.junit.Test;
-
-import com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples;
-import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
-
public class HeaderMatchingAcceptanceTest extends AcceptanceTestBase {
@Test
@@ -13,8 +13,6 @@
import org.apache.http.client.methods.HttpGet;
import org.apache.http.util.EntityUtils;
import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
import org.junit.Test;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
@@ -19,9 +19,7 @@
import com.github.tomakehurst.wiremock.testsupport.WireMockResponse;
import org.junit.Test;
-import static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.MAPPING_REQUEST_FOR_BINARY_BYTE_BODY;
-import static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.MAPPING_REQUEST_FOR_BYTE_BODY;
-import static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.BINARY_COMPRESSED_CONTENT;
+import static com.github.tomakehurst.wiremock.testsupport.MappingJsonSamples.*;
import static java.net.HttpURLConnection.HTTP_NOT_FOUND;
import static junit.framework.Assert.assertNull;
import static org.hamcrest.Matchers.is;
Oops, something went wrong.

0 comments on commit 1116786

Please sign in to comment.