refactor tests, introduce TokenEndpointCall

This commit is contained in:
Dusan Jakub
2023-09-19 21:53:29 +02:00
parent e081da00da
commit 8ec906c0b8
8 changed files with 125 additions and 69 deletions

View File

@@ -1,5 +1,6 @@
package com.ysoft.geecon;
import com.ysoft.geecon.dto.AccessTokenResponse;
import com.ysoft.geecon.dto.OAuthClient;
import com.ysoft.geecon.dto.User;
import com.ysoft.geecon.error.ErrorResponse;
@@ -53,9 +54,9 @@ public class AuthCodeGrantTest {
assertThat(flow.getCode(), is(notNullValue()));
assertThat(flow.getAccessToken(), is(nullValue()));
flow.exchangeCode();
AccessTokenResponse accessTokenResponse = flow.exchangeCode().expectTokens();
assertThat(flow.getAccessToken(), is(notNullValue()));
assertThat(accessTokenResponse.accessToken(), is(notNullValue()));
}
@Test
@@ -94,9 +95,9 @@ public class AuthCodeGrantTest {
assertThat(flow.getCode(), is(notNullValue()));
assertThat(flow.getAccessToken(), is(nullValue()));
flow.exchangeCode();
AccessTokenResponse accessTokenResponse = flow.exchangeCode().expectTokens();
assertThat(flow.getAccessToken(), is(notNullValue()));
assertThat(accessTokenResponse.accessToken(), is(notNullValue()));
}
}