@Test public void testUnknownException() throws Throwable { // create client service Service clientService = ProxyUtil.createClientProxy( cl, Service.class, false, jsonRpcClient, clientInputStream, clientOutputStream); jsonRpcServer.setErrorResolver(AnnotationsErrorResolver.INSTANCE); mockCtx.checking( new Expectations() { { one(serviceMock).unresolvedExceptionThrown(); will(throwException(new IllegalArgumentException("testing"))); one(serviceMock).undelcaredExceptionThrown(); will(throwException(new IllegalArgumentException("testing"))); } }); try { clientService.unresolvedExceptionThrown(); fail("Expecting exception"); } catch (Throwable t) { assertTrue(JsonRpcClientException.class.isInstance(t)); } try { clientService.undelcaredExceptionThrown(); fail("Expecting exception"); } catch (Throwable t) { assertTrue(JsonRpcClientException.class.isInstance(t)); } }