This is an automated email from the ASF dual-hosted git repository.
krisden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new dd0c41e KNOX-1701 - Use hamcrest assertThat instead of junit
dd0c41e is described below
commit dd0c41e6be501a86af4a857e54a305eace1b3f11
Author: Kevin Risden <[email protected]>
AuthorDate: Thu Dec 20 11:04:31 2018 -0500
KNOX-1701 - Use hamcrest assertThat instead of junit
Signed-off-by: Kevin Risden <[email protected]>
---
.../knox/gateway/i18n/messages/MessagesTest.java | 2 +-
.../knox/gateway/i18n/resources/ResourcesTest.java | 2 +-
.../ha/provider/impl/HaDescriptorManagerTest.java | 2 +-
.../api/UrlRewriteRulesDescriptorFactoryTest.java | 2 +-
.../knox/gateway/GatewayGlobalConfigTest.java | 2 +-
.../gateway/descriptor/GatewayDescriptorTest.java | 2 +-
.../xml/XmlGatewayDescriptorExporterTest.java | 2 +-
.../xml/XmlGatewayDescriptorImporterTest.java | 2 +-
.../topology/DefaultTopologyServiceTest.java | 2 +-
.../builder/PropertyTopologyBuilderTest.java | 2 +-
.../simple/SimpleDescriptorHandlerTest.java | 2 +-
.../topology/validation/TopologyValidatorTest.java | 4 +-
.../topology/xml/TopologyRulesModuleTest.java | 11 +--
.../org/apache/knox/gateway/util/KnoxCLITest.java | 2 +-
.../knox/gateway/hbase/HBaseDispatchTest.java | 2 +-
.../knox/gateway/dispatch/DefaultDispatchTest.java | 2 +-
.../dispatch/HadoopAuthCookieStoreTest.java | 2 +-
.../PassAllHeadersNoEncodingDispatchTest.java | 2 +-
.../gateway/dispatch/URLDecodingDispatchTest.java | 4 +-
.../org/apache/knox/gateway/GatewayTestDriver.java | 7 +-
.../knox/gateway/GatewayAdminTopologyFuncTest.java | 5 +-
.../apache/knox/gateway/GatewayAppFuncTest.java | 5 +-
.../apache/knox/gateway/GatewayBasicFuncTest.java | 104 +++++++++------------
.../apache/knox/gateway/GatewayDeployFuncTest.java | 5 +-
.../knox/gateway/GatewayLocalServiceFuncTest.java | 5 +-
.../apache/knox/gateway/GatewayMultiFuncTest.java | 5 +-
.../apache/knox/gateway/GatewaySslFuncTest.java | 5 +-
.../knox/gateway/KnoxCliLdapFuncTestNegative.java | 2 +-
.../knox/gateway/KnoxCliLdapFuncTestPositive.java | 2 +-
.../apache/knox/gateway/KnoxCliSysBindTest.java | 2 +-
.../apache/knox/gateway/util/HttpUtilsTest.java | 2 +-
.../gateway/util/urltemplate/ExpanderTest.java | 2 +-
.../knox/gateway/util/urltemplate/MatcherTest.java | 2 +-
.../knox/gateway/util/urltemplate/ParserTest.java | 2 +-
.../gateway/util/urltemplate/RewriterTest.java | 2 +-
.../knox/gateway/util/urltemplate/SegmentTest.java | 2 +-
.../gateway/util/urltemplate/TemplateTest.java | 2 +-
37 files changed, 89 insertions(+), 123 deletions(-)
diff --git
a/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/messages/MessagesTest.java
b/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/messages/MessagesTest.java
index bf14cd2..07447fb 100644
---
a/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/messages/MessagesTest.java
+++
b/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/messages/MessagesTest.java
@@ -27,7 +27,7 @@ import org.junit.experimental.categories.Category;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class MessagesTest {
diff --git
a/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/resources/ResourcesTest.java
b/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/resources/ResourcesTest.java
index 585b903..175f172 100644
---
a/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/resources/ResourcesTest.java
+++
b/gateway-i18n/src/test/java/org/apache/knox/gateway/i18n/resources/ResourcesTest.java
@@ -27,7 +27,7 @@ import org.junit.experimental.categories.Category;
import java.util.Locale;
import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class ResourcesTest {
diff --git
a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/HaDescriptorManagerTest.java
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/HaDescriptorManagerTest.java
index 18c3f3a..f64017d 100644
---
a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/HaDescriptorManagerTest.java
+++
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/provider/impl/HaDescriptorManagerTest.java
@@ -26,10 +26,10 @@ import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.xmlmatchers.XmlMatchers.hasXPath;
import static org.xmlmatchers.transform.XmlConverters.the;
diff --git
a/gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/api/UrlRewriteRulesDescriptorFactoryTest.java
b/gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/api/UrlRewriteRulesDescriptorFactoryTest.java
index c8669d0..ce355c0 100644
---
a/gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/api/UrlRewriteRulesDescriptorFactoryTest.java
+++
b/gateway-provider-rewrite/src/test/java/org/apache/knox/gateway/filter/rewrite/api/UrlRewriteRulesDescriptorFactoryTest.java
@@ -40,9 +40,9 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.sameInstance;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.xmlmatchers.XmlMatchers.hasXPath;
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayGlobalConfigTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayGlobalConfigTest.java
index 4bc2d73..5c922e9 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/GatewayGlobalConfigTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/GatewayGlobalConfigTest.java
@@ -28,9 +28,9 @@ import java.net.URL;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class GatewayGlobalConfigTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/GatewayDescriptorTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/GatewayDescriptorTest.java
index 0baf977..41ddb08 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/GatewayDescriptorTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/GatewayDescriptorTest.java
@@ -22,9 +22,9 @@ import org.junit.Test;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class GatewayDescriptorTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorExporterTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorExporterTest.java
index 0ed0206..fad4fbc 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorExporterTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorExporterTest.java
@@ -33,9 +33,9 @@ import java.io.StringReader;
import java.io.Writer;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.xml.HasXPath.hasXPath;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class XmlGatewayDescriptorExporterTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorImporterTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorImporterTest.java
index f4dd758..16110f3 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorImporterTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/descriptor/xml/XmlGatewayDescriptorImporterTest.java
@@ -32,9 +32,9 @@ import java.io.Reader;
import java.io.StringReader;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class XmlGatewayDescriptorImporterTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
index c0b861e..61bce5d 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/services/topology/DefaultTopologyServiceTest.java
@@ -50,13 +50,13 @@ import java.util.Set;
import static org.easymock.EasyMock.anyObject;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class DefaultTopologyServiceTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/builder/PropertyTopologyBuilderTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/builder/PropertyTopologyBuilderTest.java
index 8896dc3..3f09214 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/builder/PropertyTopologyBuilderTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/builder/PropertyTopologyBuilderTest.java
@@ -26,9 +26,9 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
public class PropertyTopologyBuilderTest {
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandlerTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandlerTest.java
index db422e2..62c6e61 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandlerTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandlerTest.java
@@ -50,13 +50,13 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasXPath;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/validation/TopologyValidatorTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/validation/TopologyValidatorTest.java
index 676c6d6..299027f 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/validation/TopologyValidatorTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/validation/TopologyValidatorTest.java
@@ -21,8 +21,8 @@ import java.net.URL;
import org.apache.knox.test.TestUtils;
import org.junit.Test;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
public class TopologyValidatorTest {
@@ -42,7 +42,5 @@ public class TopologyValidatorTest {
url = TestUtils.getResourceUrl( TopologyValidatorTest.class,
"topology-valid-with-name.xml" );
validator = new TopologyValidator( url );
assertThat( validator.getErrorString(), validator.validateTopology(), is(
true ) );
-
}
-
}
\ No newline at end of file
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java
index 89e64c8..c6447e5 100644
---
a/gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java
+++
b/gateway-server/src/test/java/org/apache/knox/gateway/topology/xml/TopologyRulesModuleTest.java
@@ -27,7 +27,6 @@ import org.apache.knox.gateway.topology.Topology;
import org.apache.knox.gateway.topology.Version;
import org.apache.knox.gateway.topology.builder.TopologyBuilder;
import org.apache.knox.test.TestUtils;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.xml.sax.SAXException;
@@ -39,27 +38,22 @@ import java.net.URL;
import java.util.Collection;
import static org.apache.commons.digester3.binder.DigesterLoader.newLoader;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsMapContaining.hasEntry;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
public class TopologyRulesModuleTest {
-
private static DigesterLoader loader;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
loader = newLoader( new KnoxFormatXmlTopologyRules(), new
AmbariFormatXmlTopologyRules() );
}
- @After
- public void tearDown() throws Exception {
- }
-
@Test
public void testParseSimpleTopologyXmlInKnoxFormat() throws IOException,
SAXException, URISyntaxException {
Digester digester = loader.newDigester();
@@ -284,5 +278,4 @@ public class TopologyRulesModuleTest {
assertThat( dispatch.getHttpClientFactory(), is("testHttpClientFactory") );
assertThat( dispatch.getUseTwoWaySsl(), is(true) );
}
-
}
diff --git
a/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
b/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
index f94e979..ce28245 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/util/KnoxCLITest.java
@@ -45,11 +45,11 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
/**
diff --git
a/gateway-service-hbase/src/test/java/org/apache/knox/gateway/hbase/HBaseDispatchTest.java
b/gateway-service-hbase/src/test/java/org/apache/knox/gateway/hbase/HBaseDispatchTest.java
index 822d053..0345fc9 100644
---
a/gateway-service-hbase/src/test/java/org/apache/knox/gateway/hbase/HBaseDispatchTest.java
+++
b/gateway-service-hbase/src/test/java/org/apache/knox/gateway/hbase/HBaseDispatchTest.java
@@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletRequest;
import java.net.URI;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class HBaseDispatchTest {
diff --git
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
index a211232..e755f97 100644
---
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
+++
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
@@ -18,6 +18,7 @@
package org.apache.knox.gateway.dispatch;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.instanceOf;
@@ -25,7 +26,6 @@ import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import java.io.IOException;
diff --git
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/HadoopAuthCookieStoreTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/HadoopAuthCookieStoreTest.java
index 909bb05..a711be5 100644
---
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/HadoopAuthCookieStoreTest.java
+++
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/HadoopAuthCookieStoreTest.java
@@ -30,9 +30,9 @@ import java.nio.file.Files;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class HadoopAuthCookieStoreTest {
diff --git
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/PassAllHeadersNoEncodingDispatchTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/PassAllHeadersNoEncodingDispatchTest.java
index 186883c..6ca1800 100644
---
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/PassAllHeadersNoEncodingDispatchTest.java
+++
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/PassAllHeadersNoEncodingDispatchTest.java
@@ -18,7 +18,7 @@
package org.apache.knox.gateway.dispatch;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
import java.net.URI;
import javax.servlet.http.HttpServletRequest;
diff --git
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/URLDecodingDispatchTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/URLDecodingDispatchTest.java
index 2423715..ad589c2 100644
---
a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/URLDecodingDispatchTest.java
+++
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/URLDecodingDispatchTest.java
@@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import java.net.URI;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
/**
* Test NoURLEncodingDispatch dispatch.
@@ -32,7 +32,6 @@ import static org.junit.Assert.assertThat;
* @since 1.1.0
*/
public class URLDecodingDispatchTest {
-
HttpServletRequest request;
Dispatch dispatch = new URLDecodingDispatch();
@@ -59,5 +58,4 @@ public class URLDecodingDispatchTest {
assertThat(uri.toASCIIString(),
is("https://localhost:8443/gateway/sandbox/datanode/datanode.html?host=http://localhost:9864"));
}
-
}
diff --git
a/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestDriver.java
b/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestDriver.java
index f55ace2..4ee6a74 100644
---
a/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestDriver.java
+++
b/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestDriver.java
@@ -17,7 +17,7 @@
*/
package org.apache.knox.gateway;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;
import java.io.File;
@@ -46,7 +46,6 @@ import
org.apache.knox.gateway.services.DefaultGatewayServices;
import org.apache.knox.gateway.services.ServiceLifecycleException;
import org.apache.knox.test.mock.MockServer;
import org.hamcrest.CoreMatchers;
-import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -164,7 +163,7 @@ public class GatewayTestDriver {
public void start() throws Exception {
gateway = GatewayServer.startGateway( config, srvcs );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
CoreMatchers.notNullValue() );
+ assertThat( "Failed to start gateway.", gateway,
CoreMatchers.notNullValue() );
log.info( "Gateway port = " + gateway.getAddresses()[ 0 ].getPort() );
}
@@ -351,6 +350,4 @@ public class GatewayTestDriver {
service.server.reset();
}
}
-
-
}
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAdminTopologyFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAdminTopologyFuncTest.java
index dcc1701..375ca68 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAdminTopologyFuncTest.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAdminTopologyFuncTest.java
@@ -51,7 +51,6 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.knox.test.TestUtils;
import org.apache.http.HttpStatus;
-import org.hamcrest.MatcherAssert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -70,12 +69,12 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.xml.HasXPath.hasXPath;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
public class GatewayAdminTopologyFuncTest {
@@ -140,7 +139,7 @@ public class GatewayAdminTopologyFuncTest {
e.printStackTrace(); // I18N not required.
}
gateway = GatewayServer.startGateway( testConfig, srvcs );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
LOG.info( "Gateway port = " + gateway.getAddresses()[ 0 ].getPort() );
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAppFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAppFuncTest.java
index a8b3684..0a378d2 100644
--- a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAppFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayAppFuncTest.java
@@ -33,7 +33,6 @@ import
org.apache.knox.gateway.services.topology.TopologyService;
import org.apache.knox.test.TestUtils;
import org.apache.knox.test.mock.MockServer;
import org.apache.http.HttpStatus;
-import org.hamcrest.MatcherAssert;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -46,11 +45,11 @@ import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.hasItemInArray;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertThat;
import static org.xmlmatchers.transform.XmlConverters.the;
import static org.xmlmatchers.xpath.HasXPath.hasXPath;
import static uk.co.datumedge.hamcrest.json.SameJSONAs.sameJSONAs;
@@ -140,7 +139,7 @@ public class GatewayAppFuncTest {
topos = services.getService(GatewayServices.TOPOLOGY_SERVICE);
gateway = GatewayServer.startGateway( config, services );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
gatewayPort = gateway.getAddresses()[0].getPort();
gatewayUrl = "http://localhost:" + gatewayPort + "/" +
config.getGatewayPath();
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayBasicFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayBasicFuncTest.java
index 753578c..f77cee6 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayBasicFuncTest.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayBasicFuncTest.java
@@ -57,7 +57,6 @@ import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import org.hamcrest.CoreMatchers;
import org.hamcrest.Matcher;
-import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.AfterClass;
@@ -96,10 +95,10 @@ import static org.hamcrest.CoreMatchers.either;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.startsWith;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.text.IsEmptyString.isEmptyString;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.xmlmatchers.XmlMatchers.isEquivalentTo;
import static org.xmlmatchers.transform.XmlConverters.the;
@@ -359,13 +358,13 @@ public class GatewayBasicFuncTest {
//System.out.println( location );
log.debug( "Redirect location: " + response.getHeader( "Location" ) );
if( driver.isUseGateway() ) {
- MatcherAssert.assertThat( location, anyOf(
+ assertThat( location, anyOf(
startsWith( "http://" + gatewayHostName + ":" +
gatewayAddress.getPort() + "/" ),
startsWith( "http://" + gatewayAddrName + ":" +
gatewayAddress.getPort() + "/" ) ) );
- MatcherAssert.assertThat( location, containsString( "?_=" ) );
+ assertThat( location, containsString( "?_=" ) );
}
- MatcherAssert.assertThat(location, not(containsString("host=")));
- MatcherAssert.assertThat(location, not(containsString("port=")));
+ assertThat(location, not(containsString("host=")));
+ assertThat(location, not(containsString("port=")));
LOG_EXIT();
}
@@ -400,7 +399,7 @@ public class GatewayBasicFuncTest {
//System.out.println( location );
log.debug( "Redirect location: " + response.getHeader( "Location" ) );
if( driver.isUseGateway() ) {
- MatcherAssert.assertThat( location,
containsString("/dir/file%E3%83%AC%E3%83%9D%E3%83%BC") );
+ assertThat( location,
containsString("/dir/file%E3%83%AC%E3%83%9D%E3%83%BC") );
}
LOG_EXIT();
}
@@ -645,13 +644,13 @@ public class GatewayBasicFuncTest {
String location = response.getHeader( "Location" );
log.debug( "Redirect location: " + response.getHeader( "Location" ) );
if( driver.isUseGateway() ) {
- MatcherAssert.assertThat( location, anyOf(
+ assertThat( location, anyOf(
startsWith( "http://" + gatewayHostName + ":" +
gatewayAddress.getPort() + "/" ),
startsWith( "http://" + gatewayAddrName + ":" +
gatewayAddress.getPort() + "/" ) ) );
- MatcherAssert.assertThat( location, containsString( "?_=" ) );
+ assertThat( location, containsString( "?_=" ) );
}
- MatcherAssert.assertThat( location, not( containsString( "host=" ) ) );
- MatcherAssert.assertThat( location, not( containsString( "port=" ) ) );
+ assertThat( location, not( containsString( "host=" ) ) );
+ assertThat( location, not( containsString( "port=" ) ) );
response = given()
//.log().all()
.auth().preemptive().basic( username, password )
@@ -665,7 +664,7 @@ public class GatewayBasicFuncTest {
location = response.getHeader( "Location" );
log.debug( "Created location: " + location );
if( driver.isUseGateway() ) {
- MatcherAssert.assertThat( location, anyOf(
+ assertThat( location, anyOf(
startsWith( "http://" + gatewayHostName + ":" +
gatewayAddress.getPort() + "/" ),
startsWith( "http://" + gatewayAddrName + ":" +
gatewayAddress.getPort() + "/" ) ) );
}
@@ -1048,7 +1047,7 @@ public class GatewayBasicFuncTest {
}
}
//System.out.println( "Status is " + status + " after " +
((System.currentTimeMillis()-start)/1000) + " seconds." );
- MatcherAssert.assertThat( status, is( success ) );
+ assertThat( status, is( success ) );
if( CLEANUP_TEST ) {
// Cleanup anything that might have been leftover because the test
failed previously.
@@ -1484,8 +1483,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.XML )
.when().get( driver.getUrl( "WEBHBASE" ) );
- MatcherAssert
- .assertThat(
+ assertThat(
the( response.getBody().asString() ),
isEquivalentTo( the( driver.getResourceString( resourceName +
".xml" ) ) ) );
driver.assertComplete();
@@ -1509,8 +1507,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.JSON )
.when().get( driver.getUrl( "WEBHBASE" ) );
- MatcherAssert
- .assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
+ assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
driver.assertComplete();
driver.getMock( "WEBHBASE" )
@@ -1634,8 +1631,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.XML )
.when().get( driver.getUrl( "WEBHBASE" ) + path );
- MatcherAssert
- .assertThat(
+ assertThat(
the(response.getBody().asString()),
isEquivalentTo(the(driver.getResourceString(resourceName +
".xml"))));
driver.assertComplete();
@@ -1659,8 +1655,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.JSON )
.when().get( driver.getUrl( "WEBHBASE" ) + path );
- MatcherAssert
- .assertThat(response.getBody().asString(),
sameJSONAs(driver.getResourceString(resourceName + ".json")));
+ assertThat(response.getBody().asString(),
sameJSONAs(driver.getResourceString(resourceName + ".json")));
driver.assertComplete();
driver.getMock( "WEBHBASE" )
@@ -1922,8 +1917,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.XML )
.when().get( driver.getUrl( "WEBHBASE" ) + allRowsPath );
- MatcherAssert
- .assertThat(
+ assertThat(
the(response.getBody().asString()),
isEquivalentTo(the(driver.getResourceString(resourceName + ".xml"))));
driver.assertComplete();
@@ -1947,8 +1941,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.XML )
.when().get( driver.getUrl( "WEBHBASE" ) + rowsStartsWithPath );
- MatcherAssert
- .assertThat(
+ assertThat(
the(response.getBody().asString()),
isEquivalentTo(the(driver.getResourceString(resourceName + ".xml"))));
driver.assertComplete();
@@ -1972,8 +1965,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.JSON )
.when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyPath );
- MatcherAssert
- .assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
+ assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
driver.assertComplete();
driver.getMock( "WEBHBASE" )
@@ -1995,8 +1987,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.JSON )
.when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyAndColumnPath );
- MatcherAssert
- .assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
+ assertThat( response.getBody().asString(), sameJSONAs(
driver.getResourceString( resourceName + ".json") ) );
driver.assertComplete();
LOG_EXIT();
}
@@ -2052,8 +2043,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.XML )
.when().get( driver.getUrl( "WEBHBASE" ) + scannerPath + "/" + scannerId );
- MatcherAssert
- .assertThat(
+ assertThat(
the(response.getBody().asString()),
isEquivalentTo(the(driver.getResourceString(tableDataResourceName +
".xml"))));
driver.assertComplete();
@@ -2450,12 +2440,11 @@ public class GatewayBasicFuncTest {
switch( contentType ) {
case JSON:
- MatcherAssert.assertThat( response.getBody().asString(),
+ assertThat( response.getBody().asString(),
sameJSONAs( driver.getResourceString( resource ) ) );
break;
case XML:
- MatcherAssert
- .assertThat( the( response.getBody().asString() ),
+ assertThat( the( response.getBody().asString() ),
isEquivalentTo( the( driver.getResourceString( resource ) ) ) );
break;
default:
@@ -2807,12 +2796,11 @@ public class GatewayBasicFuncTest {
if ( contentMatchers == null || contentMatchers.isEmpty() ) {
switch( contentType ) {
case JSON:
- MatcherAssert.assertThat( response.getBody().asString(),
+ assertThat( response.getBody().asString(),
sameJSONAs( driver.getResourceString( resource ) ) );
break;
case XML:
- MatcherAssert
- .assertThat( the( response.getBody().asString() ),
+ assertThat( the( response.getBody().asString() ),
isEquivalentTo(the(driver.getResourceString(resource))) );
break;
default:
@@ -3057,7 +3045,7 @@ public class GatewayBasicFuncTest {
.statusCode(HttpStatus.SC_OK)
.when().get( gatewayPath );
- MatcherAssert.assertThat(response.getBody().asString(),
+ assertThat(response.getBody().asString(),
sameJSONAs(driver.getResourceString(resourceName)));
driver.assertComplete();
LOG_EXIT();
@@ -3119,12 +3107,11 @@ public class GatewayBasicFuncTest {
switch( contentType ) {
case JSON:
- MatcherAssert.assertThat( response.getBody().asString(),
+ assertThat( response.getBody().asString(),
sameJSONAs( driver.getResourceString( resourceName ) ) );
break;
case XML:
- MatcherAssert
- .assertThat( the( response.getBody().asString() ),
+ assertThat( the( response.getBody().asString() ),
isEquivalentTo( the( driver.getResourceString( resourceName )
) ) );
break;
default:
@@ -3185,12 +3172,11 @@ public class GatewayBasicFuncTest {
switch( contentType ) {
case JSON:
- MatcherAssert.assertThat( response.getBody().asString(),
+ assertThat( response.getBody().asString(),
sameJSONAs( driver.getResourceString( responseResource ) ) );
break;
case XML:
- MatcherAssert
- .assertThat( the( response.getBody().asString() ),
+ assertThat( the( response.getBody().asString() ),
isEquivalentTo( the( driver.getResourceString(
responseResource ) ) ) );
break;
default:
@@ -3248,10 +3234,10 @@ public class GatewayBasicFuncTest {
.when().get( gatewayPath );
String link =
response.getBody().jsonPath().getString("spouts[0].errorWorkerLogLink");
- MatcherAssert.assertThat(link, anyOf(
+ assertThat(link, anyOf(
startsWith("http://" + gatewayHostName + ":" +
gatewayAddress.getPort() + "/"),
startsWith("http://" + gatewayAddrName + ":" +
gatewayAddress.getPort() + "/")));
- MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
+ assertThat( link, containsString("/storm/logviewer") );
driver.assertComplete();
@@ -3280,10 +3266,10 @@ public class GatewayBasicFuncTest {
link =
response.getBody().jsonPath().getString("executorStats[0].workerLogLink");
- MatcherAssert.assertThat(link, anyOf(
+ assertThat(link, anyOf(
startsWith("http://" + gatewayHostName + ":" +
gatewayAddress.getPort() + "/"),
startsWith("http://" + gatewayAddrName + ":" +
gatewayAddress.getPort() + "/")));
- MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
+ assertThat( link, containsString("/storm/logviewer") );
driver.assertComplete();
@@ -3327,7 +3313,7 @@ public class GatewayBasicFuncTest {
.contentType( ContentType.JSON.toString() )
.when().get( gatewayPath );
- MatcherAssert.assertThat(response.getBody().asString(),
+ assertThat(response.getBody().asString(),
sameJSONAs(driver.getResourceString(resourceName)));
driver.assertComplete();
}
@@ -3402,10 +3388,10 @@ public class GatewayBasicFuncTest {
.when().get( gatewayPath );
String link =
response.getBody().jsonPath().getString("spouts[0].errorWorkerLogLink");
- MatcherAssert.assertThat(link, anyOf(
+ assertThat(link, anyOf(
startsWith("http://" + gatewayHostName + ":" + gatewayPort + "/"),
startsWith("http://" + gatewayAddrName + ":" + gatewayPort + "/")));
- MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
+ assertThat( link, containsString("/storm/logviewer") );
driver.assertComplete();
LOG_EXIT();
}
@@ -3459,9 +3445,9 @@ public class GatewayBasicFuncTest {
.when().get(gatewayPath);
String link =
response.getBody().jsonPath().getString("spouts[0].errorWorkerLogLink");
- MatcherAssert.assertThat(link, is(
+ assertThat(link, is(
startsWith(scheme + "://" + host + ":" + port + "/")));
- MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
+ assertThat( link, containsString("/storm/logviewer") );
driver.assertComplete();
@@ -3501,9 +3487,9 @@ public class GatewayBasicFuncTest {
link =
response.getBody().jsonPath().getString("executorStats[0].workerLogLink");
- MatcherAssert.assertThat(link, is(
+ assertThat(link, is(
startsWith(scheme + "://" + host + ":" + port + "/")));
- MatcherAssert.assertThat( link, containsString("/storm/logviewer") );
+ assertThat( link, containsString("/storm/logviewer") );
driver.assertComplete();
//Test header rewrite using webhdfs
@@ -3543,11 +3529,11 @@ public class GatewayBasicFuncTest {
//System.out.println( location );
log.debug( "Redirect location: " + response.getHeader( "Location" ) );
if( driver.isUseGateway() ) {
- MatcherAssert.assertThat( location, is(startsWith(scheme + "://" + host
+ ":" + port + "/")));
- MatcherAssert.assertThat( location, containsString( "?_=" ) );
+ assertThat( location, is(startsWith(scheme + "://" + host + ":" + port +
"/")));
+ assertThat( location, containsString( "?_=" ) );
}
- MatcherAssert.assertThat(location, not(containsString("host=")));
- MatcherAssert.assertThat(location, not(containsString("port=")));
+ assertThat(location, not(containsString("host=")));
+ assertThat(location, not(containsString("port=")));
LOG_EXIT();
}
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayDeployFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayDeployFuncTest.java
index 0aa8b3a..50eac3c 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayDeployFuncTest.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayDeployFuncTest.java
@@ -27,7 +27,6 @@ import
org.apache.knox.gateway.services.ServiceLifecycleException;
import org.apache.knox.test.TestUtils;
import org.apache.knox.test.category.ReleaseTest;
import org.apache.http.HttpStatus;
-import org.hamcrest.MatcherAssert;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -53,8 +52,8 @@ import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
-import static org.junit.Assert.assertThat;
@Category(ReleaseTest.class)
public class GatewayDeployFuncTest {
@@ -109,7 +108,7 @@ public class GatewayDeployFuncTest {
e.printStackTrace(); // I18N not required.
}
gateway = GatewayServer.startGateway( testConfig, srvcs );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
LOG.info( "Gateway port = " + gateway.getAddresses()[ 0 ].getPort() );
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayLocalServiceFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayLocalServiceFuncTest.java
index 56c0cdf..4880970 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayLocalServiceFuncTest.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayLocalServiceFuncTest.java
@@ -27,7 +27,6 @@ import org.apache.knox.test.TestUtils;
import org.apache.knox.test.log.NoOpAppender;
import org.apache.http.HttpStatus;
import org.apache.log4j.Appender;
-import org.hamcrest.MatcherAssert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -47,7 +46,7 @@ import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
public class GatewayLocalServiceFuncTest {
private static final Logger LOG = LoggerFactory.getLogger(
GatewayTestDriver.class );
@@ -109,7 +108,7 @@ public class GatewayLocalServiceFuncTest {
e.printStackTrace(); // I18N not required.
}
gateway = GatewayServer.startGateway( testConfig, srvcs );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
LOG.info( "Gateway port = " + gateway.getAddresses()[ 0 ].getPort() );
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayMultiFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayMultiFuncTest.java
index 40d3458..f6cc68b 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewayMultiFuncTest.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewayMultiFuncTest.java
@@ -40,7 +40,6 @@ import
org.apache.knox.gateway.services.topology.TopologyService;
import org.apache.knox.test.TestUtils;
import org.apache.knox.test.category.ReleaseTest;
import org.apache.knox.test.mock.MockServer;
-import org.hamcrest.MatcherAssert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -62,8 +61,8 @@ import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
import static org.xmlmatchers.XmlMatchers.hasXPath;
import static org.xmlmatchers.transform.XmlConverters.the;
@@ -138,7 +137,7 @@ public class GatewayMultiFuncTest {
topos = services.getService(GatewayServices.TOPOLOGY_SERVICE);
gateway = GatewayServer.startGateway( config, services );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
gatewayPort = gateway.getAddresses()[0].getPort();
gatewayUrl = "http://localhost:" + gatewayPort + "/" +
config.getGatewayPath();
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/GatewaySslFuncTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/GatewaySslFuncTest.java
index 93864ee..8879fcc 100644
--- a/gateway-test/src/test/java/org/apache/knox/gateway/GatewaySslFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/knox/gateway/GatewaySslFuncTest.java
@@ -61,7 +61,6 @@ import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
-import org.hamcrest.MatcherAssert;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -73,7 +72,7 @@ import org.slf4j.LoggerFactory;
import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.fail;
import static org.xmlmatchers.transform.XmlConverters.the;
import static org.xmlmatchers.xpath.HasXPath.hasXPath;
@@ -169,7 +168,7 @@ public class GatewaySslFuncTest {
topos = services.getService(GatewayServices.TOPOLOGY_SERVICE);
gateway = GatewayServer.startGateway( config, services );
- MatcherAssert.assertThat( "Failed to start gateway.", gateway,
notNullValue() );
+ assertThat( "Failed to start gateway.", gateway, notNullValue() );
gatewayScheme = config.isSSLEnabled() ? "https" : "http";
gatewayPort = gateway.getAddresses()[0].getPort();
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestNegative.java
b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestNegative.java
index 03c7c1e..9e365a0 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestNegative.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestNegative.java
@@ -43,8 +43,8 @@ import java.util.UUID;
import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
public class KnoxCliLdapFuncTestNegative {
public static GatewayTestConfig config;
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestPositive.java
b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestPositive.java
index e45938b..d0fe3c5 100644
---
a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestPositive.java
+++
b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliLdapFuncTestPositive.java
@@ -44,7 +44,7 @@ import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
public class KnoxCliLdapFuncTestPositive {
public static GatewayTestConfig config;
diff --git
a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliSysBindTest.java
b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliSysBindTest.java
index 183fef5..b5cf125 100644
--- a/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliSysBindTest.java
+++ b/gateway-test/src/test/java/org/apache/knox/gateway/KnoxCliSysBindTest.java
@@ -43,7 +43,7 @@ import java.util.UUID;
import static org.apache.knox.test.TestUtils.LOG_ENTER;
import static org.apache.knox.test.TestUtils.LOG_EXIT;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
public class KnoxCliSysBindTest {
public static GatewayTestConfig config;
diff --git
a/gateway-util-common/src/test/java/org/apache/knox/gateway/util/HttpUtilsTest.java
b/gateway-util-common/src/test/java/org/apache/knox/gateway/util/HttpUtilsTest.java
index ad09ffa..13b92c3 100644
---
a/gateway-util-common/src/test/java/org/apache/knox/gateway/util/HttpUtilsTest.java
+++
b/gateway-util-common/src/test/java/org/apache/knox/gateway/util/HttpUtilsTest.java
@@ -25,8 +25,8 @@ import java.util.List;
import java.util.Map;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertThat;
public class HttpUtilsTest {
@Test
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
index 4c27b4b..0655235 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ExpanderTest.java
@@ -30,10 +30,10 @@ import java.util.List;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalToIgnoringCase;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
@Category( { UnitTests.class, FastTests.class } )
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
index b09f04b..d34646e 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/MatcherTest.java
@@ -32,9 +32,9 @@ import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.sameInstance;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsCollectionContaining.hasItem;
import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
//TODO: Test to make sure that extra unmatched query parameters prevent a
match.
@Category( { UnitTests.class, FastTests.class } )
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
index 9f4e417..a89b0c0 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/ParserTest.java
@@ -28,7 +28,7 @@ import java.util.Iterator;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class ParserTest {
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
index 9ac2140..e84edcd 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/RewriterTest.java
@@ -42,8 +42,8 @@ import java.io.UnsupportedEncodingException;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class RewriterTest {
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
index fc0e79e..4794e1a 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/SegmentTest.java
@@ -24,7 +24,7 @@ import org.junit.experimental.categories.Category;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class SegmentTest {
diff --git
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
index 20643e8..24ea64e 100644
---
a/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
+++
b/gateway-util-urltemplate/src/test/java/org/apache/knox/gateway/util/urltemplate/TemplateTest.java
@@ -27,8 +27,8 @@ import java.net.URISyntaxException;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
-import static org.junit.Assert.assertThat;
@Category( { UnitTests.class, FastTests.class } )
public class TemplateTest {