use of ch.jalu.configme.properties.StringProperty in project AuthMeReloaded by AuthMe.
the class MigraterYamlFileResourceTest method shouldWriteWithCorrectCharset.
@Test
public void shouldWriteWithCorrectCharset() throws IOException {
// given
File file = temporaryFolder.newFile();
Files.copy(TestHelper.getJarFile(CHINESE_MESSAGES_FILE), file);
MigraterYamlFileResource resource = new MigraterYamlFileResource(file);
ConfigurationData configurationData = buildConfigurationData();
configurationData.initializeValues(resource.createReader());
String newMessage = "您当前并没有任何邮箱与该账号绑定";
configurationData.setValue(new StringProperty("third", ""), newMessage);
// when
resource.exportProperties(configurationData);
// then
PropertyReader reader = resource.createReader();
assertThat(reader.getString("first"), equalTo("错误的密码"));
assertThat(reader.getString("second"), equalTo("为了验证您的身份,您需要将一个电子邮件地址与您的帐户绑定!"));
assertThat(reader.getString("third"), equalTo(newMessage));
}
Aggregations