HistoryDataItem { public int getScriptCount() { if (history.getSingleResults() == null) { return 0; } return history.getSingleResults().size(); }  @PostConstruct void setup(); String getDate(); String getDuration(); String getStatusIcon(); String getStatusColor(); String getPath(); int getScriptCount();  }
@Test public void getScriptCount_null() { int count = item.getScriptCount(); assertEquals(0, count); }
@Test public void getScriptCount_nonNull() { ExecutionResult result = mock(ExecutionResult.class); List<ExecutionResult> results = Arrays.asList(result); when(history.getSingleResults()).thenReturn(results); int count = item.getScriptCount(); assertEquals(1, count); }