use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method testInvalidKey.
@Test(expectedExceptions = YamlInvalidSyntaxException.class)
public void testInvalidKey() {
BaseFileReader reader = new BaseFileReader();
reader.read("invalid_yaml5.txt");
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method readSpaces.
@Test
public void readSpaces() {
BaseFileReader reader = new BaseFileReader();
Properties properties = reader.read("application.yaml");
System.out.println(properties);
assert properties.get("include.profiles").equals("local,alpha");
assert properties.get("cors.allow_origin").equals("*");
assert properties.get("cors.enable").equals("true");
assert properties.get("server.port").equals("3005");
assert properties.get("server.host").equals("0.0.0.0");
assert properties.get("server.admin.username").equals("admin");
assert properties.get("server.admin.password").equals("123456");
assert properties.get("hello").equals("world");
assert properties.get("foo").equals("bar");
properties = reader.read("hello_yaml");
assert properties.get("hello").equals("world");
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method readInvalidYamlFileLastPropertyKeyIsNull.
@Test
public void readInvalidYamlFileLastPropertyKeyIsNull() {
// given
BaseFileReader sut = new BaseFileReader();
// when
Throwable e = Asserts.assertThrows(() -> sut.read("v112_application_invalid.yaml"));
// then
Asserts.assertEquals(YamlInvalidSyntaxException.class, e.getClass());
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method testInvalidSpaces.
@Test
public void testInvalidSpaces() {
BaseFileReader reader = new BaseFileReader();
Properties properties = reader.read("invalid_yaml3.txt");
System.out.println("testInvalidSpaces: " + properties);
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method readInvalidYamlFileLastSpaceCountEqualsLastSpaceCount.
@Test
public void readInvalidYamlFileLastSpaceCountEqualsLastSpaceCount() {
// given
BaseFileReader sut = new BaseFileReader();
// when
Throwable e = Asserts.assertThrows(() -> sut.read("v112_application_invalid2.yaml"));
// then
Asserts.assertEquals(YamlInvalidSyntaxException.class, e.getClass());
}
Aggregations