Update TestDefaultIntrospectionResultAssembler.java

I have passed userInfo as null paramter and i am using parameters which are  already used in the existing test cases.
I have taken references from other test cases which are similar to @test(expected= error.class) format.
Can you Kindly go through the test case and guide if this is the correct way and how to deal with parameter in this case.
pull/1367/head
Aishwarya Gosavi 2018-03-23 09:22:57 -04:00 committed by GitHub
parent e6bed2a481
commit 003fbed43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -303,8 +303,18 @@ public class TestDefaultIntrospectionResultAssembler {
.build();
assertThat(result, is(equalTo(expected)));
}
@Test(expected = ParseException.class)
public void testAssembleFrom_refresh() {
OAuth2RefreshTokenEntity refreshToken = refreshToken(null,
oauth2AuthenticationWithUser(oauth2Request("clientId", scopes("foo", "bar")), "name"));
Set<String> authScopes = scopes("foo", "bar", "baz");
// this should fail with an error
assembler.assembleFrom(refreshToken, null , authScopes);
}
private UserInfo userInfo(String sub) {
UserInfo userInfo = mock(UserInfo.class);