summaryrefslogtreecommitdiffstats
path: root/ms/neng
diff options
context:
space:
mode:
Diffstat (limited to 'ms/neng')
-rw-r--r--ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImplTest.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImplTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImplTest.java
index 4dc4fa7c..77ec7eeb 100644
--- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImplTest.java
+++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/PolicyFinderServiceImplTest.java
@@ -22,17 +22,7 @@
package org.onap.ccsdk.apps.ms.neng.service.extinf.impl;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.when;
-
import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
@@ -49,8 +39,18 @@ import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.HttpStatus;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
+
@RunWith(MockitoJUnitRunner.class)
public class PolicyFinderServiceImplTest {
@InjectMocks
@@ -78,6 +78,13 @@ public class PolicyFinderServiceImplTest {
}
@SuppressWarnings("unchecked")
+ @Test(expected = NengException.class)
+ public void testHandleError_NOT_FOUND() throws Exception{
+ HttpStatusCodeException e = new HttpClientErrorException(HttpStatus.NOT_FOUND,"",null,StandardCharsets.US_ASCII);
+ policyFinder.handleError(e);
+
+ }
+ @SuppressWarnings("unchecked")
@Test
public void testmakeOutboundCall() throws Exception {
Map<String, Object> configMap = buildPolicyResponse();