_unitTestingProvider.rejectAllfurtherRequests();
}
assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
LiveDataSubscriptionResponse workingSub = null;
LiveDataSubscriptionResponse workingStrongSub = null;
for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
if (response.getRequestedSpecification().getIdentifiers().contains(working)) {
assertEquals(response.getSubscriptionResult(), LiveDataSubscriptionResult.SUCCESS);
workingSub = response;
} else if (response.getRequestedSpecification().getIdentifiers().contains(broken)) {
assertEquals(response.getSubscriptionResult(), LiveDataSubscriptionResult.INTERNAL_ERROR);
} else if (response.getRequestedSpecification().getIdentifiers().contains(workingStrong)) {
assertEquals(response.getSubscriptionResult(), LiveDataSubscriptionResult.SUCCESS);
workingStrongSub = response;
} else {
throw new Exception("Unexpected subscription response");
}
}
assertEquals(workingSub.getFullyQualifiedSpecification(), workingStrongSub.getFullyQualifiedSpecification());
assertEquals(workingSub.getTickDistributionSpecification(), workingStrongSub.getTickDistributionSpecification());
List<LiveDataValueUpdate> allUpdates = listener.getValueUpdates();
List<LiveDataValueUpdate> workingUpdates = listener.getValueUpdates(getLiveDataSpec(_liveDataClient, working));
assertEquals(allUpdates, workingUpdates);
assertFalse(_unitTestingProvider.hadToRejectRequests()); // Necessary, since exceptions are expected from the live data service
}