コード例 #1
0
  @Test
  public void shouldExecuteOnRootProjectWithAllParams() throws Exception {
    Project project = mock(Project.class);
    when(project.isRoot()).thenReturn(true).thenReturn(false);

    assertThat(sensor.shouldExecuteOnProject(project)).isEqualTo(true);
  }
コード例 #2
0
  @Test
  public void shouldNotExecuteOnRootProjectifOneParamMissing() throws Exception {
    Project project = mock(Project.class);
    when(project.isRoot()).thenReturn(true).thenReturn(false);

    settings.removeProperty(JiraConstants.SERVER_URL_PROPERTY);
    sensor = new JiraSensor(settings);

    assertThat(sensor.shouldExecuteOnProject(project)).isEqualTo(false);
  }
コード例 #3
0
 @Test
 public void shouldNotExecuteOnNonRootProject() throws Exception {
   assertThat(sensor.shouldExecuteOnProject(mock(Project.class))).isEqualTo(false);
 }