Fix assert argument order in OAuth2ControllerTest
Change-Id: I900bd92f88357e74e676a612daa59832780569cb
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
index dfbb987..5fe4e47 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ControllerTest.java
@@ -98,8 +98,8 @@
assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Invalid authorization");
+ assertEquals("Invalid authorization",
+ node.at("/error_description").asText());
}
@Test
@@ -144,8 +144,8 @@
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Missing redirect URI");
+ assertEquals("Missing redirect URI",
+ node.at("/error_description").asText());
}
private void testRequestTokenAuthorizationInvalidRedirectUri (String code)
@@ -174,8 +174,8 @@
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.INVALID_GRANT, node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Invalid authorization");
+ assertEquals("Invalid authorization",
+ node.at("/error_description").asText());
}
@Test
@@ -190,13 +190,13 @@
assertEquals(TokenType.BEARER.displayName(),
node.at("/token_type").asText());
assertNotNull(node.at("/expires_in").asText());
- assertEquals(node.at("/scope").asText(), "all");
+ assertEquals("all", node.at("/scope").asText());
String refresh = node.at("/refresh_token").asText();
RefreshToken refreshToken = refreshTokenDao
.retrieveRefreshToken(refresh);
Set<AccessScope> scopes = refreshToken.getScopes();
assertEquals(1, scopes.size());
- assertEquals(scopes.toString(), "[all]");
+ assertEquals("[all]", scopes.toString());
testRefreshTokenExpiry(refresh);
}
@@ -237,8 +237,8 @@
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT,
node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Password grant is not allowed for third party clients");
+ assertEquals("Password grant is not allowed for third party clients",
+ node.at("/error_description").asText());
}
@Test
@@ -250,8 +250,8 @@
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.UNAUTHORIZED_CLIENT,
node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Password grant is not allowed for third party clients");
+ assertEquals("Password grant is not allowed for third party clients",
+ node.at("/error_description").asText());
}
@Test
@@ -330,8 +330,8 @@
String entity = response.readEntity(String.class);
JsonNode node = JsonUtils.readTree(entity);
assertEquals(OAuth2Error.INVALID_REQUEST, node.at("/error").asText());
- assertEquals(node.at("/error_description").asText(),
- "Missing parameter: client_secret");
+ assertEquals("Missing parameter: client_secret",
+ node.at("/error_description").asText());
}
@Test
@@ -413,7 +413,7 @@
assertEquals(TokenType.BEARER.displayName(),
node.at("/token_type").asText());
assertNotNull(node.at("/expires_in").asText());
- assertEquals(node.at("/scope").asText(), "client_info");
+ assertEquals("client_info", node.at("/scope").asText());
}
@Test