Junit for mso.cloudify.exceptions 77/38077/1
authorSumapriya <SS00493505@techmahindra.com>
Fri, 23 Mar 2018 12:32:07 +0000 (18:02 +0530)
committerSumapriya <SS00493505@techmahindra.com>
Fri, 23 Mar 2018 12:32:07 +0000 (18:02 +0530)
Junit for:
1.MsoCloudifyException.java
2.MsoCloudify.java
3.MsoCloudifyTimeout.java
4.MsoCloudifyWorkflowException.java

Sonar-Link:
https://sonar.onap.org/code?id=org.onap.so%3Aso&selected=org.onap.so.adapters%3Amso-adapter-utils%3Asrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fcloudify%2Fexceptions

Change-Id: I77ad1f5da55d79104c952999e2ad0ec390a5f6d2
Issue-ID: SO-528
Signed-off-by: Sumapriya <SS00493505@techmahindra.com>
adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloudify/exceptions/MsoCloudifyExceptionTest.java
adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloudify/exceptions/MsoCloudifyTest.java
adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloudify/exceptions/MsoCloudifyTimeoutTest.java
adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloudify/exceptions/MsoCloudifyWorkflowExceptionTest.java

index d4389bf..1521d11 100644 (file)
@@ -1,33 +1,39 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.openecomp.mso.cloudify.exceptions;
-
-import org.junit.Test;
-
-public class MsoCloudifyExceptionTest {
-
-    MsoCloudifyException msoCloudifyException = new MsoCloudifyException(0, "test", "test");
-
-    @Test
-    public void setPendingWorkflow() throws Exception {
-        msoCloudifyException.setPendingWorkflow(true);
-    }
-
-}
\ No newline at end of file
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+*     http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+package org.openecomp.mso.cloudify.exceptions;\r
+\r
+import static org.junit.Assert.*;\r
+\r
+import org.junit.Test;\r
+\r
+public class MsoCloudifyExceptionTest {\r
+       \r
+       @Test\r
+    public void test() {\r
+        Exception e = null;\r
+        boolean pendingWorkflow=true;\r
+        MsoCloudifyException mce=new MsoCloudifyException(200, "message", "detail");\r
+        MsoCloudifyException mcl=new MsoCloudifyException(200, "message", "detail", e);\r
+        mce.setPendingWorkflow(pendingWorkflow);\r
+        assert(mcl.toString()!=null);\r
+    }\r
+\r
+}\r
index 098a3dc..1646f53 100644 (file)
@@ -24,8 +24,8 @@ import static org.junit.Assert.*;
 import org.junit.Test;\r
 \r
 public class MsoCloudifyTest {\r
-\r
-    @Test\r
+    \r
+       @Test\r
     public void test() {\r
         MsoBlueprintAlreadyExists mbae=new MsoBlueprintAlreadyExists("blueprintId", "cloud");\r
         MsoCloudifyManagerNotFound mcm=new MsoCloudifyManagerNotFound("cloudSiteId");\r
index 64b8823..f24db06 100644 (file)
@@ -1,34 +1,38 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- * ================================================================================
- * 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.openecomp.mso.cloudify.exceptions;
-
-import org.junit.Test;
-import org.openecomp.mso.cloudify.v3.model.Execution;
-
-public class MsoCloudifyTimeoutTest {
-
-    MsoCloudifyTimeout msoCloudifyTimeout = new MsoCloudifyTimeout(new Execution());
-
-    @Test
-    public void getExecution() throws Exception {
-        msoCloudifyTimeout.getExecution();
-    }
-
-}
\ No newline at end of file
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : SO\r
+* ================================================================================\r
+* Copyright 2018 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+*     http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+package org.openecomp.mso.cloudify.exceptions;\r
+\r
+import static org.junit.Assert.*;\r
+import static org.mockito.Mockito.mock;\r
+\r
+import org.junit.Test;\r
+import org.openecomp.mso.cloudify.v3.model.Execution;\r
+\r
+public class MsoCloudifyTimeoutTest {\r
+    \r
+       @Test\r
+    public void test() {\r
+        Execution execution=mock(Execution.class);\r
+        MsoCloudifyTimeout mct=new MsoCloudifyTimeout(execution);\r
+        mct.getExecution();\r
+        assert(mct.toString()!=null);\r
+    }\r
+\r
+}\r
index 34f0396..985066c 100644 (file)
@@ -24,8 +24,8 @@ import static org.junit.Assert.*;
 import org.junit.Test;\r
 \r
 public class MsoCloudifyWorkflowExceptionTest {\r
-\r
-    @Test\r
+       \r
+       @Test\r
     public void test() {\r
         MsoCloudifyWorkflowException mcw=new MsoCloudifyWorkflowException("message", "id", "workflowId", "workflowStatus");\r
         mcw.getWorkflowStatus();\r