diff options
Diffstat (limited to 'plugins/reception-plugins/src/test')
2 files changed, 46 insertions, 1 deletions
diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandlerConfigurationParameterGroup.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandlerConfigurationParameterGroup.java index cd7f2614..06f6d9e6 100644 --- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandlerConfigurationParameterGroup.java +++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandlerConfigurationParameterGroup.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Intel. All rights reserved. - * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2019-2021 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -69,6 +69,24 @@ public class TestSdcReceptionHandlerConfigurationParameterGroup { } @Test + public void testSdcConfigurationNullParameters() throws IOException { + SdcReceptionHandlerConfigurationParameterGroup configParameters = null; + final Gson gson = new GsonBuilder().create(); + configParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdc-null-parameters.json"), + SdcReceptionHandlerConfigurationParameterGroup.class); + + final ValidationResult validationResult = configParameters.validate(); + assertTrue(validationResult.isValid()); + final SdcConfiguration config = new SdcConfiguration(configParameters); + assertEquals(null, config.getKeyStorePath()); + assertEquals(null, config.getKeyStorePassword()); + //if boolean parameters are null they are set to false + assertEquals(false, config.activateServerTLSAuth()); + assertEquals(false, config.isFilterInEmptyResources()); + assertEquals(false, config.isUseHttpsWithDmaap()); + } + + @Test public void testInvalidSdcConfiguration() throws IOException { SdcReceptionHandlerConfigurationParameterGroup configParameters = null; diff --git a/plugins/reception-plugins/src/test/resources/handling-sdc-null-parameters.json b/plugins/reception-plugins/src/test/resources/handling-sdc-null-parameters.json new file mode 100644 index 00000000..6c9301a5 --- /dev/null +++ b/plugins/reception-plugins/src/test/resources/handling-sdc-null-parameters.json @@ -0,0 +1,27 @@ +{ + "name" : "parameterConfig1", + "asdcAddress": "localhost", + "messageBusAddress": [ + "a.com", + "b.com", + "c.com" + ], + "user": "policy", + "password": "policy", + "pollingInterval":20, + "pollingTimeout":30, + "retryDelay":30, + "consumerId": "policy-id", + "artifactTypes": [ + "TOSCA_CSAR", + "HEAT" + ], + "consumerGroup": "policy-group", + "environmentName": "TEST", + "keyStorePath": null, + "keyStorePassword": null, + "activeServerTlsAuth": null, + "isFilterInEmptyResources": null, + "isUseHttpsWithDmaap": null +} + |