aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-03-09 15:02:18 -0500
committerRob Daugherty <rd472p@att.com>2018-03-09 15:08:14 -0500
commit96b5a685d0c3afddb632e4a68ca7483f933b55dc (patch)
tree246399de05a3d429bf45ef1e5af2b9b0218d99f3 /bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client
parent4475278c81668109b2b37a1d2720d8f2910641c4 (diff)
Revert Reduce log noise/warnings
This reverts commit 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e. It is seriously impeding our ability complete the promised merge of AT&T 1802 code. While I'm all for coding standards, if we are serious about using spaces instead of tabs, then I think we need to (1) agree with the community when this will happen, (2) do consistently in all files, and (3) enforce it. Change-Id: Ib9b996f6b6c7d81ac9ac95d58b0c7d8cc39675ff Issue-ID: SO-368 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java55
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java108
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java14
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java98
5 files changed, 136 insertions, 141 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
index 05e418b494..8943014ad0 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/ResponseExceptionMapperImplTest.java
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import com.google.common.base.Charsets;
-
import javax.ws.rs.BadRequestException;
import javax.ws.rs.ForbiddenException;
import javax.ws.rs.InternalServerErrorException;
@@ -38,7 +37,6 @@ import javax.ws.rs.NotSupportedException;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.client.ClientResponseContext;
import javax.ws.rs.core.Response.Status;
-
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.apache.commons.io.IOUtils;
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 680beb5d5b..bee0a828ea 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,39 +30,36 @@ 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 cfa61c2799..2272f31685 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;
+ }
- @Mock
- protected AAIRestClient client;
- String vnfName = "testVnf";
- String uuid = "UUID";
- AAIValidatorImpl validator;
+ @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);
+ }
- @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);
- }
+ @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 c20e54c9a5..09c2ab5c30 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);
+ }
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java
index 071b5845c8..2b082f1b8d 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java
@@ -38,61 +38,61 @@ import org.openecomp.appc.client.lcm.model.Status;
public class ApplicationControllerClientTest {
- private static ApplicationControllerClient client;
- private static ApplicationControllerSupport support;
+ private static ApplicationControllerClient client;
+ private static ApplicationControllerSupport support;
- @BeforeClass
- public static void beforeClass() {
- client = new ApplicationControllerClient();
- support = new ApplicationControllerSupport();
- client.appCSupport = support;
- System.setProperty("mso.config.path", "src/test/resources");
+ @BeforeClass
+ public static void beforeClass() {
+ client = new ApplicationControllerClient();
+ support = new ApplicationControllerSupport();
+ client.appCSupport = support;
+ System.setProperty("mso.config.path", "src/test/resources");
- }
+ }
- @AfterClass
- public static void afterClass() throws Exception {
- client.shutdownclient();
- }
+ @AfterClass
+ public static void afterClass() throws Exception {
+ client.shutdownclient();
+ }
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void createRequest_CheckLock_RequestBuilt() throws Exception {
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ public void createRequest_CheckLock_RequestBuilt() throws Exception {
- org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
- "org.openecomp.appc.client.lcm.model");
- Flags flags = new Flags();
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- actionIdentifiers.setVnfId("vnfId");
- CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers,
- flags, null, "requestId");
- assertEquals(checkLockInput.getAction().name(), "CheckLock");
- }
+ org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
+ "org.openecomp.appc.client.lcm.model");
+ Flags flags = new Flags();
+ ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
+ actionIdentifiers.setVnfId("vnfId");
+ CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers,
+ flags, null, "requestId");
+ assertEquals(checkLockInput.getAction().name(), "CheckLock");
+ }
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void runCommand_liveAppc() throws Exception {
- org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
- "org.openecomp.appc.client.lcm.model");
- Flags flags = new Flags();
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f");
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ public void runCommand_liveAppc() throws Exception {
+ org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
+ "org.openecomp.appc.client.lcm.model");
+ Flags flags = new Flags();
+ ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
+ actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f");
- // CheckLockInput checkLockInput = (CheckLockInput)
- // client.createRequest(Action.CheckLock,actionIdentifiers,flags,null,"requestId");
- Status status = client.runCommand(Action.Lock, actionIdentifiers, flags, null, UUID.randomUUID().toString());
- assertEquals("Status of run command is correct", status.getCode(), 306);
- }
+ // CheckLockInput checkLockInput = (CheckLockInput)
+ // client.createRequest(Action.CheckLock,actionIdentifiers,flags,null,"requestId");
+ Status status = client.runCommand(Action.Lock, actionIdentifiers, flags, null, UUID.randomUUID().toString());
+ assertEquals("Status of run command is correct", status.getCode(), 306);
+ }
- @Test
- @Ignore // IGNORED FOR 1710 MERGE TO ONAP
- public void runCommand_CheckLock_RequestBuilt() throws Exception {
- org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
- "org.openecomp.appc.client.lcm.model");
- Flags flags = new Flags();
- ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
- actionIdentifiers.setVnfId("fusion-vpp-vnf-001");
- Status status = client.runCommand(Action.CheckLock, actionIdentifiers, flags, null, "requestId");
- assertEquals("Status of run command is correct", status.getCode(), 400);
- }
+ @Test
+ @Ignore // IGNORED FOR 1710 MERGE TO ONAP
+ public void runCommand_CheckLock_RequestBuilt() throws Exception {
+ org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage",
+ "org.openecomp.appc.client.lcm.model");
+ Flags flags = new Flags();
+ ActionIdentifiers actionIdentifiers = new ActionIdentifiers();
+ actionIdentifiers.setVnfId("fusion-vpp-vnf-001");
+ Status status = client.runCommand(Action.CheckLock, actionIdentifiers, flags, null, "requestId");
+ assertEquals("Status of run command is correct", status.getCode(), 400);
+ }
}