Skip to content

fix(exception): 시큐어코딩 예외 선언 진단을 해소한다 - #71

Merged
jei007 merged 1 commit into
eGovFramework:mainfrom
itcen-entec-2026:fix/secure-coding-exception-handling
Sep 9, 2026
Merged

fix(exception): 시큐어코딩 예외 선언 진단을 해소한다#71
jei007 merged 1 commit into
eGovFramework:mainfrom
itcen-entec-2026:fix/secure-coding-exception-handling

Conversation

@LeeBaekHaeng

Copy link
Copy Markdown
Contributor

수정 사유 Reason for modification

소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)

  • 버그수정 Bug fixes
  • 기능개선 Enhancements
  • 기능추가 Adding features
  • 기타 Others

수정된 소스 내용 Modified source

검토자를 위해 수정된 소스 내용을 설명해 주세요. Please describe the modified source for reviewers.

개요

throws Exception 단독 선언이 시큐어코딩 솔루션에서 진단되는 문제를 해소합니다.

검증 결과 throws BaseRuntimeException, Exception으로 예외 유형을 명시하면
해당 진단이 발생하지 않아 관련 서비스, 컨트롤러, AOP 및 테스트의 예외 선언을 정비했습니다.

주요 변경 사항

  • 예외 전달 AOP 메서드에 BaseRuntimeException 선언 추가
  • 단건 조회 서비스와 컨트롤러에 BaseRuntimeException 선언 추가
  • ID 생성 중 발생하는 FdlExceptionBaseRuntimeException으로 변환
  • 글 등록 로직에서 불필요한 checked exception 선언 제거
  • 예외 계약 변경에 맞춰 관련 테스트 메서드 선언 정비
  • 등록 컨트롤러 테스트의 조회 검증을 위한 사전 데이터 보강
  • 불필요한 예외 JavaDoc 및 테스트의 Lombok 선언 제거
  • 조건문의 중괄호를 보완하여 코드 가독성 개선

변경 범위

운영 코드

  • EgovAopExceptionTransfer
  • EgovSampleService
  • EgovSampleServiceImpl
  • EgovSampleController

테스트 코드

  • EgovAopExceptionTransferTest
  • EgovSampleServiceImplTest
  • EgovSampleServiceImplTestInsertSampleTest
  • EgovSampleControllerTestAddTest
  • EgovSampleControllerTestDeleteTest
  • EgovSampleControllerTestSelectListTest
  • EgovSampleControllerTestUpdateTest

테스트

다음 환경에서 전체 Maven 테스트를 실행했습니다.

  • Java: 17.0.17
  • Maven: 3.9.9
  • 명령어: mvn test
  • 결과: BUILD SUCCESS
  • 테스트: 총 54개 성공, 실패 0개, 오류 0개, 건너뜀 0개

참고

  • throws Exceptionthrows BaseRuntimeException, Exception으로 변경한 후
    시큐어코딩 솔루션에서 해당 항목이 진단되지 않는 것을 확인했습니다.

JUnit 테스트 JUnit tests

테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.

  • JUnit 테스트 JUnit tests
  • 수동 테스트 Manual testing

테스트 브라우저 Test Browser

테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.

  • Chrome
  • Firefox
  • Edge
  • Safari
  • Opera
  • Internet Explorer
  • 기타 Others

테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video

테스트 전과 후의 스크린샷 또는 캡처 영상을 이곳에 첨부해 주세요. Please attach screenshots or video captures of your before and after tests here.

테스트 후

image

https://youtu.be/h15CsIAbfqg

Exception 단독 선언이 시큐어코딩 솔루션에서 진단되지 않도록
BaseRuntimeException을 명시적으로 선언한다.

ID 생성 과정의 FdlException을 BaseRuntimeException으로 변환하고,
불필요한 checked exception 선언을 제거한다.

변경된 예외 계약에 맞춰 서비스, 컨트롤러 및 관련 테스트를 정비하고
등록 컨트롤러 테스트의 사전 데이터를 보강한다.

@jei007 jei007 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

표준프레임워크에 대한 지속적인 참여에
대단히 감사드립니다.

@jei007
jei007 merged commit 66634ca into eGovFramework:main Sep 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants