Java 17 Upgrade
[policy/models.git] / models-interactions / model-simulators / src / test / java / org / onap / policy / simulators / VfcSimulatorTest.java
index d68e9dc..a290f56 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * simulators
  * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,8 +21,8 @@
 
 package org.onap.policy.simulators;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.HashMap;
@@ -43,7 +43,8 @@ public class VfcSimulatorTest {
     @BeforeClass
     public static void setUpSimulator() {
         try {
-            Util.buildVfcSim();
+            var testServer = Util.buildVfcSim();
+            assertNotNull(testServer);
         } catch (final Exception e) {
             fail(e.getMessage());
         }
@@ -58,9 +59,9 @@ public class VfcSimulatorTest {
     public void testPost() {
         final Pair<Integer, String> httpDetails =
                 new RestManager().post("http://localhost:6668/api/nslcm/v1/ns/1234567890/heal", "username", "password",
-                        new HashMap<String, String>(), "application/json", "Some Request Here");
+                    new HashMap<>(), "application/json", "Some Request Here");
         assertNotNull(httpDetails);
-        assertTrue(httpDetails.getLeft() == 202);
+        assertEquals(202, httpDetails.getLeft().intValue());
         final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
         assertNotNull(response);
     }
@@ -68,7 +69,7 @@ public class VfcSimulatorTest {
     @Test
     public void testGet() {
         final Pair<Integer, String> httpDetails = new RestManager().get("http://localhost:6668/api/nslcm/v1/jobs/1234",
-                "username", "password", new HashMap<String, String>());
+                "username", "password", new HashMap<>());
         assertNotNull(httpDetails);
         final VfcResponse response = Serialization.gsonPretty.fromJson(httpDetails.getRight(), VfcResponse.class);
         assertNotNull(response);