-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nit cleanup - use statically imported mapper method, suppress warnings
- Loading branch information
1 parent
a9d193b
commit 07a39af
Showing
2 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,6 +260,7 @@ public void shouldCreateUserInfoRequest() throws Exception { | |
assertThat(response.getValues(), hasEntry("created_at", "2016-12-05T11:16:59.640Z")); | ||
assertThat(response.getValues(), hasEntry("sub", "auth0|58454...")); | ||
assertThat(response.getValues(), hasKey("identities")); | ||
@SuppressWarnings("unchecked") | ||
List<Map<String, Object>> identities = (List<Map<String, Object>>) response.getValues().get("identities"); | ||
assertThat(identities, hasSize(1)); | ||
assertThat(identities.get(0), hasEntry("user_id", "58454...")); | ||
|
@@ -501,6 +502,7 @@ public void shouldCreateSignUpRequestWithCustomParameters() throws Exception { | |
assertThat(body, hasEntry("connection", "db-connection")); | ||
assertThat(body, hasEntry("client_id", CLIENT_ID)); | ||
assertThat(body, hasKey("user_metadata")); | ||
@SuppressWarnings("unchecked") | ||
Map<String, String> metadata = (Map<String, String>) body.get("user_metadata"); | ||
assertThat(metadata, hasEntry("age", "25")); | ||
assertThat(metadata, hasEntry("address", "123, fake street")); | ||
|
@@ -1008,6 +1010,7 @@ public void shouldCreateStartEmailPasswordlessFlowRequestWithCustomParams() thro | |
assertThat(body, hasEntry("client_secret", CLIENT_SECRET)); | ||
assertThat(body, hasEntry("email", "[email protected]")); | ||
assertThat(body, hasKey("authParams")); | ||
@SuppressWarnings("unchecked") | ||
Map<String, String> authParamsSent = (Map<String, String>) body.get("authParams"); | ||
assertThat(authParamsSent, hasEntry("scope", authParams.get("scope"))); | ||
assertThat(authParamsSent, hasEntry("state", authParams.get("state"))); | ||
|
@@ -1797,11 +1800,11 @@ public void shouldCreatePushedAuthorizationRequestWithAuthDetails() throws Excep | |
} | ||
|
||
@Test | ||
@SuppressWarnings("unchecked") | ||
public void shouldThrowWhenCreatePushedAuthorizationRequestWithInvalidAuthDetails() { | ||
// force Jackson to throw error on serialization | ||
// see https://stackoverflow.com/questions/26716020/how-to-get-a-jsonprocessingexception-using-jackson | ||
List mockList = mock(List.class); | ||
@SuppressWarnings("unchecked") | ||
List<Map<String, Object>> mockList = mock(List.class); | ||
when(mockList.toString()).thenReturn(mockList.getClass().getName()); | ||
|
||
IllegalArgumentException e = verifyThrows(IllegalArgumentException.class, | ||
|