Skip to content
An app that demonstrates unit and integration testing using maven, junit. I've thrown Mockito into the mix to do a bit of TDD as well. Have a look at the readMe for more info
Shell Java Batchfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Project PineApple --

###A narrative to a Java Spring Application We will use this for hosting our System Under Test.

#####Included in this application:

  • Simple Java Application that demonstrates a little 'business logic', the meat of the operation.

We will use a few testing techniques to generate test coverage.

Why TDD? why unit test?:-

TDD and unit tests give us great confidence that our core business logic is well protected and functional.

TDD in particular ensure that we build quality into our application at the lowest level possible.
By definition, a unit test is a small test. A fast responding test vs its larger integration and functional sigblings.

We want a faster response when we include quality checks in our build/deploy lifecycle.


Using JUnit we will test:

  • Unit Test - Maven Surefire.
  • Integration Test - Maven Failsafe.

#####Maven This is a maven springboot application. Using terminal,

Unit tests -

Run mvn clean test - this will execute unit tests

Unit and Integration tests -

run mvn clean verify - this will execute both unit and integration tests.

Integration tests only -

run mvn verify -Dskip.surefire.tests

#####TDD Using mockito, Junit and hamcrest. I built these simple methods using TDD. Mocking my way through and building with quliaty in mind. Give it try.

You can’t perform that action at this time.