コード例 #1
0
  @Test
  public void testMigrate_Job() {
    Job<?, ?> item = mock(Job.class);

    assertTrue(migrator.migrate(item));

    verify(projectMigrator, never()).migrate(any(AbstractProject.class));
    verify(jobMigrator).migrate(any(Job.class));
    verify(templateMigrator, never()).migrate(any(AbstractProject.class));
  }
コード例 #2
0
  @Test
  public void testMigrate_JobWithPublishersList() {
    Job<?, ?> item = new JobWithPublishers(jenkins, "Random Name");

    doReturn(false).when(templateMigrator).migrate(item);

    assertFalse(migrator.migrate(item));

    verify(projectMigrator, never()).migrate(any(AbstractProject.class));
    verify(jobMigrator, never()).migrate(any(Job.class));
    verify(templateMigrator).migrate(any(AbstractProject.class));
  }
コード例 #3
0
  @Test
  public void testMigrate_ItemWithTemplate() {

    Item item = mock(Item.class);

    doReturn(true).when(templateMigrator).migrate(item);

    assertTrue(migrator.migrate(item));

    verify(projectMigrator, never()).migrate(any(AbstractProject.class));
    verify(jobMigrator, never()).migrate(any(Job.class));
    verify(templateMigrator).migrate(eq(item));
  }