public Configurations getConfiguration(String config) throws IOException { Configurations configurations = new Configurations(); configurations.updateGlobalConfig(Bytes.toBytes(config)); return configurations; }
public static Configurations getSampleConfigs() throws IOException { Configurations configurations = new Configurations(); configurations.updateGlobalConfig(ConfigurationsUtils.readGlobalConfigFromFile(TestConstants.SAMPLE_CONFIG_PATH)); return configurations; }
@Test public void test() throws IOException { EqualsVerifier.forClass(Configurations.class).suppress(Warning.NONFINAL_FIELDS, Warning.NULL_FIELDS).usingGetClass().verify(); Configurations configurations = new Configurations(); try { configurations.updateGlobalConfig((byte[]) null); Assert.fail("Updating a config with null should throw an IllegalStateException"); } catch(IllegalStateException e) {} Assert.assertTrue(configurations.toString() != null && configurations.toString().length() > 0); } }