Skip to content

Commit

Permalink
Updated remaining tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd committed Jan 4, 2017
1 parent 5380344 commit b10ef61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ public void shouldFailOnMalformedToken() throws Exception
// Expect
exception.expect( AuthenticationException.class );
exception.expect( hasStatus( Status.Security.Unauthorized ) );
exception.expectMessage(
"The value associated with the key `principal` must be a String but was: SingletonList" );
exception.expectMessage( "Unsupported authentication token, the value associated with the key `principal` " +
"must be a String but was: SingletonList" );

// When
authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ public void shouldFailIfMalformedAuthTokenWrongType() throws Throwable
// Then
assertThat( client, eventuallyReceives( new byte[]{0, 0, 0, 1} ) );
assertThat( client, eventuallyReceives( msgFailure( Status.Security.Unauthorized,
"The value associated with the key `principal` must be a String but was: ArrayList" ) ) );
"Unsupported authentication token, the value associated with the key `principal` " +
"must be a String but was: ArrayList" ) ) );

assertThat( client, eventuallyDisconnects() );
}
Expand All @@ -233,7 +234,7 @@ public void shouldFailIfMalformedAuthTokenMissingKey() throws Throwable
// Then
assertThat( client, eventuallyReceives( new byte[]{0, 0, 0, 1} ) );
assertThat( client, eventuallyReceives( msgFailure( Status.Security.Unauthorized,
"The value associated with the key `credentials` must be a String but was: null" ) ) );
"Unsupported authentication token, missing key `credentials`" ) ) );

assertThat( client, eventuallyDisconnects() );
}
Expand All @@ -251,7 +252,7 @@ public void shouldFailIfMalformedAuthTokenMissingScheme() throws Throwable
// Then
assertThat( client, eventuallyReceives( new byte[]{0, 0, 0, 1} ) );
assertThat( client, eventuallyReceives( msgFailure( Status.Security.Unauthorized,
"The value associated with the key `scheme` must be a String but was: null" ) ) );
"Unsupported authentication token, missing key `scheme`" ) ) );

assertThat( client, eventuallyDisconnects() );
}
Expand All @@ -270,7 +271,7 @@ public void shouldFailIfMalformedAuthTokenUnknownScheme() throws Throwable
// Then
assertThat( client, eventuallyReceives( new byte[]{0, 0, 0, 1} ) );
assertThat( client, eventuallyReceives( msgFailure( Status.Security.Unauthorized,
"Unsupported authentication scheme 'unknown'." ) ) );
"Unsupported authentication token, scheme 'unknown' is not supported." ) ) );

assertThat( client, eventuallyDisconnects() );
}
Expand Down

0 comments on commit b10ef61

Please sign in to comment.