aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/test/java
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2018-04-26 11:53:15 +0800
committerRob Daugherty <rd472p@att.com>2018-04-26 21:27:50 +0000
commite53e4bc3703c704f905d96a2526f209bce759e2d (patch)
treee013799cbc5d437fd956b0fbe8bc7d39d95149ed /mso-api-handlers/mso-api-handler-infra/src/test/java
parent98e3f70497d2cdde07bb03a57fdd2ebdf3208882 (diff)
Remove operation status set in api-handler
Remove operation status set in api-handler Change-Id: I579d25044130b0701231c0a2d42534e8c63e3ebd Issue-ID: SO-587 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/java')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java141
1 files changed, 9 insertions, 132 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
index 45fc89bfc2..f8caa54846 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
@@ -164,13 +164,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -222,7 +216,7 @@ public class E2EServiceInstancesTest {
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("success"));
}
@Test
@@ -235,13 +229,6 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
-
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -306,13 +293,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -377,13 +358,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -428,7 +403,7 @@ public class E2EServiceInstancesTest {
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
@@ -441,13 +416,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -488,7 +457,7 @@ public class E2EServiceInstancesTest {
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
@@ -502,13 +471,7 @@ public class E2EServiceInstancesTest {
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -530,7 +493,7 @@ public class E2EServiceInstancesTest {
;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
@@ -543,19 +506,12 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
-
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
@@ -569,19 +525,13 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
@@ -595,35 +545,23 @@ public class E2EServiceInstancesTest {
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
public void createE2EServiceInstanceTestEmptyDBQuery() {
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
// assertTrue(true);
}
@@ -638,30 +576,18 @@ public class E2EServiceInstancesTest {
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = jsonBody;
Response resp = instance.createE2EServiceInstance(request, "v3");
String respStr = resp.getEntity().toString();
- assertTrue(respStr.contains("SVC2000"));
+ assertTrue(respStr.contains("serviceException"));
}
@Test
public void createE2EServiceInstanceTestForEmptyRequest() {
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
E2EServiceInstances instance = new E2EServiceInstances();
String request = "";
Response resp = instance.createE2EServiceInstance(request, "v3");
@@ -795,11 +721,6 @@ public class E2EServiceInstancesTest {
}
};
- new Expectations() {{
- sessionFactoryManager.getSessionFactory().openSession();
- result = session;
- }};
-
E2EServiceInstances instance = new E2EServiceInstances();
String request = "{\"globalSubscriberId\":\"299392392\",\"serviceType\":\"VoLTE\"}";
@@ -871,13 +792,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -943,13 +858,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -1016,13 +925,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -1095,13 +998,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
MockUp<CatalogDatabase> catalog = new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) throws Exception {
@@ -1167,13 +1064,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -1239,13 +1130,7 @@ public class E2EServiceInstancesTest {
return operationStatus;
}
};
- new MockUp<E2EServiceInstances>() {
- @Mock
- private void createOperationStatusRecordForError(Action action,
- String requestId) throws MsoDatabaseException {
- }
- };
new MockUp<CatalogDatabase>() {
@Mock
public Service getServiceByModelName(String modelName) {
@@ -1363,10 +1248,6 @@ public class E2EServiceInstancesTest {
public void scaleE2EserviceInstancesTestFailInvalidRequest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
@Mocked Session session ) {
- new Expectations() {{
- sessionFactoryManager.getSessionFactory().openSession(); result = session;
- }};
-
E2EServiceInstances instance = new E2EServiceInstances();
Response response = instance.scaleE2EServiceInstance(jsonBody, "v3", "12345");
}
@@ -1440,10 +1321,6 @@ public class E2EServiceInstancesTest {
public void scaleE2EserviceInstancesTestFailCamundaClient(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
@Mocked Session session) {
- new Expectations() {{
- sessionFactoryManager.getSessionFactory().openSession(); result = session;
- }};
-
final MockUp<MsoRequest> mockMsoRequest = new MockUp<MsoRequest>() {
@Mock
public void createRequestRecord(Status status, Action action) {