Skip to content

Commit

Permalink
test: oauth properties가 없을 때의 테스트코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
parksey committed Oct 30, 2023
1 parent ab0b0ab commit dff5e2e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@ void authenticationUrl() {
assertThat(authorizaionCodeUri).contains(oauthConfig.client().clientId(),
String.join(",", oauthConfig.client().scope()), oauthConfig.provider().redirectUri());
}

@DisplayName("Client id가 없을 때 url 생성 실패")
@Test
void create_failby_no_client_id() {
// Given
AuthenticationService noPropertyService = new AuthenticationService(new OAuthConfig(
new OAuthConfig.Provider(null, null),
new OAuthConfig.Client(null, null, null, null)
));

// When + Then
assertThatThrownBy(noPropertyService::getAuthorizaionCodeUri)
.isInstanceOf(NullPointerException.class);
}
}

0 comments on commit dff5e2e

Please sign in to comment.