11package com .baeldung .test ;
22
3- import com .baeldung .spring .configuration .AppConfig ;
4- import com .baeldung .spring .service .SpringSuperService ;
3+ import static org .hamcrest .CoreMatchers .is ;
4+
5+ import java .util .List ;
6+
57import org .junit .Assert ;
68import org .junit .Test ;
79import org .junit .runner .RunWith ;
810import org .springframework .beans .factory .annotation .Autowired ;
911import org .springframework .test .context .ContextConfiguration ;
10- import org .springframework .test .context .TestExecutionListeners ;
1112import org .springframework .test .context .junit4 .SpringRunner ;
12- import org .springframework .test .context .support .DependencyInjectionTestExecutionListener ;
13- import org .springframework .test .context .support .DirtiesContextTestExecutionListener ;
14- import org .springframework .test .context .transaction .TransactionalTestExecutionListener ;
1513
16- import javax .inject .Inject ;
17- import java .util .List ;
18-
19- import static org .hamcrest .CoreMatchers .is ;
14+ import com .baeldung .spring .configuration .AppConfig ;
15+ import com .baeldung .spring .service .SpringSuperService ;
2016
2117@ RunWith (SpringRunner .class )
22- @ ContextConfiguration (classes = {AppConfig .class })
18+ @ ContextConfiguration (classes = { AppConfig .class })
2319public class TestSpringInterceptor {
2420 @ Autowired
2521 SpringSuperService springSuperService ;
@@ -28,11 +24,11 @@ public class TestSpringInterceptor {
2824 private List <String > accumulator ;
2925
3026 @ Test
31- public void givenService_whenServiceAndAspectExecuted_thenOk (){
27+ public void givenService_whenServiceAndAspectExecuted_thenOk () {
3228 String code = "123456" ;
3329 String result = springSuperService .getInfoFromService (code );
3430 Assert .assertThat (accumulator .size (), is (2 ));
35- Assert .assertThat (accumulator .get (0 ),is ("Call to getInfoFromService" ));
36- Assert .assertThat (accumulator .get (1 ),is ("Method called successfully: getInfoFromService" ));
31+ Assert .assertThat (accumulator .get (0 ), is ("Call to getInfoFromService" ));
32+ Assert .assertThat (accumulator .get (1 ), is ("Method called successfully: getInfoFromService" ));
3733 }
3834}
0 commit comments