@Test(expected = ObjectCreationException.class) public void throws_object_creation_exception_when_handling_request() { this.handler.handleRecursiveRequest(this.request, this.recordedRequests); }
@Override public Object handleRecursiveRequest(Object request, List<Object> recordedRequests) { String errorMessage = String.format( "Unable to create an instance of %s because it contains a circular reference.\n%s", recordedRequests.get(0), getRecursiveStack(request, recordedRequests)); throw new ObjectCreationException(errorMessage); }
ThrowingRecursionHandler implements RecursionHandler { @Override public Object handleRecursiveRequest(Object request, List<Object> recordedRequests) { String errorMessage = String.format( "Unable to create an instance of %s because it contains a circular reference.\n%s", recordedRequests.get(0), getRecursiveStack(request, recordedRequests)); throw new ObjectCreationException(errorMessage); } }
ThrowingRecursionHandler implements RecursionHandler { @Override public Object handleRecursiveRequest(Object request, List<Object> recordedRequests) { String errorMessage = String.format( "Unable to create an instance of %s because it contains a circular reference.\n%s", recordedRequests.get(0), getRecursiveStack(request, recordedRequests)); throw new ObjectCreationException(errorMessage); }  }
ThrowingRecursionHandler implements RecursionHandler { @Override public Object handleRecursiveRequest(Object request, List<Object> recordedRequests) { String errorMessage = String.format( "Unable to create an instance of %s because it contains a circular reference.\n%s", recordedRequests.get(0), getRecursiveStack(request, recordedRequests)); throw new ObjectCreationException(errorMessage); }  @Override Object handleRecursiveRequest(Object request, List<Object> recordedRequests); }
ThrowingRecursionHandler implements RecursionHandler { @Override public Object handleRecursiveRequest(Object request, List<Object> recordedRequests) { String errorMessage = String.format( "Unable to create an instance of %s because it contains a circular reference.\n%s", recordedRequests.get(0), getRecursiveStack(request, recordedRequests)); throw new ObjectCreationException(errorMessage); }  @Override Object handleRecursiveRequest(Object request, List<Object> recordedRequests);  }