OSAM infra seed code - merge with osam-core side-by-side - fixed warnings in onap-enabler POMs
Change-Id: I0cd9ea39d4b7c1dc088ab0ecd6fb787c7f490e5e
Signed-off-by: Aharoni, Pavel (pa0916) <pavel.aharoni@intl.att.com>
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjectTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjectTest.java
new file mode 100644
index 0000000..41438e6
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjectTest.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+package org.onap.osam.scheduler;
+
+import org.junit.Test;
+
+public class RestObjectTest {
+
+ private RestObject createTestSubject() {
+ return new RestObject();
+ }
+
+ @Test
+ public void testSet() throws Exception {
+ RestObject testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.set(null);
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ RestObject testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.get();
+ }
+
+ @Test
+ public void testSetStatusCode() throws Exception {
+ RestObject testSubject;
+ int v = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatusCode(v);
+ }
+
+ @Test
+ public void testGetStatusCode() throws Exception {
+ RestObject testSubject;
+ int result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatusCode();
+ }
+
+ @Test
+ public void testSetUUID() throws Exception {
+ RestObject testSubject;
+ String uuid = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setUUID(uuid);
+ }
+
+ @Test
+ public void testGetUUID() throws Exception {
+ RestObject testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getUUID();
+ }
+}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
new file mode 100644
index 0000000..f40a0e4
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/GetTimeSlotsRestObjectTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class GetTimeSlotsRestObjectTest {
+//
+// private GetTimeSlotsRestObject createTestSubject() {
+// return new GetTimeSlotsRestObject();
+// }
+//
+//
+// @Test
+// public void testSetUUID() throws Exception {
+// GetTimeSlotsRestObject testSubject;
+// String uuid = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setUUID(uuid);
+// }
+//
+//
+// @Test
+// public void testGetUUID() throws Exception {
+// GetTimeSlotsRestObject testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getUUID();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
new file mode 100644
index 0000000..24b472a
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostCreateNewVnfRestObjectTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class PostCreateNewVnfRestObjectTest {
+//
+// private PostCreateNewVnfRestObject createTestSubject() {
+// return new PostCreateNewVnfRestObject();
+// }
+//
+//
+// @Test
+// public void testSetUUID() throws Exception {
+// PostCreateNewVnfRestObject testSubject;
+// String uuid = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setUUID(uuid);
+// }
+//
+//
+// @Test
+// public void testGetUUID() throws Exception {
+// PostCreateNewVnfRestObject testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getUUID();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
new file mode 100644
index 0000000..04c3200
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/PostSubmitVnfChangeRestObjectTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.RestObjects;
+//
+//import org.junit.Test;
+//
+//
+//public class PostSubmitVnfChangeRestObjectTest {
+//
+// private PostSubmitVnfChangeRestObject createTestSubject() {
+// return new PostSubmitVnfChangeRestObject();
+// }
+//
+//
+// @Test
+// public void testSetUUID() throws Exception {
+// PostSubmitVnfChangeRestObject testSubject;
+// String uuid = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setUUID(uuid);
+// }
+//
+//
+// @Test
+// public void testGetUUID() throws Exception {
+// PostSubmitVnfChangeRestObject testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getUUID();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/RestObjectTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/RestObjectTest.java
new file mode 100644
index 0000000..4faa297
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/RestObjects/RestObjectTest.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+package org.onap.osam.scheduler.RestObjects;
+
+import org.junit.Test;
+
+
+public class RestObjectTest {
+
+ private RestObject createTestSubject() {
+ return new RestObject();
+ }
+
+
+ @Test
+ public void testSet() throws Exception {
+ RestObject testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.set(null);
+ }
+
+
+ @Test
+ public void testGet() throws Exception {
+ RestObject testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.get();
+ }
+
+
+ @Test
+ public void testSetStatusCode() throws Exception {
+ RestObject testSubject;
+ int v = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatusCode(v);
+ }
+
+
+ @Test
+ public void testGetStatusCode() throws Exception {
+ RestObject testSubject;
+ int result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatusCode();
+ }
+}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
new file mode 100644
index 0000000..20bd458
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapperTest.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class PostCreateNewVnfWrapperTest {
+//
+// private PostCreateNewVnfWrapper createTestSubject() {
+// return new PostCreateNewVnfWrapper();
+// }
+//
+//
+// @Test
+// public void testGetUuid() throws Exception {
+// PostCreateNewVnfWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getUuid();
+// }
+//
+//
+// @Test
+// public void testSetUuid() throws Exception {
+// PostCreateNewVnfWrapper testSubject;
+// String v = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setUuid(v);
+// }
+//
+//
+// @Test
+// public void testToString() throws Exception {
+// PostCreateNewVnfWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.toString();
+// }
+//
+//
+// @Test
+// public void testGetResponse() throws Exception {
+// PostCreateNewVnfWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getResponse();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
new file mode 100644
index 0000000..a8bfd3c
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapperTest.java
@@ -0,0 +1,77 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class PostSubmitVnfChangeTimeSlotsWrapperTest {
+//
+// private PostSubmitVnfChangeTimeSlotsWrapper createTestSubject() {
+// return new PostSubmitVnfChangeTimeSlotsWrapper();
+// }
+//
+//
+// @Test
+// public void testGetUuid() throws Exception {
+// PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getUuid();
+// }
+//
+//
+// @Test
+// public void testSetUuid() throws Exception {
+// PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+// String v = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setUuid(v);
+// }
+//
+//
+// @Test
+// public void testToString() throws Exception {
+// PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.toString();
+// }
+//
+//
+// @Test
+// public void testGetResponse() throws Exception {
+// PostSubmitVnfChangeTimeSlotsWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getResponse();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
new file mode 100644
index 0000000..b68570a
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapperTest.java
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+//package org.onap.vid.scheduler.SchedulerResponseWrappers;
+//
+//import org.junit.Test;
+//
+//
+//public class SchedulerResponseWrapperTest {
+//
+// private SchedulerResponseWrapper createTestSubject() {
+// return new SchedulerResponseWrapper();
+// }
+//
+//
+// @Test
+// public void testGetEntity() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getEntity();
+// }
+//
+//
+// @Test
+// public void testGetStatus() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// int result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getStatus();
+// }
+//
+//
+// @Test
+// public void testSetStatus() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// int v = 0;
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setStatus(v);
+// }
+//
+//
+// @Test
+// public void testSetEntity() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// String v = "";
+//
+// // default test
+// testSubject = createTestSubject();
+// testSubject.setEntity(v);
+// }
+//
+//
+// @Test
+// public void testToString() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.toString();
+// }
+//
+//
+// @Test
+// public void testGetResponse() throws Exception {
+// SchedulerResponseWrapper testSubject;
+// String result;
+//
+// // default test
+// testSubject = createTestSubject();
+// result = testSubject.getResponse();
+// }
+//}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerRestInterfaceTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerRestInterfaceTest.java
new file mode 100644
index 0000000..23a4287
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/SchedulerRestInterfaceTest.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+
+package org.onap.osam.scheduler;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.xebialabs.restito.semantics.Action;
+import org.glassfish.grizzly.http.util.HttpStatus;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.osam.exceptions.GenericUncheckedException;
+import org.onap.osam.testUtils.StubServerUtil;
+import org.testng.annotations.AfterMethod;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class SchedulerRestInterfaceTest {
+
+ private static final String SAMPLE_USERNAME = "sample";
+ private static final String SAMPLE_PASSWORD = "paS$w0Rd";
+ private static final String SAMPLE_SCHEDULER_SERVER_URL = "http://localhost";
+ private static final String SAMPLE_SOURCE_ID = "AAI";
+ private static final JSONParser JSON_PARSER = new JSONParser();
+ private static final String RESPONSE_CONTENT = "\"schedules\": \"SAMPLE STRING\"";
+ private static final String ERROR_RESPONSE = "\"error\": \"Internal server error!\"";
+ private static Map<String, String> DUMMY_SYSTEM_PROPERTIES = new HashMap<String, String>() {{
+ put(SchedulerProperties.SCHEDULER_USER_NAME_VAL, SAMPLE_USERNAME);
+ put(SchedulerProperties.SCHEDULER_PASSWORD_VAL, SAMPLE_PASSWORD);
+ put(SchedulerProperties.SCHEDULER_SERVER_URL_VAL, SAMPLE_SCHEDULER_SERVER_URL);
+ }};
+ private static StubServerUtil serverUtil;
+ private static SchedulerRestInterface schedulerInterface = new SchedulerRestInterface((key) -> DUMMY_SYSTEM_PROPERTIES.get(key));
+
+ @BeforeClass
+ public static void setUpClass() {
+ serverUtil = new StubServerUtil();
+ serverUtil.runServer();
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ serverUtil.stopServer();
+ }
+
+
+ @AfterMethod
+ public void tearDown() {
+ serverUtil.stopServer();
+ }
+
+ @Test
+ public void testShouldGetOKWhenStringIsExpected() throws JsonProcessingException, ParseException {
+ prepareEnvForTest();
+ RestObject<String> sampleRestObj = new RestObject<>();
+ serverUtil.prepareGetCall("/test", RESPONSE_CONTENT, Action.ok());
+
+ schedulerInterface.Get("", SAMPLE_SOURCE_ID, "", sampleRestObj);
+
+ assertResponseHasExpectedBodyAndStatus(sampleRestObj, RESPONSE_CONTENT, 200);
+ }
+
+ @Test(expected = GenericUncheckedException.class)
+ public void shouldRaiseExceptionWhenErrorOccursDuringGet() throws JsonProcessingException {
+ prepareEnvForTest();
+ RestObject<String> sampleRestObj = new RestObject<>();
+
+ serverUtil.prepareGetCall("/test", ERROR_RESPONSE, Action.status(HttpStatus.INTERNAL_SERVER_ERROR_500));
+
+ schedulerInterface.Get("", SAMPLE_SOURCE_ID, "", sampleRestObj);
+ }
+
+ @Test
+ public void shouldDeleteResourceSuccessfully() throws JsonProcessingException, ParseException {
+ prepareEnvForTest();
+ RestObject<String> sampleRestObj = new RestObject<>();
+ serverUtil.prepareDeleteCall("/test", RESPONSE_CONTENT, Action.ok());
+
+ schedulerInterface.Delete("", SAMPLE_SOURCE_ID, "", sampleRestObj);
+
+ assertResponseHasExpectedBodyAndStatus(sampleRestObj, RESPONSE_CONTENT, 200);
+ }
+
+ @Test
+ public void shouldRaiseExceptionWhenErrorOccursDuringDelete() throws JsonProcessingException, ParseException {
+ prepareEnvForTest();
+ RestObject<String> sampleRestObj = new RestObject<>();
+ serverUtil.prepareDeleteCall("/test", ERROR_RESPONSE, Action.status(HttpStatus.INTERNAL_SERVER_ERROR_500));
+
+ schedulerInterface.Delete("", SAMPLE_SOURCE_ID, "", sampleRestObj);
+
+ assertResponseHasExpectedBodyAndStatus(sampleRestObj, ERROR_RESPONSE, 500);
+ }
+
+
+ private void assertResponseHasExpectedBodyAndStatus(RestObject<String> sampleRestObj, String expectedResponse, int expectedStatusCode) throws ParseException {
+ Object parsedResult = JSON_PARSER.parse(sampleRestObj.get());
+
+ assertThat(sampleRestObj.getStatusCode()).isEqualTo(expectedStatusCode);
+ assertThat(parsedResult).isInstanceOf(String.class).isEqualTo(expectedResponse);
+ assertThat(sampleRestObj.getUUID()).isNull();
+
+ }
+
+ private void prepareEnvForTest() {
+ String targetUrl = serverUtil.constructTargetUrl("http", "test");
+ DUMMY_SYSTEM_PROPERTIES.put(SchedulerProperties.SCHEDULER_SERVER_URL_VAL, targetUrl);
+ }
+}
diff --git a/onap-enabler-be/src/test/java/org/onap/osam/scheduler/rest/RequestDetailsTest.java b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/rest/RequestDetailsTest.java
new file mode 100644
index 0000000..d82f1d9
--- /dev/null
+++ b/onap-enabler-be/src/test/java/org/onap/osam/scheduler/rest/RequestDetailsTest.java
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OSAM
+ * ================================================================================
+ * Copyright (C) 2018 AT&T
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+
+
+package org.onap.osam.scheduler.rest;
+
+import org.onap.osam.mso.rest.RequestDetails;
+
+
+public class RequestDetailsTest {
+
+ private RequestDetails createTestSubject() {
+ return new RequestDetails();
+ }
+
+
+ /*@Test
+ public void testGetDomain() throws Exception {
+ RequestDetails testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDomain();
+ }
+
+
+ @Test
+ public void testSetDomain() throws Exception {
+ RequestDetails testSubject;
+ String domain = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setDomain(domain);
+ }*/
+}