コード例 #1
0
  @Test
  public void testLoad_TfNotFound() {
    when(mockPropertyService.getProperty(PropertyService.PROP_TF_HOME))
        .thenReturn(StringUtils.EMPTY);
    when(TfTool.tryDetectTf()).thenReturn(null);

    form.load();
    assertEquals(StringUtils.EMPTY, form.getCurrentExecutablePath());
  }
コード例 #2
0
  @Test
  public void testLoad_TfDetected() {
    when(mockPropertyService.getProperty(PropertyService.PROP_TF_HOME))
        .thenReturn(StringUtils.EMPTY);
    when(TfTool.tryDetectTf()).thenReturn("/path/to/detected/cmd/tf");

    form.load();
    assertEquals("/path/to/detected/cmd/tf", form.getCurrentExecutablePath());
  }