Merge pull request #992 from looly/revert-991-test_improvement

Revert "Test improvement: removed assertion roulette (test smell)"
This commit is contained in:
Golden Looly 2020-07-30 08:10:23 +08:00 committed by GitHub
commit 64bf5bc68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,16 +21,15 @@ import java.io.IOException;
public class BeetlUtilTest {
@Test
public void renderTest() throws IOException {
public void renderStrTest() throws IOException {
GroupTemplate groupTemplate = BeetlUtil.createGroupTemplate(new StringTemplateResourceLoader(), Configuration.defaultConfiguration());
Template template = BeetlUtil.getTemplate(groupTemplate, "hello,${name}");
String result = BeetlUtil.render(template, Dict.create().set("name", "hutool"));
Assert.assertEquals("hello,hutool", result);
}
@Test
public void renderFromStrTest() {
Assert.assertEquals("hello,hutool", result);
String renderFromStr = BeetlUtil.renderFromStr("hello,${name}", Dict.create().set("name", "hutool"));
Assert.assertEquals("hello,hutool", renderFromStr);
}
}