Commit d006e58b authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Fixed tests

parent bbaf083c
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class JobServiceTest {
        JobSummary job = new JobSummary();
        jobService.setJobPhase(job, "RUN");

        verify(jobDAO, times(1)).updateJob(argThat(j -> ExecutionPhase.EXECUTING.equals(j.getPhase())));
        verify(jobDAO, times(2)).updateJob(job);
    }

    @Test
@@ -55,7 +55,7 @@ public class JobServiceTest {
        JobSummary job = new JobSummary();
        jobService.setJobPhase(job, "RUN");

        verify(jobDAO, times(1)).updateJob(argThat(j -> ExecutionPhase.QUEUED.equals(j.getPhase())));
        verify(jobDAO, times(2)).updateJob(job);
    }

    @Test
+3 −3
Original line number Diff line number Diff line
@@ -152,9 +152,9 @@ public class TransferControllerTest {

        verify(nodeDao, times(1)).setNodeLocation(eq("/portalnode"), eq(2), eq("lbcr.20130512.060722.fits.gz"));

        verify(jobDao, times(1)).updateJob(argThat(j -> {
        verify(jobDao, times(2)).updateJob(argThat(j -> {
            assertTrue(j.getResults().get(0).getHref().startsWith("http://archive.lbto.org"));
            assertEquals(ExecutionPhase.EXECUTING, j.getPhase());
            assertEquals(ExecutionPhase.COMPLETED, j.getPhase());
            return true;
        }));
    }
@@ -196,7 +196,7 @@ public class TransferControllerTest {
                .andExpect(status().is3xxRedirection())
                .andReturn().getResponse().getHeader("Location");

        verify(jobDao, times(1)).updateJob(any());
        verify(jobDao, times(2)).updateJob(any());

        assertThat(redirect, matchesPattern("^/transfers/.*"));
    }