added test case to ProviderOperationFactoryTest 59/78459/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 14 Feb 2019 09:58:27 +0000 (15:28 +0530)
committerTakamune Cho <takamune.cho@att.com>
Thu, 14 Feb 2019 14:16:45 +0000 (14:16 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Ic6f8fcebd31b111fdfc194e55bc74f8d8ac6f1fa
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/provider/operation/api/ProviderOperationFactoryTest.java

index abfa132..2cd7393 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2018 Nokia Intellectual Property. All rights reserved.
  * =============================================================================
+ * Modifications Copyright (C) 2019 IBM.
+ * =============================================================================
  * 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
@@ -38,12 +40,14 @@ import static org.onap.appc.adapter.iaas.provider.operation.common.enums.Operati
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.onap.appc.adapter.iaas.provider.operation.common.enums.Operation;
 import org.onap.appc.adapter.iaas.provider.operation.impl.AttachVolumeServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.CreateSnapshot;
 import org.onap.appc.adapter.iaas.provider.operation.impl.DettachVolumeServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.EvacuateServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.LookupServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.MigrateServer;
+import org.onap.appc.adapter.iaas.provider.operation.impl.RebootServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.RebuildServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.RestartServer;
 import org.onap.appc.adapter.iaas.provider.operation.impl.RestoreStack;
@@ -191,5 +195,14 @@ public class ProviderOperationFactoryTest {
 
         Assert.assertTrue(operation instanceof DettachVolumeServer);
     }
+    
+    @Test
+    public void should_return_reboot_service_operation() throws APPCException {
+        IProviderOperation operation = ProviderOperationFactory
+            .getInstance()
+            .getOperationObject(Operation.REBOOT_SERVICE);
+
+        Assert.assertTrue(operation instanceof RebootServer);
+    }
 
 }
\ No newline at end of file