diff options
author | Marcus G K Williams <marcus.williams@intel.com> | 2018-03-07 18:17:22 -0800 |
---|---|---|
committer | Marcus G K Williams <marcus.williams@intel.com> | 2018-03-08 09:17:48 -0800 |
commit | 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e (patch) | |
tree | 0d943226962ae31c0bf2fd0696e91c6bb41d099c /bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai | |
parent | dee036198ee09d71bfdd50247c1d23a7f472df87 (diff) |
Reduce log noise/warnings format to conventions
Reduce build log warnings by formatting tests
to ONAP code conventions (removing tabs etc.)
Issue-ID: SO-368
Change-Id: I48c6d359b83617aebeb79db4e30c1d72d31f7eec
Signed-off-by: Marcus G K Williams <marcus.williams@intel.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai')
3 files changed, 90 insertions, 87 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java index bee0a828ea..680beb5d5b 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java @@ -30,36 +30,39 @@ import org.junit.BeforeClass; import org.junit.Ignore;
import org.junit.Test;
import org.onap.aai.domain.yang.Pserver;
+
import static org.junit.Assert.assertEquals;
+
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
+
public class AAIPServerTest {
- @BeforeClass
- public static void setUp() {
- System.setProperty("mso.config.path", "src/test/resources");
- System.setProperty("javax.net.ssl.keyStore", "C:/etc/ecomp/mso/config/msoClientKeyStore.jks");
- System.setProperty("javax.net.ssl.keyStorePassword", "mso4you");
- System.setProperty("javax.net.ssl.trustStore", "C:/etc/ecomp/mso/config/msoTrustStore.jks");
- System.setProperty("javax.net.ssl.trustStorePassword", "mso_Domain2.0_4you");
- }
-
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void pserverTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {
- AAIRestClientImpl client = new AAIRestClientImpl();
- File file = new File("src/test/resources/__files/AAI/pserver.json");
- List<Pserver> list = client.getListOfPservers(file);
-
- assertEquals("", list.get(0).getHostname(), "test");
- }
-
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void pserverActualTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {
- AAIRestClientImpl client = new AAIRestClientImpl();
- List<Pserver> list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7", UUID.randomUUID().toString());
- assertEquals("", list.size(), 0);
- }
+ @BeforeClass
+ public static void setUp() {
+ System.setProperty("mso.config.path", "src/test/resources");
+ System.setProperty("javax.net.ssl.keyStore", "C:/etc/ecomp/mso/config/msoClientKeyStore.jks");
+ System.setProperty("javax.net.ssl.keyStorePassword", "mso4you");
+ System.setProperty("javax.net.ssl.trustStore", "C:/etc/ecomp/mso/config/msoTrustStore.jks");
+ System.setProperty("javax.net.ssl.trustStorePassword", "mso_Domain2.0_4you");
+ }
+
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ public void pserverTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {
+ AAIRestClientImpl client = new AAIRestClientImpl();
+ File file = new File("src/test/resources/__files/AAI/pserver.json");
+ List<Pserver> list = client.getListOfPservers(file);
+
+ assertEquals("", list.get(0).getHostname(), "test");
+ }
+
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ public void pserverActualTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException {
+ AAIRestClientImpl client = new AAIRestClientImpl();
+ List<Pserver> list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7", UUID.randomUUID().toString());
+ assertEquals("", list.size(), 0);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java index 2272f31685..cfa61c2799 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java @@ -39,61 +39,61 @@ import org.onap.aai.domain.yang.Pserver; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; -@RunWith(MockitoJUnitRunner.class) +@RunWith(MockitoJUnitRunner.class) public class AAIValidatorTest { - - @Mock - protected AAIRestClient client; - String vnfName = "testVnf"; - String uuid = "UUID"; - AAIValidatorImpl validator; - - @Before - public void init(){ - validator = new AAIValidatorImpl(); - validator.setClient(client); - } - - public List<Pserver> getPservers(boolean locked){ - Pserver pserver = new Pserver(); - pserver.setInMaint(locked); - List<Pserver> pservers = new ArrayList<Pserver>(); - pservers.add(pserver); - return pservers; - } - - public GenericVnf createGenericVnfs(boolean locked){ - GenericVnf genericVnf = new GenericVnf(); - genericVnf.setInMaint(locked); - - return genericVnf; - } - @Test - public void test_IsPhysicalServerLocked_True() throws IOException{ - when(client.getPhysicalServerByVnfId(vnfName,uuid)).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)); - boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); - assertEquals(false, locked); - } - - @Test - public void test_IsVNFLocked_False() throws Exception{ - when(client.getVnfByName(vnfName,uuid)).thenReturn(createGenericVnfs(false)); - boolean locked = validator.isVNFLocked(vnfName, uuid); - assertEquals(false, locked); - } + @Mock + protected AAIRestClient client; + String vnfName = "testVnf"; + String uuid = "UUID"; + AAIValidatorImpl validator; - @Test - public void test_IsVNFLocked_True() throws Exception{ - when(client.getVnfByName(vnfName,uuid)).thenReturn(createGenericVnfs(true)); - boolean locked = validator.isVNFLocked(vnfName, uuid); - assertEquals(true,locked ); - } + @Before + public void init() { + validator = new AAIValidatorImpl(); + validator.setClient(client); + } + + public List<Pserver> getPservers(boolean locked) { + Pserver pserver = new Pserver(); + pserver.setInMaint(locked); + List<Pserver> pservers = new ArrayList<Pserver>(); + pservers.add(pserver); + return pservers; + } + + public GenericVnf createGenericVnfs(boolean locked) { + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setInMaint(locked); + + return genericVnf; + } + + @Test + public void test_IsPhysicalServerLocked_True() throws IOException { + when(client.getPhysicalServerByVnfId(vnfName, uuid)).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)); + boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); + assertEquals(false, locked); + } + + @Test + public void test_IsVNFLocked_False() throws Exception { + when(client.getVnfByName(vnfName, uuid)).thenReturn(createGenericVnfs(false)); + boolean locked = validator.isVNFLocked(vnfName, uuid); + assertEquals(false, locked); + } + + @Test + public void test_IsVNFLocked_True() throws Exception { + when(client.getVnfByName(vnfName, uuid)).thenReturn(createGenericVnfs(true)); + boolean locked = validator.isVNFLocked(vnfName, uuid); + assertEquals(true, locked); + } } diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java index 09c2ab5c30..c20e54c9a5 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java @@ -30,12 +30,12 @@ import com.openpojo.validation.test.impl.SetterTester; public class EntitiesTest { - private String packageName = "org.openecomp.mso.client.aai.entities"; + private String packageName = "org.openecomp.mso.client.aai.entities"; - @Test - public void validate() { - Validator validator = ValidatorBuilder.create().with(new SetterMustExistRule(), new GetterMustExistRule()) - .with(new SetterTester(), new GetterTester()).build(); - validator.validate(packageName); - } + @Test + public void validate() { + Validator validator = ValidatorBuilder.create().with(new SetterMustExistRule(), new GetterMustExistRule()) + .with(new SetterTester(), new GetterTester()).build(); + validator.validate(packageName); + } } |