InhaBas / Inhabas.com-api

인하대학교 빅데이터 동아리 IBAS 웹앱, rest 개편 프로젝트 (2021.12.21~)
https://www.inhabas.com
9 stars 11 forks source link

테스트 코드에서 constructor.newInstance 간헐적으로 실패 #108

Closed Dong-Hyeon-Yu closed 2 years ago

Dong-Hyeon-Yu commented 2 years ago

gradle build 하는 github action script 에서 테스트 진행시

constructor.newInstance() 함수를 호출하는 부분이 IllegalArgumentException 발생하면서

모조리 fail 됨..

Dong-Hyeon-Yu commented 2 years ago
Constructor<?> constructor = OAuth2AuthorizationRequest.Builder.class.getDeclaredConstructors()[1];

위처럼 되어 있었는데, 정렬되지 않은 형태로 반환되어 순서를 항상 같게 보장할 수 없음. 따라서 아래와 같이 수정.

Constructor<?> constructor =
                OAuth2AuthorizationRequest.Builder.class.getDeclaredConstructor(AuthorizationGrantType.class);