HistoryDataItem { public String getStatusColor() { if (RESULT.FAILURE.equals(history.getResult())) { return "fail"; } if (RESULT.SUCCESS.equals(history.getResult())) { return "ok"; } return "inprogress"; }  @PostConstruct void setup(); String getDate(); String getDuration(); String getStatusIcon(); String getStatusColor(); String getPath(); int getScriptCount();  }
@Test public void getStatusColor_success() { when(history.getResult()).thenReturn(RESULT.SUCCESS); String icon = item.getStatusColor(); assertTrue(StringUtils.isNotBlank(icon)); }
@Test public void getStatusColor_fail() { when(history.getResult()).thenReturn(RESULT.FAILURE); String icon = item.getStatusColor(); assertTrue(StringUtils.isNotBlank(icon)); }
@Test public void getStatusColor_unknown() { when(history.getResult()).thenReturn(RESULT.UNKNOWN); String icon = item.getStatusColor(); assertTrue(StringUtils.isNotBlank(icon)); }