mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
verify encoding and content type
This commit is contained in:
@@ -194,6 +194,8 @@ public class I18nServletTest {
|
||||
assertJson(json);
|
||||
verify(cache).get(path);
|
||||
verify(cache).put(eq(path), any());
|
||||
|
||||
verifyHeaders(response);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -221,6 +223,8 @@ public class I18nServletTest {
|
||||
verify(cache, never()).put(eq(path), any());
|
||||
verify(cache).get(path);
|
||||
assertJson(json);
|
||||
|
||||
verifyHeaders(response);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -234,6 +238,11 @@ public class I18nServletTest {
|
||||
assertJson(jsonNodeOptional.orElse(null));
|
||||
}
|
||||
|
||||
private void verifyHeaders(HttpServletResponse response) {
|
||||
verify(response).setCharacterEncoding("UTF-8");
|
||||
verify(response).setContentType("application/json");
|
||||
}
|
||||
|
||||
public void assertJson(JsonNode actual) throws IOException {
|
||||
assertJson(actual.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user