Code example for Time

Methods: setToNow, toMillis

0
 
@RunWith(TestRunners.WithDefaults.class) 
public class TimeTest { 
    @Test 
    public void shouldSetToNow() throws Exception { 
        Time t = new Time();
        t.setToNow();
        assertThat(t.toMillis(false)).isNotEqualTo(0l);
    } 
 
    @Test 
    public void shouldHaveNoArgsConstructor() throws Exception { 
        Time t = new Time();
        assertNotNull(t.timezone);
    } 
 
    @Test 
    public void shouldHaveCopyConstructor() throws Exception { 
        Time t = new Time();
        t.setToNow();
        Time t2 = new Time(t);