assertEquals(ex, exception);
}
}
public void testNullIf303() throws Exception {
NullOn303 function = new NullOn303();
HttpResponse response = EasyMock.createMock(HttpResponse.class);
HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
// Status code is called once
expect(response.getStatusCode()).andReturn(303);
// Get response gets called twice
expect(exception.getResponse()).andReturn(response);
expect(exception.getResponse()).andReturn(response);
// Get cause is called to determine the root cause
expect(exception.getCause()).andReturn(null);
replay(response);
replay(exception);
assertNull(function.createOrPropagate(exception));
verify(response);
verify(exception);
}