@Test public void shouldFormatRuntimeLessThan24Hours() throws Exception { final JobInfo job = jobInfoWithRuntime(23, ChronoUnit.HOURS); JobRepresentation jobRepresentation = representationOf(job, null, true, "", ""); assertThat(jobRepresentation.getRuntime(), is("23:00:00")); }
@Test public void shouldCalculateRuntime() throws InterruptedException { final JobInfo job = jobInfoWithRuntime(90, ChronoUnit.SECONDS); final JobRepresentation jobRepresentation = representationOf(job, null, true, "", ""); assertThat(jobRepresentation.getStatus(), is("OK")); assertThat(jobRepresentation.getRuntime(), is("00:01:30")); assertThat(jobRepresentation.getHostname(), is("localhost")); }
@Test public void shouldFormatRuntimeBiggerThan24Hours() throws Exception { final JobInfo job = jobInfoWithRuntime(25, ChronoUnit.HOURS); JobRepresentation jobRepresentation = representationOf(job, null, true, "", ""); assertThat(jobRepresentation.getRuntime(), is("> 24h")); }