From b9163367a8760d5e4249fce287f638f1ec9dddfb Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 1 Aug 2019 03:13:04 -0400 Subject: Handle no pservers case on lock check Check for null return value from pservers query Issue-ID: SO-2184 Signed-off-by: Kuleshov, Elena Change-Id: I34c71601e694241a6d3cfefa8227200e715e2ed3 --- common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/src/test/java/org/onap') 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 5fa2ff0295..b91d0e705a 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 @@ -90,6 +90,13 @@ public class AAIValidatorTest { assertEquals(false, locked); } + @Test + public void test_IsPhysicalServerLocked_NoServers_False() throws IOException { + when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(null); + boolean locked = validator.isPhysicalServerLocked(vnfName); + assertEquals(false, locked); + } + @Test public void test_IsVNFLocked_False() { when(client.getVnfByName(vnfName)).thenReturn(createGenericVnfs(false)); -- cgit 1.2.3-korg