Skip to content

Replace placeholder tests with real unit tests#43

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1777591593-real-unit-tests
Open

Replace placeholder tests with real unit tests#43
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1777591593-real-unit-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 30, 2026

Summary

Removes the auto-generated AppTest placeholder (assertTrue(true)) and adds 29 real unit tests across 4 test classes covering the core application logic:

Test class Count Covers
EmployeeTest 13 Constructors, getters/setters, equals/hashCode, JSON serialization & deserialization
EmployeeResourceTest 5 REST resource delegates correctly to DAO (list empty, list multiple, list single, create, identity)
EmployeeConfigurationTest 7 Config properties, defaults, DataSourceFactory, viewRenderer config, buildTemplate()
TemplateTest 4 Render with provided name, render with default, different format strings

Also upgrades mockito-core from 2.0.54-beta to 2.28.2 for Java 11 compatibility (excludes the old version from dropwizard-testing to satisfy the dependency convergence enforcer).

Review & Testing Checklist for Human

  • Verify the test names and assertions match expected business logic for Employee CRUD
  • Run mvn clean test -Dliquibase.should.run=false to confirm all 29 tests pass
  • Check that the Mockito upgrade (2.0.54-beta → 2.28.2) doesn't break any other test infrastructure

Notes

  • The employee.json fixture file was added at src/test/resources/fixtures/ for Jackson serialization round-trip tests
  • EmployeeResourceTest tests the resource methods directly (with a mocked DAO) rather than via Jersey's ResourceTestRule, since @UnitOfWork requires Hibernate session setup that isn't available in a pure unit test context

Link to Devin session: https://app.devin.ai/sessions/4d128d6227f34913a14b5709b5a89174
Requested by: @WesternConcrete


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)
Open in Devin Review

- Remove AppTest with its trivial assertTrue(true) placeholder
- Add EmployeeTest: 13 tests covering constructors, getters/setters,
  equals/hashCode, and JSON serialization/deserialization
- Add TemplateTest: 4 tests covering render with provided and default names
- Add EmployeeResourceTest: 5 tests verifying resource delegates to DAO
  using Mockito mocks for list and create operations
- Add EmployeeConfigurationTest: 7 tests covering config properties,
  defaults, and buildTemplate integration
- Add employee.json fixture for serialization tests
- Upgrade mockito-core to 2.28.2 for Java 11 compatibility (exclude
  old 2.0.54-beta from dropwizard-testing to resolve convergence)

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

1 participant