diff options
author | lapentafd <francesco.lapenta@est.tech> | 2021-12-07 15:59:49 +0000 |
---|---|---|
committer | lapentafd <francesco.lapenta@est.tech> | 2021-12-08 11:07:03 +0000 |
commit | 5f46449a3a73a101fb6e7926dd48e1672ad3ed7b (patch) | |
tree | 453e33798d38515ef4a864f1095452946d7d0d5e /plugins/reception-plugins/src/test/java/org | |
parent | eed3e8be1194b4b9a9e1001fa24edbd024b18378 (diff) |
Moving @NotNull annotation to field level
KeyStorePassword and KeyStorePath values
can be expressed as simply null instead of "null"
Issue-ID: POLICY-3604
Change-Id: I839bce33df4829fcc8d604f8ed1e52e6f50ef988
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
Diffstat (limited to 'plugins/reception-plugins/src/test/java/org')
-rw-r--r-- | plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandlerConfigurationParameterGroup.java | 20 |
1 files changed, 19 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; |