amosproj / amos2021ss07-bike-nest

MIT License
1 stars 0 forks source link

Add Unit Tests for Backend #89

Closed JodelLisa2Point0 closed 3 years ago

rmandlx commented 3 years ago

Every Service should have a few basic unit tests. Unit Tests should work without the need to access databases or other services. They have to be mocked.

An example would be to check the Validation of JWTs in the usermanagement service (create valid JWT and check if the code says its valid, create invalid JWT and check if the code says its invalid)

rmandlx commented 3 years ago

Look at the last commit for a basic example on how to do unit tests with Spring.

rmandlx commented 3 years ago

The capability for unit tests is there now. It also works with the github workflow and there is a first example, that shows alot of what can be done (especially mocking, which is very important for unit tests). So I m closing this issue.