aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-03-09 10:00:26 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-09 10:00:26 +0000
commitf3b28a0aafd83a57d42afbf23c9f6fbe6f546db3 (patch)
tree5ecb2b2a78ab3139828db18de5f2a76d76c77519 /bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
parent8d0b9eb56af520d28c423da76c0f0be02cb453c7 (diff)
parent327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e (diff)
Merge "Reduce log noise/warnings format to conventions"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java')
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java249
1 files changed, 125 insertions, 124 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
index b4aca5081e..27be8d008f 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/mock/StubResponseVNFAdapter.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- */
+ */
package org.openecomp.mso.bpmn.mock;
@@ -32,127 +32,128 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
*/
public class StubResponseVNFAdapter {
- public static void mockVNFAdapter() {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void mockVNFAdapter(String responseFile) {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "text/xml")
- .withBodyFile(responseFile)));
- }
-
- public static void mockVNFAdapter_500() {
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void mockVNFAdapterTransformer(String transformer, String responseFile) {
- MockResource mockResource = new MockResource();
- mockResource.updateProperties("vnf_delay", "300");
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/soap+xml")
- .withTransformers(transformer)
- .withBodyFile(responseFile)));
- }
-
- public static void mockVNFAdapterTransformer(String transformer, String responseFile, String requestContaining) {
- MockResource mockResource = new MockResource();
- mockResource.updateProperties("vnf_delay", "300");
- stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
- .withRequestBody(containing(requestContaining))
- .willReturn(aResponse()
- .withStatus(200)
- .withHeader("Content-Type", "application/soap+xml")
- .withTransformers(transformer)
- .withBodyFile(responseFile)));
- }
-
- public static void mockVNFPost(String vfModuleId, int statusCode, String vnfId) {
- stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVNFPut(String vfModuleId, int statusCode) {
- stubFor(put(urlEqualTo("/vnfs/v1/vnfs/vnfId/vf-modules" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVNFPut(String vnfId, String vfModuleId, int statusCode) {
- stubFor(put(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVNFDelete(String vnfId, String vfModuleId, int statusCode) {
- stubFor(delete(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVNFRollbackDelete(String vfModuleId, int statusCode) {
- stubFor(delete(urlEqualTo("/vnfs/v1/vnfs/vnfId/vf-modules" + vfModuleId + "/rollback"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockPutVNFVolumeGroup(String volumeGroupId, int statusCode) {
- stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/" + volumeGroupId))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockPutVNFVolumeGroupRollback(String volumeGroupId, int statusCode) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/" + volumeGroupId + "/rollback"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
- public static void mockPostVNFVolumeGroup(int statusCode) {
- stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVNFAdapterRest(String vnfId) {
- stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules"))
- .willReturn(aResponse()
- .withStatus(200)));
- }
-
- public static void mockVNFAdapterRest_500(String vnfId) {
- stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules"))
- .willReturn(aResponse()
- .withStatus(500)));
- }
-
- public static void mockVfModuleDelete(String volumeGroupId) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/"+ volumeGroupId))
- .willReturn(aResponse()
- .withStatus(202)
- .withHeader("Content-Type", "application/xml")));
- }
-
- public static void mockVfModuleDelete(String volumeGroupId, int statusCode) {
- stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
- .willReturn(aResponse()
- .withStatus(statusCode)
- .withHeader("Content-Type", "application/xml")));
- }
+ public static void mockVNFAdapter() {
+ stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void mockVNFAdapter(String responseFile) {
+ stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "text/xml")
+ .withBodyFile(responseFile)));
+ }
+
+ public static void mockVNFAdapter_500() {
+ stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void mockVNFAdapterTransformer(String transformer, String responseFile) {
+ MockResource mockResource = new MockResource();
+ mockResource.updateProperties("vnf_delay", "300");
+ stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/soap+xml")
+ .withTransformers(transformer)
+ .withBodyFile(responseFile)));
+ }
+
+ public static void mockVNFAdapterTransformer(String transformer, String responseFile, String requestContaining) {
+ MockResource mockResource = new MockResource();
+ mockResource.updateProperties("vnf_delay", "300");
+ stubFor(post(urlEqualTo("/vnfs/VnfAdapterAsync"))
+ .withRequestBody(containing(requestContaining))
+ .willReturn(aResponse()
+ .withStatus(200)
+ .withHeader("Content-Type", "application/soap+xml")
+ .withTransformers(transformer)
+ .withBodyFile(responseFile)));
+ }
+
+ public static void mockVNFPost(String vfModuleId, int statusCode, String vnfId) {
+ stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVNFPut(String vfModuleId, int statusCode) {
+ stubFor(put(urlEqualTo("/vnfs/v1/vnfs/vnfId/vf-modules" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVNFPut(String vnfId, String vfModuleId, int statusCode) {
+ stubFor(put(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVNFDelete(String vnfId, String vfModuleId, int statusCode) {
+ stubFor(delete(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules" + vfModuleId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVNFRollbackDelete(String vfModuleId, int statusCode) {
+ stubFor(delete(urlEqualTo("/vnfs/v1/vnfs/vnfId/vf-modules" + vfModuleId + "/rollback"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockPutVNFVolumeGroup(String volumeGroupId, int statusCode) {
+ stubFor(put(urlEqualTo("/vnfs/v1/volume-groups/" + volumeGroupId))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockPutVNFVolumeGroupRollback(String volumeGroupId, int statusCode) {
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/" + volumeGroupId + "/rollback"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockPostVNFVolumeGroup(int statusCode) {
+ stubFor(post(urlEqualTo("/vnfs/v1/volume-groups"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVNFAdapterRest(String vnfId) {
+ stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(200)));
+ }
+
+ public static void mockVNFAdapterRest_500(String vnfId) {
+ stubFor(post(urlEqualTo("/vnfs/v1/vnfs/" + vnfId + "/vf-modules"))
+ .willReturn(aResponse()
+ .withStatus(500)));
+ }
+
+ public static void mockVfModuleDelete(String volumeGroupId) {
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/" + volumeGroupId))
+ .willReturn(aResponse()
+ .withStatus(202)
+ .withHeader("Content-Type", "application/xml")));
+ }
+
+ public static void mockVfModuleDelete(String volumeGroupId, int statusCode) {
+ stubFor(delete(urlMatching("/vnfs/v1/volume-groups/78987"))
+ .willReturn(aResponse()
+ .withStatus(statusCode)
+ .withHeader("Content-Type", "application/xml")));
+ }
}