@@ -60,6 +60,7 @@ class MsGraphApiAuthenticationTest {
6060 private final static String CLIENT_SECRET = System .getenv ("TEST_MS_GRAPH_API_CLIENT_SECRET" );
6161 private final static String TENANT = System .getenv ("TEST_MS_GRAPH_API_TENANT" );
6262 private final static String AUTHENTICATION_URL = System .getenv ("TEST_MS_GRAPH_API_AUTHENTICATION_URL" );
63+ private final static String USERS_URL = System .getenv ("TEST_MS_GRAPH_API_USERS_URL" );
6364
6465 private final MsGraphApiAuthentication msGraphApiAuthentication ;
6566
@@ -76,24 +77,24 @@ static void setup() {
7677
7778 @ Test
7879 void shouldObtainValidAccessToken () throws AuthorizationException {
79- AuthenticationResponse response = msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , CLIENT_ID , CLIENT_SECRET );
80+ AuthenticationResponse response = msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , USERS_URL , CLIENT_ID , CLIENT_SECRET );
8081 assertThat (response .getAccessToken ()).isNotBlank ();
8182 assertThatCode (() -> JWT .decode (response .getAccessToken ())).doesNotThrowAnyException ();
8283 }
8384
8485 @ Test
8586 void shouldThrowIfInvalidTenant () {
86- assertThatThrownBy (() -> msGraphApiAuthentication .authenticate ("NOT_A_TENANT" , AUTHENTICATION_URL , CLIENT_ID , CLIENT_SECRET )).isInstanceOf (AuthorizationException .class );
87+ assertThatThrownBy (() -> msGraphApiAuthentication .authenticate ("NOT_A_TENANT" , AUTHENTICATION_URL , USERS_URL , CLIENT_ID , CLIENT_SECRET )).isInstanceOf (AuthorizationException .class );
8788 }
8889
8990 @ Test
9091 void shouldThrowIfInvalidClientId () {
91- assertThatThrownBy (() -> msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , "NOT_A_CLIENT_ID" , CLIENT_SECRET )).isInstanceOf (AuthorizationException .class );
92+ assertThatThrownBy (() -> msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , USERS_URL , "NOT_A_CLIENT_ID" , CLIENT_SECRET )).isInstanceOf (AuthorizationException .class );
9293 }
9394
9495 @ Test
9596 void shouldThrowIfInvalidClientSecret () {
96- assertThatThrownBy (() -> msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , CLIENT_ID , "NOT_A_SECRET" )).isInstanceOf (AuthorizationException .class );
97+ assertThatThrownBy (() -> msGraphApiAuthentication .authenticate (TENANT , AUTHENTICATION_URL , USERS_URL , CLIENT_ID , "NOT_A_SECRET" )).isInstanceOf (AuthorizationException .class );
9798 }
9899
99100}
0 commit comments