Giter VIP home page Giter VIP logo

spring-testing's Introduction

Spring Testing sample project

Desciption

In this sample project we are exploring the different testing techniques using some test frameworks.

PLEASE NOTE: The purpose of this sample project is not to achieve a complete test coverage!

Tech stack

Application

  • Java 11 (no modules)
  • Maven Wrapper 3.x
  • Spring Boot 2.1.x

Testing

  • JUnit 4
  • Mockito
  • Assertj Assertions
  • Spring Boot test
  • Spring Cloud Contract

Build & run

Pre-requisites

No specific pre-requisites

Make (in every sub-project)

  • just compile

      make clean compile
    
  • build and run unit tests

      make clean build
    
  • install

      make install
    
  • run

      make run
    
  • debug

      make debug
    
  • run integration tests

      make integration-test
    
  • run all tests

      make test
    
  • docker

    • build image

        make docker-build
      
    • run container

        make docker-run
      
    • run container as daemon

        make docker-run-daemon
      
    • stop daemon container

        make docker-stop
      

Maven & Docker (in every sub-project)

  • just compile

      ./mvnw clean compile
    
  • build and run unit tests

      ./mvnw -Dtest=*UnitTest clean package
    
  • install

      ./mvnw clean install
    
  • run

      ./mvnw spring-boot:run -DskipTests -Dspring-boot.run.jvmArguments='$(MEM_OPTS) $(JMX_OPTS) $(OTHER_OPTS)'
    
  • debug

      ./mvnw spring-boot:run -DskipTests -Dspring-boot.run.jvmArguments='$(MEM_OPTS) $(JMX_OPTS) $(OTHER_OPTS) -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=$(IMAGE_DEBUG_PORT)'
    
  • run integration tests

      ./mvnw -Dtest=*IntegrationTest -DfailIfNoTests=false test
    
  • run all tests

      ./mvnw test
    
  • docker

    • build image

        ./mvnw clean package
        docker build -f Dockerfile_local -t $(IMAGE_NAME):$(IMAGE_TAG) .
      
    • run container

        docker run --rm -it --name $(NAME) $(DOCKER_IMAGE_PORTS) --net bridge --add-host=$(DOCKER_HOST):$(DOCKER_IP) $(IMAGE_NAME):$(IMAGE_TAG)
      
    • run container as daemon

        docker run --rm -d --name $(NAME) $(DOCKER_IMAGE_PORTS) --net bridge --add-host=$(DOCKER_HOST):$(DOCKER_IP) $(IMAGE_NAME):$(IMAGE_TAG)
      
    • stop daemon container

        docker container stop -f $(NAME)
      

TODOs

  • fix issue on contract testing
  • random testing (?)
  • test containers

Related repos


Links

DONE
IN-PROG

/

TODO

Issues

Repos

spring-testing's People

Contributors

bygui86 avatar

Stargazers

 avatar  avatar  avatar  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.