@Test
public void shouldNotFailInCaseLogMessageHasNoText() throws Exception {
final Map<String, Object> infoLog = new HashMap<String, Object>() {{
put(MSG_LEVEL.key(), "INFO");
put(MSG_TEXT.key(), "Some text");
put(MSG_TS.key(), new Date());
}};
final Map<String, Object> errorLog = new HashMap<String, Object>() {{
put(MSG_LEVEL.key(), "ERROR");
put(MSG_TEXT.key(), null);
put(MSG_TS.key(), new Date());
}};
final Document infoLogDocument = new Document(infoLog);
final Document errorLogDocument = new Document(errorLog);
final Map<String, Object> jobLogs = new HashMap<String, Object>() {{
put(MESSAGES.key(), asList(infoLogDocument, errorLogDocument));
put(JOB_TYPE.key(), "SomeType");
put(ID.key(), "/SomeType/ID");
put(STATUS.key(), ERROR.toString());
}};
final JobInfo jobInfo = repo.decode(new Document(jobLogs));
assertThat(jobInfo.getMessages().size(), is(2));
}