summaryrefslogtreecommitdiffstats
path: root/sliapi/springboot/src/test
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2020-02-27 14:54:42 -0500
committerDan Timoney <dtimoney@att.com>2020-02-27 15:00:10 -0500
commitc1c724e3d3db47b40db0a98670a2caa5ee2b2a9f (patch)
tree5fab7dfab304e96372549e247651233073d1a5cd /sliapi/springboot/src/test
parentec7aa8b8c9fbe23f7628eb61bea93c0136cff6c5 (diff)
Fixed junit testing
Fixed junit testing (was incorrectly mocking the class to be tested) Change-Id: I275a6aca53b9a14fb151b020d1b7287f3e234417 Issue-ID: CCSDK-2096 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'sliapi/springboot/src/test')
-rw-r--r--sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java b/sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java
index af55a5181..701cb3eb3 100644
--- a/sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java
+++ b/sliapi/springboot/src/test/java/org/onap/ccsdk/sli/core/sliapi/springboot/RestconfApiControllerTest.java
@@ -9,7 +9,6 @@ import org.onap.ccsdk.sli.core.sliapi.model.ExecutegraphinputInput;
import org.onap.ccsdk.sli.core.sliapi.model.ResponseFields;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
@@ -25,8 +24,6 @@ public class RestconfApiControllerTest {
@Autowired
private MockMvc mvc;
- @MockBean
- private RestconfApiController restconfApiController;
@Test
public void testHealthcheck() throws Exception {
@@ -82,8 +79,7 @@ public class RestconfApiControllerTest {
MvcResult mvcResult = mvc.perform(MockMvcRequestBuilders.post(url).contentType(MediaType.APPLICATION_JSON_VALUE).content(jsonString)).andReturn();
- // Note: this really should return 401 (and truly does), but mockito always returns a 200.
- assertEquals(200, mvcResult.getResponse().getStatus());
+ assertEquals(401, mvcResult.getResponse().getStatus());
}