From 510eb0a7acd4ecc59820761177d8d1834aa1980a Mon Sep 17 00:00:00 2001 From: Lukasz Muszkieta Date: Wed, 10 Oct 2018 16:08:53 +0200 Subject: remove unused code UUID parameter in AAIRestClientI interface is redundant - part 1 Issue-ID: SO-729 Change-Id: I7db331098911e6e183d921175f3109f62b7aedbd Signed-off-by: Lukasz Muszkieta --- .../src/test/java/org/onap/so/client/aai/AAIPServerTest.java | 12 +++--------- .../test/java/org/onap/so/client/aai/AAIValidatorTest.java | 11 +++-------- 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'common/src/test/java') diff --git a/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java b/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java index 37188bc4bc..ba48e4368d 100644 --- a/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java +++ b/common/src/test/java/org/onap/so/client/aai/AAIPServerTest.java @@ -25,20 +25,14 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -import java.security.NoSuchAlgorithmException; import java.util.List; -import java.util.UUID; - import org.junit.Ignore; import org.junit.Test; import org.onap.aai.domain.yang.Pserver; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; public class AAIPServerTest { @Test - public void pserverTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException { + public void pserverTest() throws IOException { AAIRestClientImpl client = new AAIRestClientImpl(); String json = new String(Files.readAllBytes(Paths.get("src/test/resources/__files/aai/pserver.json"))); List list = client.getListOfPservers(json); @@ -49,9 +43,9 @@ public class AAIPServerTest { @Test @Ignore // IGNORED FOR 1710 MERGE TO ONAP - public void pserverActualTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException { + public void pserverActualTest() throws IOException { AAIRestClientImpl client = new AAIRestClientImpl(); - List list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7", UUID.randomUUID().toString()); + List list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7"); assertEquals("", list.size(), 0); } diff --git a/common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java b/common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java index 04c8b15b51..a2de528d9f 100644 --- a/common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java +++ b/common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java @@ -24,10 +24,8 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -36,9 +34,6 @@ import org.mockito.runners.MockitoJUnitRunner; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Pserver; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; - @RunWith(MockitoJUnitRunner.class) public class AAIValidatorTest { @@ -70,14 +65,14 @@ public class AAIValidatorTest { @Test public void test_IsPhysicalServerLocked_True() throws IOException{ - when(client.getPhysicalServerByVnfId(vnfName,uuid)).thenReturn(getPservers(true)); + when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPservers(true)); boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); assertEquals(true, locked); } @Test - public void test_IsPhysicalServerLocked_False() throws JsonParseException, JsonMappingException, UnsupportedEncodingException, IOException { - when(client.getPhysicalServerByVnfId(vnfName,uuid)).thenReturn(getPservers(false)); + public void test_IsPhysicalServerLocked_False() throws IOException { + when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPservers(false)); boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); assertEquals(false, locked); } -- cgit 1.2.3-korg