20
20
import org .junit .Before ;
21
21
import org .junit .runner .RunWith ;
22
22
import org .mockito .Mock ;
23
+ import org .mockito .MockitoAnnotations ;
23
24
import org .slf4j .Logger ;
24
25
import org .slf4j .LoggerFactory ;
25
26
import org .springframework .beans .factory .annotation .Autowired ;
26
27
import org .springframework .boot .test .context .SpringBootTest ;
28
+ import org .springframework .test .context .TestExecutionListeners ;
27
29
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
30
+ import org .springframework .test .context .support .DependencyInjectionTestExecutionListener ;
28
31
29
32
import com .ericsson .ei .erqueryservice .ERQueryService ;
30
33
import com .ericsson .ei .erqueryservice .SearchOption ;
48
51
import static org .mockito .Mockito .when ;
49
52
50
53
@ RunWith (SpringJUnit4ClassRunner .class )
54
+ @ TestExecutionListeners (listeners = { DependencyInjectionTestExecutionListener .class ,
55
+ SingleEventAggregationTest .class })
51
56
@ SpringBootTest
52
57
public class SingleEventAggregationTest extends FlowTestBase {
53
- private static final Logger LOGGER = LoggerFactory .getLogger (FlowTest .class );
54
-
58
+ private static final Logger LOGGER = LoggerFactory .getLogger (SingleEventAggregationTest .class );
59
+
55
60
private static final String RULES_FILE_PATH = "src/test/resources/all_event_rules.json" ;
56
61
private static final String EVENTS_FILE_PATH = "src/test/resources/test_All_Events.json" ;
57
62
@@ -76,6 +81,7 @@ String getEventsFilePath() {
76
81
77
82
@ Before
78
83
public void before () {
84
+ MockitoAnnotations .initMocks (this );
79
85
upStreamEventsHandler .setEventRepositoryQueryService (erQueryService );
80
86
// MockitoAnnotations.initMocks(this);
81
87
when (erQueryService .getEventStreamDataById (anyString (), any (SearchOption .class ), anyInt (), anyInt (),
0 commit comments