Additional test case to cover Reboot scenario 64/79264/3
authorLathishbabu Ganesan <lathishbabu.ganesan@ericsson.com>
Wed, 27 Feb 2019 14:06:57 +0000 (09:06 -0500)
committerTakamune Cho <takamune.cho@att.com>
Wed, 27 Feb 2019 16:56:14 +0000 (16:56 +0000)
Issue-ID: APPC-1507
Change-Id: I1afa62d34bec6cc3bb56abd4fa5ffc9a5beee67a
Signed-off-by: Lathishbabu Ganesan <lathishbabu.ganesan@ericsson.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/impl/TestProviderAdapterImpl.java

index 30c7aa7..7012585 100644 (file)
@@ -6,6 +6,8 @@
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
+ * Modifications Copyright (C) 2019 Ericsson
+ * =============================================================================
  * 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
@@ -511,6 +513,26 @@ public class TestProviderAdapterImpl {
         Server actualServer = adapter.migrateServer(params, svcContext);
         assertEquals(Server.Status.READY, actualServer.getStatus());
     }
+    
+    /**
+     * Tests that we can reboot a server
+     * 
+     * @throws ZoneException If the login cannot be performed because the principal and/or
+     *         credentials are invalid.
+     * @throws IllegalArgumentException If the principal and/or credential are null or empty, or if
+     *         the expected argument(s) are not defined or are invalid.
+     * @throws IllegalStateException If the identity service is not available or cannot be created
+     * @throws UnknownProviderException If the provider cannot be found
+     * @throws IOException if an I/O error occurs
+     * @throws APPCException If the server cannot be rebooted for some reason
+     */
+    @Test
+    public void testRebootServer()
+            throws IOException, IllegalStateException, IllegalArgumentException, ZoneException, APPCException {
+        prepareMock(Operation.REBOOT_SERVICE, Server.Status.READY);
+        Server actualServer = adapter.rebootServer(params, svcContext);
+        assertEquals(Server.Status.READY, actualServer.getStatus());
+    }
 
     private void prepareMock(Operation operation, Server.Status serverStatus) throws APPCException {
         IProviderOperation providerOperation = fetchOperation.apply(operation);