From a16f7063b38184086e5f749f8a0cdc671a2bfdf2 Mon Sep 17 00:00:00 2001 From: Lathishbabu Ganesan Date: Wed, 27 Feb 2019 09:06:57 -0500 Subject: Additional test case to cover Reboot scenario Issue-ID: APPC-1507 Change-Id: I1afa62d34bec6cc3bb56abd4fa5ffc9a5beee67a Signed-off-by: Lathishbabu Ganesan --- .../adapter/iaas/impl/TestProviderAdapterImpl.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'appc-adapters') diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/impl/TestProviderAdapterImpl.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/impl/TestProviderAdapterImpl.java index 30c7aa729..701258543 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/impl/TestProviderAdapterImpl.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/test/java/org/onap/appc/adapter/iaas/impl/TestProviderAdapterImpl.java @@ -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); -- cgit 1.2.3-korg