Calendar timestamp = mock(Calendar.class);
when(build.getTimestamp()).thenReturn(timestamp);
when(timestamp.getTimeInMillis()).thenReturn(startedAt);
return this;
}
<BUG>public BuildStateRecipe andTook(int minutes) throws Exception{
</BUG>
long duration = (long) minutes * 60 * 1000;
when(build.getDuration()).thenReturn(duration);
return this;

Calendar timestamp = mock(Calendar.class);
when(build.getTimestamp()).thenReturn(timestamp);
when(timestamp.getTimeInMillis()).thenReturn(startedAt);
return this;
}
public BuildStateRecipe took(int minutes) throws Exception{
long duration = (long) minutes * 60 * 1000;
when(build.getDuration()).thenReturn(duration);
return this;
