Skip to content

Commit

Permalink
[DSC-1053] Fixes StatisticsRestRepositoryIT failure
Browse files Browse the repository at this point in the history
  • Loading branch information
vins01-4science committed Nov 29, 2023
1 parent f663ab8 commit 190c2e2
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ public void totalVisitsReport_Collection_NotVisited() throws Exception {
@Test
public void totalVisitsReport_Item_Visited() throws Exception {

Thread.sleep(1000);

this.statisticsEventListener.addConsumer(
throwingConsumerWrapper((event) -> {
// And request that collection's TotalVisits stat report
Expand Down Expand Up @@ -825,7 +827,7 @@ public void totalVisitsPerMonthReport_Collection_Visited() throws Exception {
.contentType(contentType))
.andExpect(status().isCreated());

Thread.sleep(1000);
Thread.sleep(3000);

this.statisticsEventListener.addConsumer(
throwingConsumerWrapper((event) -> {
Expand Down Expand Up @@ -921,12 +923,8 @@ public void TotalDownloadsReport_Bitstream() throws Exception {

@Test
public void TotalDownloadsReport_Item() throws Exception {
// ** WHEN **
// We visit an Item's bitstream
ViewEventRest viewEventRest = new ViewEventRest();
viewEventRest.setTargetType("bitstream");
viewEventRest.setTargetId(bitstreamVisited.getID());

Thread.sleep(1000);

this.statisticsEventListener.addConsumer(
throwingConsumerWrapper((event) -> {
Expand Down Expand Up @@ -956,6 +954,12 @@ public void TotalDownloadsReport_Item() throws Exception {
)));
}));

// ** WHEN **
// We visit an Item's bitstream
ViewEventRest viewEventRest = new ViewEventRest();
viewEventRest.setTargetType("bitstream");
viewEventRest.setTargetId(bitstreamVisited.getID());

ObjectMapper mapper = new ObjectMapper();

getClient(loggedInToken).perform(post("/api/statistics/viewevents")
Expand Down

0 comments on commit 190c2e2

Please sign in to comment.