@Test
public void shouldSerializeI18nMessage() {
String expectedResult = "{\"category\":\"validation\",\"message\":\"you are underage\"}";
I18nMessage message = new I18nMessage("validation", "underage");
message.setBundle(ResourceBundle.getBundle("messages"));
JsonElement jsonElement = new MessageSerializer().serialize(message, mock(Type.class), mock(JsonSerializationContext.class));
assertEquals(expectedResult, jsonElement.getAsJsonObject().toString());
}