invalidation.invalidateApplicationResources(resources, request.getToken()); invalidation.invalidateUserResources(userIds, request.getToken());
invalidation.invalidateApplicationResources(resources, request.getToken()); invalidation.invalidateUserResources(userIds, request.getToken());
invalidation.invalidateApplicationResources(resources, request.getToken()); invalidation.invalidateUserResources(userIds, request.getToken());
@Test public void testAllowConsumerAuthInvalidateAppResource() throws Exception { String path = "/cache/invalidate"; RestHandler operation = registry.getRestHandler(path, "POST"); params.put(InvalidationHandler.KEYS_PARAM, new String[]{"http://www.example.org/gadget.xml"}); token.setAuthenticationMode(AuthenticationMode.OAUTH_CONSUMER_REQUEST.name()); invalidationService.invalidateApplicationResources( eq(ImmutableSet.of(Uri.parse("http://www.example.org/gadget.xml"))), eq(token)); expectLastCall(); replay(); operation.execute(params, null, token, converter).get(); verify(); reset(); }
@Test public void testAllowConsumerAuthInvalidateAppResource() throws Exception { String path = "/cache/invalidate"; RestHandler operation = registry.getRestHandler(path, "POST"); params.put(InvalidationHandler.KEYS_PARAM, new String[]{"http://www.example.org/gadget.xml"}); token.setAuthenticationMode(AuthenticationMode.OAUTH_CONSUMER_REQUEST.name()); invalidationService.invalidateApplicationResources( eq(ImmutableSet.of(Uri.parse("http://www.example.org/gadget.xml"))), eq(token)); expectLastCall(); replay(); operation.execute(params, null, token, converter).get(); verify(); reset(); }
@Test public void testAllowConsumerAuthInvalidateAppResource() throws Exception { String path = "/cache/invalidate"; RestHandler operation = registry.getRestHandler(path, "POST"); params.put(InvalidationHandler.KEYS_PARAM, new String[]{"http://www.example.org/gadget.xml"}); token.setAuthenticationMode(AuthenticationMode.OAUTH_CONSUMER_REQUEST.name()); invalidationService.invalidateApplicationResources( eq(ImmutableSet.of(Uri.parse("http://www.example.org/gadget.xml"))), eq(token)); expectLastCall(); replay(); operation.execute(params, null, token, converter).get(); verify(); reset(); }