aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'utils/src/test')
-rw-r--r--utils/src/test/java/org/onap/policy/common/utils/properties/BeanConfiguratorTest.java25
1 files changed, 8 insertions, 17 deletions
diff --git a/utils/src/test/java/org/onap/policy/common/utils/properties/BeanConfiguratorTest.java b/utils/src/test/java/org/onap/policy/common/utils/properties/BeanConfiguratorTest.java
index 07e0795f..5fb92f8e 100644
--- a/utils/src/test/java/org/onap/policy/common/utils/properties/BeanConfiguratorTest.java
+++ b/utils/src/test/java/org/onap/policy/common/utils/properties/BeanConfiguratorTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP - Common Modules
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,6 +80,10 @@ public class BeanConfiguratorTest {
@Test
public void testConfigureFromProperties() throws PropertyException {
+ testStringValueNoDefault();
+ }
+
+ private void testStringValueNoDefault() throws PropertyException {
props.setProperty(THE_VALUE, STRING_VALUE);
PlainStringConfig cfg = new PlainStringConfig();
@@ -177,11 +181,7 @@ public class BeanConfiguratorTest {
@Test
public void testSetValueObjectFieldProperties_FieldSet() throws PropertyException {
- props.setProperty(THE_VALUE, STRING_VALUE);
- PlainStringConfig cfg = new PlainStringConfig();
- beancfg.configureFromProperties(cfg, props);
-
- assertEquals(STRING_VALUE, cfg.value);
+ testStringValueNoDefault();
}
@Test
@@ -500,11 +500,7 @@ public class BeanConfiguratorTest {
@Test
public void testGetStringValue() throws PropertyException {
- props.setProperty(THE_VALUE, STRING_VALUE);
- PlainStringConfig cfg = new PlainStringConfig();
- beancfg.configureFromProperties(cfg, props);
-
- assertEquals(STRING_VALUE, cfg.value);
+ testStringValueNoDefault();
}
@Test
@@ -721,12 +717,7 @@ public class BeanConfiguratorTest {
@Test
public void testGetPropValue_Prop_NoDefault() throws PropertyException {
- props.setProperty(THE_VALUE, STRING_VALUE);
-
- PlainStringConfig cfg = new PlainStringConfig();
- beancfg.configureFromProperties(cfg, props);
-
- assertEquals(STRING_VALUE, cfg.value);
+ testStringValueNoDefault();
}
@Test