X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-persister-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fpersist%2Fimpl%2FPersisterAggregatorTest.java;h=f17626783da8af39cebb28dbb2dc06aded8aacc2;hp=cf183b8f3d480b5640c6f53e6bb71eb44c64063c;hb=dfc4bf9604f126da4ab2adbd3f782371ef18430f;hpb=f37b6184effa1d421c602da425903ab8d4b02ba7 diff --git a/opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/PersisterAggregatorTest.java b/opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/PersisterAggregatorTest.java index cf183b8f3d..f17626783d 100644 --- a/opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/PersisterAggregatorTest.java +++ b/opendaylight/config/config-persister-impl/src/test/java/org/opendaylight/controller/config/persist/impl/PersisterAggregatorTest.java @@ -38,33 +38,33 @@ public class PersisterAggregatorTest { private final Properties prop; - public TestingPropertiesProvider(Properties prop) { + public TestingPropertiesProvider(final Properties prop) { super(null); this.prop = prop; } - public static TestingPropertiesProvider loadFile(String fileName) { + public static TestingPropertiesProvider loadFile(final String fileName) { Properties prop = new Properties(); try { prop.load(TestingPropertiesProvider.class.getClassLoader().getResourceAsStream(fileName)); - } catch (IOException e) { + } catch (final IOException e) { throw new RuntimeException(e); } return new TestingPropertiesProvider(prop); } @Override - public String getFullKeyForReporting(String key) { + public String getFullKeyForReporting(final String key) { return ConfigPersisterActivator.NETCONF_CONFIG_PERSISTER + "." + key; } @Override - public String getProperty(String key) { + public String getProperty(final String key) { return prop.getProperty(getFullKeyForReporting(key)); } @Override - public String getPropertyWithoutPrefix(String fullKey){ + public String getPropertyWithoutPrefix(final String fullKey){ return prop.getProperty(fullKey); } } @@ -127,20 +127,20 @@ public class PersisterAggregatorTest { try { PersisterAggregator.createFromProperties(TestingPropertiesProvider.loadFile("test3.properties")); fail(); - } catch (RuntimeException e) { + } catch (final RuntimeException e) { assertThat( e.getMessage(), containsString("numberOfBackups property should be either set to positive value, or ommited. Can not be set to 0.")); } } - private ConfigSnapshotHolder mockHolder(String name){ + private ConfigSnapshotHolder mockHolder(final String name){ ConfigSnapshotHolder result = mock(ConfigSnapshotHolder.class); doReturn("mock:" + name).when(result).toString(); return result; } - private Persister mockPersister(String name){ + private Persister mockPersister(final String name){ Persister result = mock(Persister.class); doReturn("mock:" + name).when(result).toString(); doNothing().when(result).close();