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;
@Autowired
private MockMvc mvc;
- @MockBean
- private RestconfApiController restconfApiController;
@Test
public void testHealthcheck() throws Exception {
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());
}