diff options
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
9 files changed, 226 insertions, 38 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java index d57e48781d..1bf2a290cb 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java @@ -23,7 +23,11 @@ package org.onap.so.bpmn.infrastructure.pnf.aai; import java.util.Optional; import org.onap.aai.domain.yang.Pnf; import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection; +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.AAIRestClientImpl; +import org.onap.so.client.aai.entities.uri.AAIResourceUri; +import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.springframework.stereotype.Component; @Component @@ -40,4 +44,12 @@ public class AaiConnectionImpl implements AaiConnection { AAIRestClientImpl restClient = new AAIRestClientImpl(); restClient.createPnf(correlationId, entry); } + + @Override + public void createRelation(String serviceInstanceId, String pnfName) { + AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + serviceInstanceId); + AAIResourceUri pnfUri = AAIUriFactory.createResourceUri(AAIObjectType.PNF, pnfName); + new AAIResourcesClient().connect(serviceInstanceURI, pnfUri); + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java new file mode 100644 index 0000000000..21d43964f8 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelation.java @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2019 Nokia. + * ================================================================================ + * 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.so.bpmn.infrastructure.pnf.delegate; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.onap.so.bpmn.common.scripts.ExceptionUtil; +import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class CreateRelation implements JavaDelegate { + + private static final Logger logger = LoggerFactory.getLogger(CreateRelation.class); + + private AaiConnection aaiConnectionImpl; + + @Autowired + public CreateRelation(AaiConnection aaiConnectionImpl) { + this.aaiConnectionImpl = aaiConnectionImpl; + } + + @Override + public void execute(DelegateExecution delegateExecution) { + String serviceInstanceId = (String) delegateExecution.getVariable("serviceInstanceId"); + String pnfName = (String) delegateExecution.getVariable("correlationId"); + try { + aaiConnectionImpl.createRelation(serviceInstanceId, pnfName); + } catch (Exception e) { + new ExceptionUtil().buildAndThrowWorkflowException(delegateExecution, 9999, + "An exception occurred when making service and pnf relation. Exception: " + e.getMessage()); + } + logger.debug("The relation has been made between service with id: {} and pnf with name: {}", + serviceInstanceId, pnfName); + } + +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java index 5165912653..eaabb2bfbb 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/implementation/AaiConnection.java @@ -29,4 +29,6 @@ public interface AaiConnection { Optional<Pnf> getEntryFor(String correlationId) throws IOException; void createEntry(String correlationId, Pnf entry) throws IOException; + + void createRelation(String serviceInstanceId, String pnfName) throws IOException; } diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java index 201e791a24..76b62a9cea 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionTestImpl.java @@ -37,7 +37,7 @@ public class AaiConnectionTestImpl implements AaiConnection { private Map<String, Pnf> created = new HashMap<>(); @Override - public Optional<Pnf> getEntryFor(String correlationId) throws IOException { + public Optional<Pnf> getEntryFor(String correlationId) { if (Objects.equals(correlationId, ID_WITH_ENTRY)) { return Optional.of(new Pnf()); } else { @@ -50,6 +50,10 @@ public class AaiConnectionTestImpl implements AaiConnection { created.put(correlationId, entry); } + @Override + public void createRelation(String serviceInstanceId, String pnfName) { + } + public Map<String, Pnf> getCreated() { return created; } diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java index 7df6757817..300d1e4c9b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/AaiConnectionThrowingException.java @@ -36,4 +36,10 @@ public class AaiConnectionThrowingException implements AaiConnection { public void createEntry(String correlationId, Pnf entry) throws IOException { throw new IOException(); } + + @Override + public void createRelation(String serviceInstanceId, String pnfName) throws IOException { + throw new IOException(); + } + } diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java new file mode 100644 index 0000000000..2dd3e23828 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/pnf/delegate/CreateRelationTest.java @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2019 Nokia. + * ================================================================================ + * 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.so.bpmn.infrastructure.pnf.delegate; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import java.io.IOException; +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake; +import org.junit.Before; +import org.junit.Test; +import org.onap.so.bpmn.infrastructure.pnf.aai.AaiConnectionImpl; +import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection; + +public class CreateRelationTest { + + private static final String SERVICE_INSTANCE_ID = "serviceTest"; + private static final String PNF_NAME = "pnfNameTest"; + + private DelegateExecutionFake executionFake; + + @Before + public void setUp() { + executionFake = new DelegateExecutionFake(); + executionFake.setVariable("serviceInstanceId", SERVICE_INSTANCE_ID); + executionFake.setVariable("correlationId", PNF_NAME); + } + + @Test + public void createRelationSuccessful() throws IOException { + // given + AaiConnection aaiConnectionMock = mock(AaiConnectionImpl.class); + CreateRelation testedObject = new CreateRelation(aaiConnectionMock); + // when + testedObject.execute(executionFake); + // then + verify(aaiConnectionMock).createRelation(SERVICE_INSTANCE_ID, PNF_NAME); + } + + @Test + public void shouldThrowBpmnErrorWhenExceptionOccurred() { + CreateRelation testedObject = new CreateRelation(new AaiConnectionThrowingException()); + executionFake.setVariable("testProcessKey", "testProcessKeyValue"); + + assertThatThrownBy(() -> testedObject.execute(executionFake)).isInstanceOf(BpmnError.class); + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java index 828e3fca47..4ac131f873 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.runtime.Incident; @@ -53,7 +54,7 @@ public class AbstractBuilderTest { private String operType; private String resourceType; private String requestId; - + @Override public String getProcessInstanceId() { return null; @@ -326,18 +327,30 @@ public class AbstractBuilderTest { public void removeVariablesLocal() { } + + @Override + public ProcessEngine getProcessEngine(){ + // TODO Auto-generated method stub + return null; + } + + @Override + public void setProcessBusinessKey(String arg0){ + // TODO Auto-generated method stub + + } }; @Test public void requestActionGetIntValueTest() { assertEquals(0, RequestAction.CREATE_NETWORK_INSTANCE.getIntValue()); } - + @Test public void svcActionGetIntValueTest() { assertEquals(0, SvcAction.RESERVE.getIntValue()); } - + @Test public void buildTest() throws Exception { abstractBuilder.build(null, null); @@ -347,75 +360,75 @@ public class AbstractBuilderTest { public void getRequestActionBlankOperationTypeTest() throws Exception { assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionDeleteOperationTypeBlankResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, ""); assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionDeleteOperationTypeBadResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad"); assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay"); assertEquals(AbstractBuilder.RequestAction.DEACTIVATE_DCI_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay"); assertEquals(AbstractBuilder.RequestAction.DELETE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionDeleteOperationTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); assertEquals(AbstractBuilder.RequestAction.DELETE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionCreateOperationTypeBlankResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, ""); assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionCreateOperationTypeBadResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad"); assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionCreateOperationTypeOverlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay"); assertEquals(AbstractBuilder.RequestAction.ACTIVATE_DCI_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay"); assertEquals(AbstractBuilder.RequestAction.CREATE_NETWORK_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionCreateOperationTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); assertEquals(AbstractBuilder.RequestAction.CREATE_SERVICE_INSTANCE.getName(), abstractBuilder.getRequestAction(delegateExecution)); } - + @Test public void getRequestActionBadOperationType() { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad"); @@ -426,75 +439,75 @@ public class AbstractBuilderTest { public void getSvcActionBlankOperationTypeTest() throws Exception { assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionDeleteOperationTypeBlankResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, ""); assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionDeleteOperationTypeBadResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad"); assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionDeleteOperationTypeOverlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay"); assertEquals(AbstractBuilder.SvcAction.DEACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionDeleteOperationTypeUnderlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay"); assertEquals(AbstractBuilder.SvcAction.DELETE.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionDeleteOperationTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.DELETE); assertEquals(AbstractBuilder.SvcAction.UNASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionCreateOperationTypeBlankResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, ""); assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionCreateOperationTypeBadResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "bad"); assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionCreateOperationTypeOverlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "overlay"); assertEquals(AbstractBuilder.SvcAction.ACTIVATE.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionCreateOperationTypeUnderlayResourceTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); delegateExecution.setVariable(AbstractBuilder.RESOURCE_TYPE, "underlay"); assertEquals(AbstractBuilder.SvcAction.CREATE.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionCreateOperationTypeTest() throws Exception { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, RequestsDbConstant.OperationType.CREATE); assertEquals(AbstractBuilder.SvcAction.ASSIGN.getName(), abstractBuilder.getSvcAction(delegateExecution)); } - + @Test public void getSvcActionBadOperationType() { delegateExecution.setVariable(AbstractBuilder.OPERATION_TYPE, "bad"); @@ -505,14 +518,14 @@ public class AbstractBuilderTest { public void getRequestIdBlankNotOnExecutionTest() { abstractBuilder.getRequestId(delegateExecution); } - + @Test public void getRequestIdBlankOnExecutionTest() { String expected = "requestId"; delegateExecution.setVariable("msoRequestId", expected); assertEquals(expected, abstractBuilder.getRequestId(delegateExecution)); } - + @Test public void getRequestIdTest() { String expected = "requestId"; @@ -539,13 +552,13 @@ public class AbstractBuilderTest { assertEquals("foo", list.get(0).getName()); assertEquals("bar", list.get(0).getValue()); } - + @Test public void getParamEntitiesNullInputsTest() { List<ParamEntity> list = abstractBuilder.getParamEntities(null); assertEquals(0, list.size()); } - + @Test public void getParamEntitiesEmptyInputsTest() { List<ParamEntity> list = abstractBuilder.getParamEntities(new HashMap<>()); diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java index f7d73a33e1..4e39c7b4e3 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilderTest.java @@ -7,9 +7,9 @@ * 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. @@ -24,6 +24,7 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.runtime.Incident; @@ -35,12 +36,12 @@ import org.junit.Test; public class NetworkRpcInputEntityBuilderTest { NetworkRpcInputEntityBuilder networRpcInputEntityBuilder = new NetworkRpcInputEntityBuilder(); - + DelegateExecution delegateExecution = new DelegateExecution() { private String operType; private String resourceType; private String requestId; - + @Override public String getProcessInstanceId() { return null; @@ -313,6 +314,18 @@ public class NetworkRpcInputEntityBuilderTest { public void removeVariablesLocal() { } + + @Override + public ProcessEngine getProcessEngine(){ + // TODO Auto-generated method stub + return null; + } + + @Override + public void setProcessBusinessKey(String arg0){ + // TODO Auto-generated method stub + + } }; @Test diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java index 4db0421936..556ff67fad 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java +++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilderTest.java @@ -7,9 +7,9 @@ * 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. @@ -24,6 +24,7 @@ import java.util.Collection; import java.util.Map; import java.util.Set; +import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.runtime.Incident; @@ -35,12 +36,12 @@ import org.junit.Test; public class ServiceRpcInputEntityBuilderTest { ServiceRpcInputEntityBuilder serviceRpcInputEntityBuilder = new ServiceRpcInputEntityBuilder(); - + DelegateExecution delegateExecution = new DelegateExecution() { private String operType; private String resourceType; private String requestId; - + @Override public String getProcessInstanceId() { return null; @@ -313,6 +314,18 @@ public class ServiceRpcInputEntityBuilderTest { public void removeVariablesLocal() { } + + @Override + public ProcessEngine getProcessEngine(){ + // TODO Auto-generated method stub + return null; + } + + @Override + public void setProcessBusinessKey(String arg0){ + // TODO Auto-generated method stub + + } }; @Test |