From 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e Mon Sep 17 00:00:00 2001 From: Marcus G K Williams Date: Wed, 7 Mar 2018 18:17:22 -0800 Subject: Reduce log noise/warnings format to conventions Reduce build log warnings by formatting tests to ONAP code conventions (removing tabs etc.) Issue-ID: SO-368 Change-Id: I48c6d359b83617aebeb79db4e30c1d72d31f7eec Signed-off-by: Marcus G K Williams --- .../tests/MsoHeatUtilsWithUpdateTest.java | 77 +++++++++++----------- 1 file changed, 39 insertions(+), 38 deletions(-) (limited to 'adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java') diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java index 62043e83b8..47ffff8941 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; + import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -50,86 +51,86 @@ import com.woorea.openstack.base.client.OpenStackConnectException; @RunWith(MockitoJUnitRunner.class) public class MsoHeatUtilsWithUpdateTest { - public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - public static CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); - + public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); + public static CloudConfigFactory cloudConfigFactory = new CloudConfigFactory(); + @Mock CloudConfig cloudConfig; @InjectMocks - MsoHeatUtilsWithUpdate util=new MsoHeatUtilsWithUpdate("NO_PROP",msoPropertiesFactory,cloudConfigFactory); + MsoHeatUtilsWithUpdate util = new MsoHeatUtilsWithUpdate("NO_PROP", msoPropertiesFactory, cloudConfigFactory); private CloudSite cloudSite; @Before - public void init () { - cloudSite = new CloudSite (); - cloudSite.setId ("cloud"); - CloudIdentity cloudIdentity = new CloudIdentity (); + public void init() { + cloudSite = new CloudSite(); + cloudSite.setId("cloud"); + CloudIdentity cloudIdentity = new CloudIdentity(); cloudIdentity.setIdentityServerType(IdentityServerType.KEYSTONE); - cloudIdentity.setKeystoneUrl ("toto"); - cloudIdentity.setMsoPass (CloudIdentity.encryptPassword ("mockId")); - cloudSite.setIdentityService (cloudIdentity); - when(cloudConfig.getCloudSite("cloud")).thenReturn (Optional.of(cloudSite)); - when(cloudConfig.getCloudSite("none")).thenReturn (Optional.empty()); + cloudIdentity.setKeystoneUrl("toto"); + cloudIdentity.setMsoPass(CloudIdentity.encryptPassword("mockId")); + cloudSite.setIdentityService(cloudIdentity); + when(cloudConfig.getCloudSite("cloud")).thenReturn(Optional.of(cloudSite)); + when(cloudConfig.getCloudSite("none")).thenReturn(Optional.empty()); } @Test @Ignore - public void testUpdateStack () { + public void testUpdateStack() { // Heat heat = Mockito.mock (Heat.class); - Map stackInputs = new HashMap <> (); + Map stackInputs = new HashMap<>(); try { - util.updateStack ("none", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1); + util.updateStack("none", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1); } catch (MsoException e) { if (e instanceof MsoCloudSiteNotFound) { // Ok } else { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } try { - util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1); + util.updateStack("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1); } catch (MsoException e) { - if (e instanceof MsoIOException && e.getCause () != null - && e.getCause () instanceof OpenStackConnectException) { + if (e instanceof MsoIOException && e.getCause() != null + && e.getCause() instanceof OpenStackConnectException) { // Ok, we were able to go up to the connection to OpenStack } else { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } try { - util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment"); + util.updateStack("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment"); } catch (MsoException e) { - if (e instanceof MsoIOException && e.getCause () != null - && e.getCause () instanceof OpenStackConnectException) { + if (e instanceof MsoIOException && e.getCause() != null + && e.getCause() instanceof OpenStackConnectException) { // Ok, we were able to go up to the connection to OpenStack } else { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } try { - util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null); + util.updateStack("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null); } catch (MsoException e) { - if (e instanceof MsoIOException && e.getCause () != null - && e.getCause () instanceof OpenStackConnectException) { + if (e instanceof MsoIOException && e.getCause() != null + && e.getCause() instanceof OpenStackConnectException) { // Ok, we were able to go up to the connection to OpenStack } else { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } try { - util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null, null); + util.updateStack("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null, null); } catch (MsoException e) { - if (e instanceof MsoIOException && e.getCause () != null - && e.getCause () instanceof OpenStackConnectException) { + if (e instanceof MsoIOException && e.getCause() != null + && e.getCause() instanceof OpenStackConnectException) { // Ok, we were able to go up to the connection to OpenStack } else { - e.printStackTrace (); - fail ("Exception caught"); + e.printStackTrace(); + fail("Exception caught"); } } } -- cgit 1.2.3-korg