private void assertThrowOnVoidMethod(TestInterface testObject) { Recorder<TestInterface> recorder = TestObject.createRecorder(testObject); testObject.returnNothing(); recorder.recordForLastCall().andThrow(new RuntimeException()); testObject.returnNothing(); }
private void assertVoidMethodWithParamMatching(TestInterface testObject) { Recorder<TestInterface> recorder = new Recorder<TestInterface>(testObject); String arg = "arg"; testObject.methodWithArguments(arg); recorder.recordForLastCall().andThrow(new RuntimeException()); testObject.methodWithArguments("otherstring"); testObject.methodWithArguments(arg); }
private void assertDoesNotAllowWrongTypeException(TestInterface testObject) throws IOException { Recorder<TestInterface> recorder = TestObject.createRecorder(testObject); testObject.throwDeclardeException(); recorder.recordForLastCall().andThrow(new Exception()); }