use of com.thoughtworks.go.server.web.i18n.ResolvableViewableStatus in project gocd by gocd.
the class JsonViewTest method testShouldRenderI18n.
@Test
public void testShouldRenderI18n() {
Map<String, Object> map = new LinkedHashMap<>();
final String i18nMessage = "waiting(zh_CN)";
final ResolvableViewableStatus resolvableViewableStatus = new ResolvableViewableStatus(WAITING);
map.put("key1", resolvableViewableStatus);
JsonView view = new JsonView(requestContext);
mockContext.checking(new Expectations() {
{
one(requestContext).getMessage(with(equal(resolvableViewableStatus)));
will(returnValue(i18nMessage));
}
});
String json = view.renderJson(map);
mockContext.assertIsSatisfied();
new JsonTester(json).is("{ 'key1' : '" + i18nMessage + "' }");
}
Aggregations