diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-04-08 14:14:34 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-04-08 14:24:59 -0400 |
commit | f47919f1fe367b612fa9c96d34c59f01a541e882 (patch) | |
tree | 5b6aa2fc36747d868897e68ccbec0c6db0aee81c /bpmn/so-bpmn-infrastructure-flows/src/test/java | |
parent | 54452b80a1cf4d22ef750bc1377f8c1b05431d57 (diff) |
Replaced all tabs with spaces in java and pom.xml
Added in maven plugins to enforce coding style rules
Added in eclipse java formatting xml
Change-Id: I3727bbf4ce8dc66abfd8ad21b6cfd0890c5d3ff0
Issue-ID: SO-1765
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-flows/src/test/java')
6 files changed, 144 insertions, 190 deletions
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/AllBPMNTestSuites.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/AllBPMNTestSuites.java index 4f98ee4f1b..b1bf830a7a 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/AllBPMNTestSuites.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/AllBPMNTestSuites.java @@ -1,21 +1,16 @@ /* * - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix + * Foundation. ================================================================================ 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. + * 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. * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so; @@ -27,6 +22,6 @@ import org.junit.runner.RunWith; @RunWith(WildcardPatternSuite.class) @SuiteClasses({"**/service/*Test.class", "**/process/*Test.class", "**/subprocess/*Test.class"}) public class AllBPMNTestSuites { - // the class remains empty, - // used only as a holder for the above annotations + // the class remains empty, + // used only as a holder for the above annotations } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/BaseBPMNTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/BaseBPMNTest.java index 648c9887c2..983fcc2a5c 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/BaseBPMNTest.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/BaseBPMNTest.java @@ -1,20 +1,15 @@ /* - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix + * Foundation. ================================================================================ 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. + * 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. * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so; @@ -63,7 +58,7 @@ public abstract class BaseBPMNTest { protected int wireMockPort; @After - public void shutDown(){ + public void shutDown() { wireMockServer.resetAll(); } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java index 963d989eb7..3fd39c4953 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java @@ -36,30 +36,25 @@ public class EmbeddedMariaDbConfig { @Bean MariaDB4jSpringService mariaDB4jSpringService() { - MariaDB4jSpringService service = new MariaDB4jSpringService(); - - - service.getConfiguration().addArg("--lower_case_table_names=1"); + MariaDB4jSpringService service = new MariaDB4jSpringService(); + + + service.getConfiguration().addArg("--lower_case_table_names=1"); return service; } @Bean DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService, - @Value("${mariaDB4j.databaseName}") String databaseName, - @Value("${spring.datasource.username}") String datasourceUsername, - @Value("${spring.datasource.password}") String datasourcePassword, - @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException { - //Create our database with default root user and no password + @Value("${mariaDB4j.databaseName}") String databaseName, + @Value("${spring.datasource.username}") String datasourceUsername, + @Value("${spring.datasource.password}") String datasourcePassword, + @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException { + // Create our database with default root user and no password mariaDB4jSpringService.getDB().createDB(databaseName); DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration(); - return DataSourceBuilder - .create() - .username(datasourceUsername) - .password(datasourcePassword) - .url(config.getURL(databaseName)) - .driverClassName(datasourceDriver) - .build(); + return DataSourceBuilder.create().username(datasourceUsername).password(datasourcePassword) + .url(config.getURL(databaseName)).driverClassName(datasourceDriver).build(); } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java index bf4a015e36..9521e68e16 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java @@ -1,20 +1,15 @@ /* - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix + * Foundation. ================================================================================ 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. + * 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. * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so; @@ -60,50 +55,48 @@ public class GrpcNettyServer extends BluePrintProcessingServiceImplBase { @PostConstruct public void start() throws IOException { - final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = - new BluePrintProcessingServiceImplBase() { - @Override - public StreamObserver<ExecutionServiceInput> process( + final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() { + @Override + public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { - responseObserverRef.set(responseObserver); + responseObserverRef.set(responseObserver); - StreamObserver<ExecutionServiceInput> requestObserver = new StreamObserver<ExecutionServiceInput>() { - @Override - public void onNext(ExecutionServiceInput message) { - detailedMessages.add(message); - logger.info("Message received: {}", message); - ExecutionServiceOutput executionServiceOutput = ExecutionServiceOutput.newBuilder() + StreamObserver<ExecutionServiceInput> requestObserver = new StreamObserver<ExecutionServiceInput>() { + @Override + public void onNext(ExecutionServiceInput message) { + detailedMessages.add(message); + logger.info("Message received: {}", message); + ExecutionServiceOutput executionServiceOutput = ExecutionServiceOutput.newBuilder() .setActionIdentifiers(message.getActionIdentifiers()) - .setStatus(Status.newBuilder().setEventType( - EventType.EVENT_COMPONENT_EXECUTED).build()).build(); - - responseObserverRef.get().onNext(executionServiceOutput); - logger.info("Message sent: {}", executionServiceOutput); - } - - @Override - public void onError(Throwable t) { - responseObserverRef.get().onError(t); - } - - @Override - public void onCompleted() { - allRequestsDelivered.countDown(); - responseObserverRef.get().onCompleted(); - } - }; - - return requestObserver; - } - }; - grpcCleanup.register( - ServerBuilder.forPort(Integer.valueOf(port)).directExecutor().addService(blueprintPrcessorImpl).build() - .start()); + .setStatus(Status.newBuilder().setEventType(EventType.EVENT_COMPONENT_EXECUTED).build()) + .build(); + + responseObserverRef.get().onNext(executionServiceOutput); + logger.info("Message sent: {}", executionServiceOutput); + } + + @Override + public void onError(Throwable t) { + responseObserverRef.get().onError(t); + } + + @Override + public void onCompleted() { + allRequestsDelivered.countDown(); + responseObserverRef.get().onCompleted(); + } + }; + + return requestObserver; + } + }; + grpcCleanup.register(ServerBuilder.forPort(Integer.valueOf(port)).directExecutor() + .addService(blueprintPrcessorImpl).build().start()); } - public List<ExecutionServiceInput> getDetailedMessages(){ + public List<ExecutionServiceInput> getDetailedMessages() { return this.detailedMessages; } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/TestApplication.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/TestApplication.java index 64311d85da..e9855619c9 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/TestApplication.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/TestApplication.java @@ -30,12 +30,12 @@ import org.springframework.context.annotation.Profile; @SpringBootApplication @Profile("test") -@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, excludeFilters = { - @Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)}) +@ComponentScan(basePackages = {"org.onap.so"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, + excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)}) public class TestApplication { - public static void main(String... args) { - SpringApplication.run(TestApplication.class, args); - System.getProperties().setProperty("mso.db", "MARIADB"); - System.getProperties().setProperty("server.name", "Springboot"); - } + public static void main(String... args) { + SpringApplication.run(TestApplication.class, args); + System.getProperties().setProperty("mso.db", "MARIADB"); + System.getProperties().setProperty("server.name", "Springboot"); + } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java index 2b1dc384a1..abab08bdf3 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java @@ -1,21 +1,16 @@ /* * - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix + * Foundation. ================================================================================ 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. + * 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. * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.bpmn.infrastructure.process; @@ -29,7 +24,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; import static org.assertj.core.api.Assertions.fail; import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareAssertions.assertThat; - import com.google.protobuf.Struct; import com.google.protobuf.Value; import java.io.IOException; @@ -77,14 +71,13 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { variables.put("bpmnRequest", requestObject); /** - * This variable indicates that the flow was invoked asynchronously. - * It's injected by {@link WorkflowProcessor}. + * This variable indicates that the flow was invoked asynchronously. It's injected by {@link WorkflowProcessor}. */ variables.put("isAsyncProcess", "true"); /** - * Temporary solution to add pnfCorrelationId to context. - * this value is getting from the request to SO api handler and then convert to CamudaInput + * Temporary solution to add pnfCorrelationId to context. this value is getting from the request to SO api + * handler and then convert to CamudaInput */ variables.put("pnfCorrelationId", "PNFDemo"); @@ -112,12 +105,12 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { mockAai(); mockDmaapForPnf(); - ProcessInstance pi = runtimeService - .startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, variables); + ProcessInstance pi = + runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, variables); assertThat(pi).isNotNull(); Execution execution = runtimeService.createExecutionQuery().processDefinitionKey("CreateAndActivatePnfResource") - .activityId("WaitForDmaapPnfReadyNotification").singleResult(); + .activityId("WaitForDmaapPnfReadyNotification").singleResult(); if (!execution.isSuspended() && !execution.isEnded()) { try { @@ -127,25 +120,11 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { } } - assertThat(pi).isStarted().hasPassedInOrder( - "createVCPE_startEvent", - "preProcessRequest_ScriptTask", - "sendSyncAckResponse_ScriptTask", - "ScriptTask_0cdtchu", - "DecomposeService", - "ScriptTask_0lpv2da", - "ScriptTask_1y241p8", - "CallActivity_1vc4jeh", - "ScriptTask_1y5lvl7", - "GeneratePnfUuid", - "Task_14l19kv", - "Pnf_Con", - "setPONR_ScriptTask", - "postProcessAndCompletionRequest_ScriptTask", - "callCompleteMsoProcess_CallActivity", - "ScriptTask_2", - "CreateVCPE_EndEvent" - ); + assertThat(pi).isStarted().hasPassedInOrder("createVCPE_startEvent", "preProcessRequest_ScriptTask", + "sendSyncAckResponse_ScriptTask", "ScriptTask_0cdtchu", "DecomposeService", "ScriptTask_0lpv2da", + "ScriptTask_1y241p8", "CallActivity_1vc4jeh", "ScriptTask_1y5lvl7", "GeneratePnfUuid", "Task_14l19kv", + "Pnf_Con", "setPONR_ScriptTask", "postProcessAndCompletionRequest_ScriptTask", + "callCompleteMsoProcess_CallActivity", "ScriptTask_2", "CreateVCPE_EndEvent"); assertThat(pi).isEnded(); @@ -154,7 +133,7 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { try { checkConfigAssign(detailedMessages.get(0)); checkConfigDeploy(detailedMessages.get(1)); - } catch(Exception e){ + } catch (Exception e) { e.printStackTrace(); fail("ConfigAssign/deploy request exception", e); } @@ -164,7 +143,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers(); /** - * the fields of actionIdentifiers should match the one in the response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. + * the fields of actionIdentifiers should match the one in the + * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. */ assertThat(actionIdentifiers.getBlueprintName()).matches("test_configuration_restconf"); assertThat(actionIdentifiers.getBlueprintVersion()).matches("1.0.0"); @@ -182,15 +162,18 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-assign-properties").getStructValue(); assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).matches("PNFDemo"); - assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()).matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); - assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()).matches("68dc9a92-214c-11e7-93ae-92361f002680"); + assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()) + .matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()) + .matches("68dc9a92-214c-11e7-93ae-92361f002680"); } private void checkConfigDeploy(ExecutionServiceInput executionServiceInput) { ActionIdentifiers actionIdentifiers = executionServiceInput.getActionIdentifiers(); /** - * the fields of actionIdentifiers should match the one in the response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. + * the fields of actionIdentifiers should match the one in the + * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. */ assertThat(actionIdentifiers.getBlueprintName()).matches("test_configuration_restconf"); assertThat(actionIdentifiers.getBlueprintVersion()).matches("1.0.0"); @@ -208,8 +191,10 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-deploy-properties").getStructValue(); assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).matches("PNFDemo"); - assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()).matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); - assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()).matches("68dc9a92-214c-11e7-93ae-92361f002680"); + assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()) + .matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()) + .matches("68dc9a92-214c-11e7-93ae-92361f002680"); /** * IP addresses match the OAM ip addresses from AAI. @@ -229,51 +214,42 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { * Get the events from PNF topic */ wireMockServer - .stubFor(get(urlPathMatching("/events/pnfReady/consumerGroup.*")).willReturn(okJson(pnfResponse))); + .stubFor(get(urlPathMatching("/events/pnfReady/consumerGroup.*")).willReturn(okJson(pnfResponse))); } private void mockAai() { - String aaiResponse = "{\n" - + " \"results\": [\n" - + " {\n" - + " \"resource-type\": \"service-instance\",\n" - + " \"resource-link\": \"https://localhost:8443/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n" - + " }\n" - + " ]\n" - + "}"; - - String aaiPnfEntry = "{ \n" - + " \"pnf-name\":\"PNFDemo\",\n" - + " \"pnf-id\":\"testtest\",\n" - + " \"in-maint\":true,\n" - + " \"resource-version\":\"1541720264047\",\n" - + " \"ipaddress-v4-oam\":\"1.1.1.1\",\n" - + " \"ipaddress-v6-oam\":\"::/128\"\n" - + "}"; + String aaiResponse = "{\n" + " \"results\": [\n" + " {\n" + + " \"resource-type\": \"service-instance\",\n" + + " \"resource-link\": \"https://localhost:8443/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/key3\"\n" + + " }\n" + " ]\n" + "}"; + + String aaiPnfEntry = "{ \n" + " \"pnf-name\":\"PNFDemo\",\n" + " \"pnf-id\":\"testtest\",\n" + + " \"in-maint\":true,\n" + " \"resource-version\":\"1541720264047\",\n" + + " \"ipaddress-v4-oam\":\"1.1.1.1\",\n" + " \"ipaddress-v6-oam\":\"::/128\"\n" + "}"; /** * Get the AAI entry for globalCustomerId as specified in the request file. */ wireMockServer.stubFor( - get(urlPathMatching("/aai/v15/business/customers/customer/ADemoCustomerInCiti.*")).willReturn(ok())); + get(urlPathMatching("/aai/v15/business/customers/customer/ADemoCustomerInCiti.*")).willReturn(ok())); /** - * PUT the service to AAI with globalCustomerId, service type as specified in the request file. - * Service instance id is generated during runtime, REGEX is used to represent the information. + * PUT the service to AAI with globalCustomerId, service type as specified in the request file. Service instance + * id is generated during runtime, REGEX is used to represent the information. */ wireMockServer.stubFor(put(urlPathMatching( - "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))); + "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*"))); wireMockServer.stubFor(get(urlPathMatching( - "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")) - .willReturn(okJson(aaiResponse))); + "/aai/v15/business/customers/customer/ADemoCustomerInCiti/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/.*")) + .willReturn(okJson(aaiResponse))); /** * Get the service from AAI */ wireMockServer.stubFor(get(urlPathMatching("/aai/v15/nodes/service-instances/service-instance/.*")) - .willReturn(okJson(aaiResponse))); + .willReturn(okJson(aaiResponse))); /** * Put the project as specified in the request file to AAI. @@ -283,8 +259,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { /** * GET the project as specified in the request file to AAI. */ - wireMockServer - .stubFor(get(urlPathMatching("/aai/v15/business/projects/project/Project-Demonstration")).willReturn(ok())); + wireMockServer.stubFor( + get(urlPathMatching("/aai/v15/business/projects/project/Project-Demonstration")).willReturn(ok())); /** * PUT the PNF correlation ID to AAI. @@ -299,8 +275,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { /** * Put the PNF relationship */ - wireMockServer.stubFor( - put(urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration/relationship-list/relationship"))); + wireMockServer.stubFor(put( + urlEqualTo("/aai/v15/business/projects/project/Project-Demonstration/relationship-list/relationship"))); } /** @@ -308,29 +284,29 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { */ private void mockCatalogDb() { - String catalogdbClientResponse = FileUtil - .readResourceFile("response/" + getClass().getSimpleName() + "_catalogdb.json"); + String catalogdbClientResponse = + FileUtil.readResourceFile("response/" + getClass().getSimpleName() + "_catalogdb.json"); /** * Return valid json for the model UUID in the request file. */ wireMockServer - .stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=f2daaac6-5017-4e1e-96c8-6a27dfbe1421")) - .willReturn(okJson(responseObject))); + .stubFor(get(urlEqualTo("/v2/serviceResources?serviceModelUuid=f2daaac6-5017-4e1e-96c8-6a27dfbe1421")) + .willReturn(okJson(responseObject))); /** * Return valid json for the service model InvariantUUID as specified in the request file. */ wireMockServer.stubFor( - get(urlEqualTo("/v2/serviceResources?serviceModelInvariantUuid=539b7a2f-9524-4dbf-9eee-f2e05521df3f")) - .willReturn(okJson(responseObject))); + get(urlEqualTo("/v2/serviceResources?serviceModelInvariantUuid=539b7a2f-9524-4dbf-9eee-f2e05521df3f")) + .willReturn(okJson(responseObject))); /** * Return valid spring data rest json for the service model UUID as specified in the request file. */ wireMockServer.stubFor(get(urlEqualTo( - "/pnfResourceCustomization/search/findPnfResourceCustomizationByModelUuid?SERVICE_MODEL_UUID=f2daaac6-5017-4e1e-96c8-6a27dfbe1421")) - .willReturn(okJson(catalogdbClientResponse))); + "/pnfResourceCustomization/search/findPnfResourceCustomizationByModelUuid?SERVICE_MODEL_UUID=f2daaac6-5017-4e1e-96c8-6a27dfbe1421")) + .willReturn(okJson(catalogdbClientResponse))); } private void mockRequestDb() { |