コード例 #1
0
  @Test
  public void shouldGetAllResult() throws Exception {
    final Map<String, MonitorResult> map = new HashMap<String, MonitorResult>();
    given(monitorFactory.runAll()).willReturn(map);

    final Map<String, MonitorResult> resultMap = controller.runAll();

    assertThat(resultMap, is(map));
  }
コード例 #2
0
  @Test
  public void testGetConfig() throws Exception {
    final Monitoring monitoring = new Monitoring();
    given(monitorFactory.getMonitoring()).willReturn(monitoring);

    final Monitoring config = controller.getConfig();

    assertThat(config, is(monitoring));
  }
コード例 #3
0
  @Test
  public void shouldGetRunResultById() throws Exception {
    final MonitorResult monitorResult = new MonitorResult(true, "", 100);
    final String id = UUID.randomUUID().toString();
    given(monitorFactory.run(id)).willReturn(monitorResult);

    final MonitorResult result = controller.run(id);

    assertThat(result, is(monitorResult));
  }