Code Monkey home page Code Monkey logo

testing-examples's Introduction

Java application testing examples

BUILD

mvn clean package

RUN

You can launch the Java server within your IDE, by running the Application class at the root of your application's Java package. As it is a simple "Main" class, it is the easiest and quickest way to run and debug the application. If you prefer to use Maven, you can also run your application by typing:

mvn spring-boot:run

The application will be available on http://localhost:8080

TESTS examples

Application is tested using different kids of test:

  • Unit

src/test/java/com/pik/contact/unit/ContactTest.java

  • Unit with mocks

src/test/java/com/pik/contact/service/unit/ContactServiceTest.java

  • Integration test

src/test/java/com/pik/contact/service/integration/ContactServiceTest.java

  • Spring mvc test for REST endpoint

src/test/java/com/pik/contact/api/ContactControllerTest.java

  • Cucumber acceptance test

src/test/java/com/pik/contact/cucumber/RunCukesTest.java src/test/resources/com/pik/contact/cucumber/contacts.feature

  • GUI test with Selenium (with Page Object pattern)

src/test/java/com/pik/contact/gui/selenium/test/ContactsTest.java

alternative is to use Geb testing framework (https://github.com/geb/geb)

PIT is configured in maven src/pom/xmland can be run with: mvn pitest:mutationCoverage

  • Code coverage report by Jacoco

testing-examples's People

Contributors

michal-lipski avatar krzysztof-jelski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.