Skip to content

Comments

test: expand backend unit coverage across controllers and services#42

Closed
thughari wants to merge 2 commits intodevfrom
codex/add-unit-tests-for-backend-coverage
Closed

test: expand backend unit coverage across controllers and services#42
thughari wants to merge 2 commits intodevfrom
codex/add-unit-tests-for-backend-coverage

Conversation

@thughari
Copy link
Owner

Motivation

  • Increase unit-test coverage across the backend to exercise parsing, validation, security, and storage logic.
  • Focus on controller edge cases, service validation branches, security token handling, and small utility/mock components that were previously untested.

Description

  • Added comprehensive tests for WebhookController to cover invalid payloads, Google forwarding verification parsing, system-email ignores, successful job extraction, and gemini-skip behavior (backend/src/test/java/com/thughari/jobtrackerpro/controller/WebhookControllerTest.java).
  • Added security tests for JWT generation/validation and the auth filter (JwtUtilsTest, JwtAuthenticationFilterTest) using ReflectionTestUtils and mocked JwtUtils.
  • Added GlobalExceptionHandlerTest to assert HTTP mapping and ErrorResponse payloads for bad requests, not found, upload-size, and general exceptions.
  • Added CareerResourceServiceTest to exercise pagination sanitization, duplicate URL rejection, resource-file creation path, unauthorized update rejection, and file deletion handling.
  • Added tests for smaller components: JobSchedulerTest, MockGeminiServiceTest, and LocalStorageServiceTest to cover scheduled cleanup invocation, mock extraction defaults, and local upload/validation rules.

Testing

  • Created and added the new unit tests under backend/src/test/java/... and validated test sources compile locally in the editor.
  • Attempted to run the full backend suite with mvn test and ./mvnw test, but the build failed to resolve the parent Spring Boot starter POM from Maven Central (HTTP 403), so the test run did not complete.
  • No additional automated test runs succeeded in this environment due to external dependency resolution being blocked.

Codex Task

@thughari thughari closed this Feb 20, 2026
@thughari thughari deleted the codex/add-unit-tests-for-backend-coverage branch February 20, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant