diff options
author | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-03-15 16:16:21 -0400 |
---|---|---|
committer | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-03-15 23:13:44 -0400 |
commit | 853440d183783ebfe65f45b49ad8874d9c87ef8d (patch) | |
tree | e3359e5173543a684140bf05962478df6f6f3567 /common/src/test/java/org | |
parent | 4ca3abdffa40e7777a233151f66ee0b4131ed538 (diff) |
Add VnfInPlaceSoftwareUpdate for WFD
Added CheckPserversLocked,SetClosedLoopDisabled,UnsetClosedLoopDisabled, CheckClosedLoopDisabled, CheckInMain
Change-Id: I6405b2c88d2109d952d452648bef2f99be6993df
Issue-ID: SO-1518
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Diffstat (limited to 'common/src/test/java/org')
-rw-r--r-- | common/src/test/java/org/onap/so/client/aai/AAIValidatorTest.java | 28 |
1 files changed, 21 insertions, 7 deletions
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 f32633122d..85d690feaf 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 @@ -49,11 +49,25 @@ public class AAIValidatorTest { validator.setClient(client); } - public List<Pserver> getPservers(boolean locked){ - Pserver pserver = new Pserver(); - pserver.setInMaint(locked); + public List<Pserver> getPserversLocked(){ + Pserver pserver1 = new Pserver(); + pserver1.setInMaint(true); + Pserver pserver2 = new Pserver(); + pserver2.setInMaint(false); List<Pserver> pservers = new ArrayList<Pserver>(); - pservers.add(pserver); + pservers.add(pserver1); + pservers.add(pserver2); + return pservers; + } + + public List<Pserver> getPserversNotLocked(){ + Pserver pserver1 = new Pserver(); + pserver1.setInMaint(false); + Pserver pserver2 = new Pserver(); + pserver2.setInMaint(false); + List<Pserver> pservers = new ArrayList<Pserver>(); + pservers.add(pserver1); + pservers.add(pserver2); return pservers; } @@ -64,15 +78,15 @@ public class AAIValidatorTest { } @Test - public void test_IsPhysicalServerLocked_True() throws IOException{ - when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPservers(true)); + public void test_IsPhysicalServerLocked_True() throws IOException{ + when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPserversLocked()); boolean locked = validator.isPhysicalServerLocked(vnfName); assertEquals(true, locked); } @Test public void test_IsPhysicalServerLocked_False() throws IOException { - when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPservers(false)); + when(client.getPhysicalServerByVnfId(vnfName)).thenReturn(getPserversNotLocked()); boolean locked = validator.isPhysicalServerLocked(vnfName); assertEquals(false, locked); } |