Skip to content

test: ParsingValidationService 테스트 시그니처 정합화#19

Open
coldmans wants to merge 1 commit into
mainfrom
test/fix-parsing-validation-signatures
Open

test: ParsingValidationService 테스트 시그니처 정합화#19
coldmans wants to merge 1 commit into
mainfrom
test/fix-parsing-validation-signatures

Conversation

@coldmans

Copy link
Copy Markdown
Owner

배경

./gradlew test 실패 원인이 리팩토링 코드가 아니라 ParsingValidationServiceTest의 구버전 시그니처 참조였습니다.

변경 사항

  • ParsingValidationService 생성자 변경 반영
    • (pdfParseService, excelParseService, subjectRepository) -> (excelParseService, subjectRepository)
  • ExcelParseService.parseWithoutSaving(file, maxChunks) 시그니처 반영
  • validateExcelParsing(file, semester, maxChunks) 시그니처 반영
  • 현재 구현 상태에 맞춰 PDF 검증 테스트를 기본 리포트 검증으로 조정

검증

  • 로컬 실행: ./gradlew test --no-daemon ✅ 통과

충돌 영향

  • 테스트 파일 1개만 수정하여 기존 PR16/17/18 코드 변경과 충돌 가능성 낮음

Copilot AI review requested due to automatic review settings February 14, 2026 06:13
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @coldmans, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 ParsingValidationServiceTest의 테스트 시그니처를 최신 서비스 변경 사항에 맞춰 업데이트하여 테스트 실패를 해결합니다. PdfParseService 의존성 제거 및 ExcelParseService 메서드 시그니처 변경을 반영하고, PDF 검증 테스트를 현재 서비스의 미구현 상태에 맞게 조정하여 테스트의 정합성을 확보했습니다.

Highlights

  • ParsingValidationService 생성자 변경 반영: ParsingValidationService 생성자 변경 사항을 테스트 코드에 반영하여 PdfParseService 의존성을 제거했습니다.
  • ExcelParseService 메서드 시그니처 변경 반영: ExcelParseService.parseWithoutSaving 및 ParsingValidationService.validateExcelParsing 메서드의 시그니처 변경(maxChunks 파라미터 추가)을 테스트 코드에 적용했습니다.
  • PDF 검증 테스트 조정: validatePdfParsing 테스트를 현재 구현 상태에 맞춰 PDF 검증이 아직 구현되지 않았음을 반영하는 기본 리포트 검증으로 조정했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/test/java/inu/timetable/service/ParsingValidationServiceTest.java
    • ParsingValidationService 생성자 호출을 업데이트했습니다.
    • ExcelParseService.parseWithoutSaving 및 ParsingValidationService.validateExcelParsing 메서드 호출에 maxChunks 파라미터를 추가했습니다.
    • validatePdfParsing 테스트 로직을 PDF 검증이 미구현 상태임을 반영하도록 수정했습니다.
    • 사용되지 않는 PdfParseService 목 객체와 assertTrue import를 제거했습니다.
Activity
  • 이 Pull Request에 대한 활동은 아직 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 ParsingValidationService의 시그니처 변경에 따라 ParsingValidationServiceTest의 테스트 코드를 수정하는 것을 주 내용으로 합니다. PdfParseService 의존성 제거, validatePdfParsing 테스트 로직 변경, validateExcelParsing 테스트의 메서드 시그니처 업데이트 등이 포함되어 있습니다. 전반적으로 변경 사항은 명확하며, 리팩토링된 코드에 맞춰 테스트를 성공적으로 정합시켰습니다. 한 가지 개선점으로, Map<String, Object> 대신 DTO를 사용하여 타입 안정성을 높이는 방안을 제안했습니다.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

ParsingValidationServiceTest가 최신 ParsingValidationService/ExcelParseService 메서드 시그니처를 참조하도록 업데이트해 ./gradlew test 실패를 해소하는 PR입니다.

Changes:

  • ParsingValidationService 생성자 변경에 맞춰 테스트에서 PdfParseService 의존성 제거
  • ExcelParseService.parseWithoutSaving(file, maxChunks)validateExcelParsing(file, semester, maxChunks) 시그니처에 맞게 테스트 수정
  • PDF 검증 테스트를 “미구현 기본 리포트” 반환 검증으로 단순화

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +63 to +68
when(excelParseService.parseWithoutSaving(file, 10))
.thenReturn(List.of(parsedOne, parsedTwo));
when(subjectRepository.findAll())
.thenReturn(List.of(dbOne, dbTwo));

Map<String, Object> report = service.validateExcelParsing(file, "");
Map<String, Object> report = service.validateExcelParsing(file, "", 10);

Copilot AI Feb 14, 2026

Copy link

Choose a reason for hiding this comment

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

테스트에서 maxChunks10을 하드코딩해 stubbing/호출에 중복 사용하고 있습니다. 향후 값 변경 시 한쪽만 수정해도 테스트가 의미 없이 깨질 수 있으니, 상수로 추출하거나 지역 변수로 한 번만 선언해 재사용하는 형태가 더 안전합니다.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to 46
void validatePdfParsing_notImplementedReturnsDefaultReport() {
MockMultipartFile file = mockFile("timetable.pdf", "application/pdf");

Subject parsedMismatch = subject("Data Structures", "Kim",
schedule("Mon", 1.0, 3.0));
Subject parsedOnly = subject("Operating Systems", "Lee",
schedule("Wed", 2.0, 4.0));
Subject parsedMatch = subject("Algorithms", "Park",
schedule("Fri", 2.0, 3.0));

Subject dbMismatch = subject("Data Structures", "Kim",
schedule("Mon", 1.0, 2.0));
Subject dbOnly = subject("Networks", "Choi",
schedule("Tue", 1.0, 2.0));
Subject dbMatch = subject("Algorithms", "Park",
schedule("Fri", 2.0, 3.0));

when(pdfParseService.parseWithoutSaving(file))
.thenReturn(List.of(parsedMismatch, parsedOnly, parsedMatch));
when(subjectRepository.findAll())
.thenReturn(List.of(dbMismatch, dbOnly, dbMatch));

Map<String, Object> report = service.validatePdfParsing(file, "");

assertEquals("PDF", report.get("sourceType"));
assertEquals(3, report.get("parsedCount"));
assertEquals(3, report.get("dbCount"));

List<String> onlyInParsed = (List<String>) report.get("onlyInParsed");
assertEquals(1, onlyInParsed.size());
assertTrue(onlyInParsed.contains("Operating Systems"));

List<String> onlyInDb = (List<String>) report.get("onlyInDb");
assertEquals(1, onlyInDb.size());
assertTrue(onlyInDb.contains("Networks"));

List<Map<String, Object>> differences = (List<Map<String, Object>>) report.get("differences");
assertEquals(1, differences.size());
Map<String, Object> diff = differences.get(0);
assertEquals("Data Structures", diff.get("subjectName"));
assertTrue(diff.containsKey("schedule"));

Map<String, Object> scheduleDiff = (Map<String, Object>) diff.get("schedule");
assertEquals("Mon 1.0-3.0", scheduleDiff.get("parsed"));
assertEquals("Mon 1.0-2.0", scheduleDiff.get("db"));

Map<String, Object> summary = (Map<String, Object>) report.get("summary");
assertEquals("HAS_DIFFERENCES", summary.get("status"));
assertEquals(3, summary.get("totalIssues"));
assertEquals(0, report.get("parsedCount"));
assertEquals(0, report.get("dbCount"));
assertEquals("Not implemented", report.get("message"));
}

Copilot AI Feb 14, 2026

Copy link

Choose a reason for hiding this comment

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

validatePdfParsing 기본 리포트 테스트가 parsedCount/dbCount/message만 검증하고 있는데, 현재 admin/validate-result.html에서는 report.sourceType, report.accuracy, report.summary.status/totalIssues, onlyInParsedCount 등 여러 키를 전제로 렌더링합니다. PDF 검증 기능이 노출돼 있다면(컨트롤러에서도 동일 템플릿 사용) 최소한 기본 리포트에도 동일한 스키마(기본값 포함)를 넣어 템플릿/클라이언트가 깨지지 않도록 하고, 테스트도 그 계약을 검증하는 편이 안전합니다.

Copilot uses AI. Check for mistakes.
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