diff --git a/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java b/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java
index <HASH>..<HASH> 100644
--- a/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java
+++ b/spring-security-oauth2/src/test/java/org/springframework/security/oauth2/client/token/TestOAuth2AccessTokenSupport.java
@@ -80,6 +80,7 @@ public class TestOAuth2AccessTokenSupport {
 	@Test(expected = OAuth2AccessDeniedException.class)
 	public void testRetrieveTokenFailsWhenTokenEndpointNotAvailable() {
 		error = new IOException("Planned");
+		response.setStatus(HttpStatus.BAD_REQUEST);
 		support.retrieveToken(form, requestHeaders, resource);
 	}
 
@@ -120,6 +121,10 @@ public class TestOAuth2AccessTokenSupport {
 		public void setHeaders(HttpHeaders headers) {
 			this.headers = headers;
 		}
+		
+		public void setStatus(HttpStatus status) {
+			this.status = status;
+		}
 
 		public int getRawStatusCode() throws IOException {
 			return status.value();
Fix bug in unit test tickled by Spring <I>