diff options
author | 2024-06-18 10:39:27 +0100 | |
---|---|---|
committer | 2024-06-18 10:45:14 +0100 | |
commit | c7d878cb8b0cf3146646674ad4bd6cabe6716f46 (patch) | |
tree | 427e29277cb2e77d5a63ae05bda5c7da163812e3 /examples/examples-onap-bbs/src/test/java/org/onap | |
parent | e9b746340711ddfccee7ac0f669ace626b1b3d46 (diff) |
Convert junit4 to junit5
- examples module
Issue-ID: POLICY-5041
Change-Id: Ia46a6590149571d31dde918e1ea77753ab330f90
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'examples/examples-onap-bbs/src/test/java/org/onap')
-rw-r--r-- | examples/examples-onap-bbs/src/test/java/org/onap/policy/apex/examples/bbs/WebClientTest.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/examples/examples-onap-bbs/src/test/java/org/onap/policy/apex/examples/bbs/WebClientTest.java b/examples/examples-onap-bbs/src/test/java/org/onap/policy/apex/examples/bbs/WebClientTest.java index 1f52e1115..a87bddaf0 100644 --- a/examples/examples-onap-bbs/src/test/java/org/onap/policy/apex/examples/bbs/WebClientTest.java +++ b/examples/examples-onap-bbs/src/test/java/org/onap/policy/apex/examples/bbs/WebClientTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 huawei. All rights reserved. - * Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation. + * Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ package org.onap.policy.apex.examples.bbs; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -29,12 +29,11 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import javax.net.ssl.HttpsURLConnection; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; -// TODO javax libraries used here too. Ok, to keep? Liam's review ignored these. -public class WebClientTest { +class WebClientTest { HttpsURLConnection mockedHttpsUrlConnection; String sampleString = "Response Code :200"; @@ -44,8 +43,8 @@ public class WebClientTest { * * @throws IOException on I/O errors */ - @Before - public void setupMockedRest() throws IOException { + @BeforeEach + void setupMockedRest() throws IOException { mockedHttpsUrlConnection = mock(HttpsURLConnection.class); InputStream inputStream = new ByteArrayInputStream(sampleString.getBytes()); when(mockedHttpsUrlConnection.getInputStream()).thenReturn(inputStream); @@ -53,7 +52,7 @@ public class WebClientTest { } @Test - public void testHttpsRequest() { + void testHttpsRequest() { WebClient cl = new WebClient(); String result = cl .httpRequest("https://some.random.url/data", "POST", null, "admin", "admin", "application/json"); @@ -61,7 +60,7 @@ public class WebClientTest { } @Test - public void testHttpRequest() { + void testHttpRequest() { WebClient cl = new WebClient(); String result = cl .httpRequest("http://some.random.url/data", "GET", null, "admin", "admin", "application/json"); @@ -69,7 +68,7 @@ public class WebClientTest { } @Test - public void testToPrettyString() { + void testToPrettyString() { String xmlSample = "<input xmlns=\"org:onap:sdnc:northbound:generic-resource\">" + "<sdnc-request-header> <svc-action>update</svc-action> </sdnc-request-header></input>"; WebClient cl = new WebClient(); |