diff options
Diffstat (limited to 'container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java')
-rw-r--r-- | container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java b/container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java index 7fcca89b0d3..ca3c24113ff 100644 --- a/container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java +++ b/container-core/src/test/java/com/yahoo/container/jdisc/HttpRequestTestCase.java @@ -1,7 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.jdisc; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -10,10 +10,9 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.Collections; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.yahoo.jdisc.http.HttpRequest.Method; import com.yahoo.text.Utf8; @@ -28,74 +27,74 @@ public class HttpRequestTestCase { HttpRequest r; InputStream requestData; - @Before + @BeforeEach public void setUp() throws Exception { requestData = new ByteArrayInputStream(Utf8.toBytes(X_RAY_YANKEE_ZULU)); r = HttpRequest.createTestRequest(HTTP_MAILHOST_25_ALPHA_BRAVO_CHARLIE_DELTA, Method.GET, requestData, Collections.singletonMap("foxtrot", "golf")); } - @After + @AfterEach public void tearDown() throws Exception { r = null; } @Test - public final void testGetMethod() { + final void testGetMethod() { assertSame(Method.GET, r.getMethod()); } @Test - public final void testGetUri() throws URISyntaxException { + final void testGetUri() throws URISyntaxException { assertEquals(new URI(HTTP_MAILHOST_25_ALPHA_BRAVO_CHARLIE_DELTA), r.getUri()); } @Test - public final void testGetJDiscRequest() throws URISyntaxException { + final void testGetJDiscRequest() throws URISyntaxException { assertEquals(new URI(HTTP_MAILHOST_25_ALPHA_BRAVO_CHARLIE_DELTA), r.getJDiscRequest().getUri()); } @Test - public final void testGetProperty() { + final void testGetProperty() { assertEquals("charlie", r.getProperty("bravo")); assertEquals("golf", r.getProperty("foxtrot")); assertNull(r.getProperty("zulu")); } @Test - public final void testPropertyMap() { + final void testPropertyMap() { assertEquals(4, r.propertyMap().size()); } @Test - public final void testGetBooleanProperty() { + final void testGetBooleanProperty() { assertTrue(r.getBooleanProperty("trueboolean")); assertFalse(r.getBooleanProperty("falseboolean")); assertFalse(r.getBooleanProperty("bravo")); } @Test - public final void testHasProperty() { + final void testHasProperty() { assertFalse(r.hasProperty("alpha")); assertTrue(r.hasProperty("bravo")); } @Test - public final void testGetHeader() { + final void testGetHeader() { assertNull(r.getHeader("SyntheticHeaderFor-com.yahoo.container.jdisc.HttpRequestTestCase")); } @Test - public final void testGetHost() { + final void testGetHost() { assertEquals("mailhost", r.getHost()); } @Test - public final void testGetPort() { + final void testGetPort() { assertEquals(25, r.getPort()); } @Test - public final void testGetData() throws IOException { + final void testGetData() throws IOException { byte[] b = new byte[X_RAY_YANKEE_ZULU.length()]; r.getData().read(b); assertEquals(X_RAY_YANKEE_ZULU, Utf8.toString(b)); |