Ditch Google Truth from web/testutils 77/100877/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Apr 2022 18:11:34 +0000 (20:11 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Apr 2022 18:11:34 +0000 (20:11 +0200)
There are only two simple asserts there, use plain JUnit instead of
Google Truth. Also fixup the testing servlet.

Change-Id: Iea922ebe5c2d6888fb1116a28c9cab88c66eb6e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
web/testutils/pom.xml
web/testutils/src/test/java/org/opendaylight/aaa/web/testutils/test/WebTestModuleTest.java

index 13a091b930977d8ad91e2b048fd0825e6d1a5b49..df163a159324a5b0679c62176a4ec1807918cfa8 100644 (file)
       <groupId>org.opendaylight.infrautils</groupId>
       <artifactId>inject.guice</artifactId>
     </dependency>
-    <dependency>
-      <groupId>com.google.truth</groupId>
-      <artifactId>truth</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.infrautils</groupId>
       <artifactId>inject.guice.testutils</artifactId>
index c78e7ad77d4493ce20bc83ba31d716dcfac1015e..113320cf84196afa6708769900a86ca46c6bce4b 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.aaa.web.testutils.test;
 
-import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
@@ -46,13 +46,14 @@ public class WebTestModuleTest {
         webContextBuilder.addServlet(
                 ServletDetails.builder().addUrlPattern("/hello").name("Test").servlet(new TestServlet()).build());
         try (WebContextRegistration webContextRegistration = webServer.registerWebContext(webContextBuilder.build())) {
-            assertThat(webClient.request("GET", "test1/hello").body()).isEqualTo("hello, world");
-            assertThat(webClient.request("GET", "/test1/hello").body()).isEqualTo("hello, world");
+            assertEquals("hello, world", webClient.request("GET", "test1/hello").body());
+            assertEquals("hello, world", webClient.request("GET", "/test1/hello").body());
         }
     }
 
-    @SuppressWarnings("serial")
-    class TestServlet extends HttpServlet {
+    static class TestServlet extends HttpServlet {
+        private static final long serialVersionUID = 1L;
+
         @Override
         protected void doGet(final HttpServletRequest req, final HttpServletResponse response) throws IOException {
             response.getOutputStream().print("hello, world");