BloombergEntitlementChecker extends AbstractBloombergStaticDataProvider implements LiveDataEntitlementChecker { @Override public Map<LiveDataSpecification, Boolean> isEntitled(UserPrincipal user, Collection<LiveDataSpecification> requestedSpecifications) { Map<LiveDataSpecification, Boolean> returnValue = new HashMap<>(); for (LiveDataSpecification spec : requestedSpecifications) { boolean entitled = isEntitled(user, spec); returnValue.put(spec, entitled); } return returnValue; } BloombergEntitlementChecker(BloombergConnector bloombergConnector, ReferenceDataProvider referenceDataProvider, DistributionSpecificationResolver resolver); @Override Map<LiveDataSpecification, Boolean> isEntitled(UserPrincipal user, Collection<LiveDataSpecification> requestedSpecifications); @Override boolean isEntitled(UserPrincipal user, LiveDataSpecification requestedSpecification); boolean isEntitled(UserPrincipal user, DistributionSpecification distributionSpec);  }
@Test(enabled = false) public void entitled() throws Exception { UserPrincipal user = new UserPrincipal("6926421", InetAddress.getLocalHost().getHostAddress()); assertTrue(_entitlementChecker.isEntitled(user, DIST_SPEC.getFullyQualifiedLiveDataSpecification())); }
@Test(enabled = false) public void notEntitled() { UserPrincipal user = new UserPrincipal("impostor", "127.0.0.1"); assertFalse(_entitlementChecker.isEntitled(user, DIST_SPEC.getFullyQualifiedLiveDataSpecification())); }