use of org.infobip.mobile.messaging.api.geo.EventReportResponse in project mobile-messaging-sdk-android by infobip.
the class GeoReportHelperTest method test_should_filter_reports_for_inactive_campaigns.
@Test
public void test_should_filter_reports_for_inactive_campaigns() throws Exception {
// Given
Area area = createArea("areaId");
EventReportResponse reportResponse = new EventReportResponse();
reportResponse.setFinishedCampaignIds(Sets.newSet("campaignId1"));
reportResponse.setSuspendedCampaignIds(Sets.newSet("campaignId2"));
createMessage(context, "signalingMessageId1", "campaignId1", true, area);
createMessage(context, "signalingMessageId2", "campaignId2", true, area);
createMessage(context, "signalingMessageId3", "campaignId3", true, area);
GeoReportingResult geoReportingResult = new GeoReportingResult(reportResponse);
List<GeoReport> reports = Arrays.asList(createReport(context, "signalingMessageId1", "campaignId1", "sdkMessageId1", false, area), createReport(context, "signalingMessageId2", "campaignId2", "sdkMessageId2", false, area), createReport(context, "signalingMessageId3", "campaignId3", "sdkMessageId3", false, area));
// When
List<GeoReport> filtered = GeoReportHelper.filterOutNonActiveReports(context, reports, geoReportingResult);
// Then
assertJEquals(reports.get(2), filtered.get(0));
}
Aggregations