@Test public void testFailTokenAuthInvalidateAppResource() 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"}); try { operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } }
@Test public void testFailTokenAuthInvalidateAppResource() 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"}); try { operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } }
@Test public void testFailTokenAuthInvalidateAppResource() 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"}); try { operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } }
@Test public void testFailInvalidateNoApp() 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"}); try { token.setAppId(""); token.setAppUrl(""); operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } } }
@Test public void testFailInvalidateNoApp() 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"}); try { token.setAppId(""); token.setAppUrl(""); operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } } }
@Test public void testFailInvalidateNoApp() 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"}); try { token.setAppId(""); token.setAppUrl(""); operation.execute(params, null, token, converter).get(); fail("Expected error"); } catch (ExecutionException ee) { assertTrue(ee.getCause() instanceof ProtocolException); } } }