diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java b/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java index 4ca5690188..8ef08057e6 100644 --- a/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java +++ b/common/src/main/java/org/onap/so/client/defaultproperties/DefaultDmaapPropertiesImpl.java @@ -35,11 +35,12 @@ public class DefaultDmaapPropertiesImpl implements DmaapProperties { public DefaultDmaapPropertiesImpl() throws IOException { File initialFile = new File("src/test/resources/dmaap.properties"); - InputStream targetStream = new FileInputStream(initialFile); Properties properties = new Properties(); - properties.load(targetStream); - this.properties = new HashMap<>(); - properties.forEach((key, value) -> this.properties.put((String) key, (String) value)); + try (InputStream targetStream = new FileInputStream(initialFile)) { + properties.load(targetStream); + this.properties = new HashMap<>(); + properties.forEach((key, value) -> this.properties.put((String) key, (String) value)); + } } @Override |