Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task #21 #43

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

iccaprar
Copy link

What does it fix?

Closes #21

Adds the unit test framework for services (with JUnit 5, Mockito and AspectJ) and for controllers (with MockMvc and mocked services).

Adds the integration test framework for controllers (with full database support and cleanup).

Implemented unit and integration tests for authentication & registration services and controllers.

Fixed issues with Flyway configuration for dev and disabled Flyway in test profile (which uses H2 not MySQL).

How has it been tested?

All tests run successfully.

@vercel
Copy link

vercel bot commented Mar 29, 2020

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/code4ro/next-door/pbg2b3zwm
✅ Preview: https://next-door-git-fork-iccaprar-task-21-auth-tests.code4ro.now.sh

@iccaprar iccaprar marked this pull request as ready for review March 29, 2020 09:42
@iccaprar
Copy link
Author

In the future, we might consider using a dedicated profile for the integrations tests that need to boot the database, if they take too long. For now, they are quite fast (1-2s).

I did not use @DirtiesContext for the time being, as it does not seem to be necessary with the clear separation between controller unit tests (no DB, only mocking of services) and controller integration tests (using the test H2 in mem data source and the cleanup DB test listener). The cleanup listener is much faster than reinitializing the app context for each text.

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.

Add unit/integration tests for the authentication
2 participants