diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2020-09-26 16:45:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-09-26 16:45:53 +0000 |
commit | af1efe8d52d325929e4e9231576a9a5f97e143ae (patch) | |
tree | 8b0bb6dfbb824d23a755800d43b78186a67dc5ac /bpmn/so-bpmn-tasks/src/test/java/org | |
parent | 38ba6377d605cce14275ccc3973d8abe7ffb3abc (diff) | |
parent | 2e66d01a3a75439ab077fe15b1830ba4bc2a1d6b (diff) |
Merge "Sonar fixes"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java/org')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java index f09e792cf4..e1d3a7cbc4 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java @@ -9,9 +9,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. @@ -37,6 +37,7 @@ import java.util.List; import java.util.Optional; import java.util.TreeSet; import java.util.stream.Collectors; +import com.google.common.base.Strings; import org.camunda.bpm.engine.delegate.BpmnError; import org.junit.Before; import org.junit.Rule; @@ -303,6 +304,22 @@ public class AAICreateTasksTest extends BaseTaskTest { } @Test + public void createOwningEntityShouldThrowExceptionWhenNameAndIDAreNull() { + boolean catchedBpmnError = false; + serviceInstance.getOwningEntity().setOwningEntityName(null); + serviceInstance.getOwningEntity().setOwningEntityId(null); + + try { + aaiCreateTasks.createOwningEntity(execution); + } catch (BpmnError err) { + catchedBpmnError = true; + } + + assertTrue(catchedBpmnError); + assertEquals(execution.getVariable("ErrorCreateOEAAI"), aaiCreateTasks.EXCEPTION_NAME_AND_ID_ARE_NULL); + } + + @Test public void createOwningEntityNullOwningEntityNameTest() throws Exception { expectedException.expect(BpmnError.class); |