1919import static org .hamcrest .MatcherAssert .assertThat ;
2020import static org .hamcrest .Matchers .equalTo ;
2121
22-
2322@ RunWith (Arquillian .class )
2423public class ScheduleTimerBeanIntegrationTest {
2524
26- final static long TIMEOUT = 5000l ;
27- final static long TOLERANCE = 1000l ;
25+ private final static long TIMEOUT = 5000l ;
26+ private final static long TOLERANCE = 1000l ;
2827
29- @ Inject
30- TimerEventListener timerEventListener ;
28+ @ Inject TimerEventListener timerEventListener ;
3129
3230 @ Deployment
3331 public static WebArchive deploy () {
34- File [] jars = Maven .resolver ().loadPomFromFile ("pom.xml" )
35- .resolve ("com.jayway.awaitility:awaitility" )
36- .withTransitivity ().asFile ();
32+ File [] jars = Maven
33+ .resolver ()
34+ .loadPomFromFile ("pom.xml" )
35+ .resolve ("com.jayway.awaitility:awaitility" )
36+ .withTransitivity ()
37+ .asFile ();
3738
38- return ShrinkWrap .create (WebArchive .class )
39- .addAsLibraries (jars )
40- .addClasses (WithinWindowMatcher .class , TimerEvent .class , TimerEventListener .class , ScheduleTimerBean .class );
39+ return ShrinkWrap
40+ .create (WebArchive .class )
41+ .addAsLibraries (jars )
42+ .addClasses (WithinWindowMatcher .class , TimerEvent .class , TimerEventListener .class , ScheduleTimerBean .class );
4143 }
4244
4345 @ Test
@@ -46,9 +48,15 @@ public void should_receive_three_pings() {
4648 Awaitility .setDefaultTimeout (30 , TimeUnit .SECONDS );
4749 await ().untilCall (to (timerEventListener .getEvents ()).size (), equalTo (3 ));
4850
49- TimerEvent firstEvent = timerEventListener .getEvents ().get (0 );
50- TimerEvent secondEvent = timerEventListener .getEvents ().get (1 );
51- TimerEvent thirdEvent = timerEventListener .getEvents ().get (2 );
51+ TimerEvent firstEvent = timerEventListener
52+ .getEvents ()
53+ .get (0 );
54+ TimerEvent secondEvent = timerEventListener
55+ .getEvents ()
56+ .get (1 );
57+ TimerEvent thirdEvent = timerEventListener
58+ .getEvents ()
59+ .get (2 );
5260
5361 long delay = secondEvent .getTime () - firstEvent .getTime ();
5462 assertThat (delay , Matchers .is (WithinWindowMatcher .withinWindow (TIMEOUT , TOLERANCE )));
0 commit comments