12. Assignments

12.1. Jenkins

  1. Repository https://github.com/AstroTech/ecosystem-example-java

  2. Run SonarScanner analysis in Jenkins

  3. Use official Docker images:

    • Jenkins jenkins/jenkins:alpine

    • SonarQube: sonarqube:latest

    • SonarScanner: sonarsource/sonar-scanner-cli:latest

Solution

12.2. Pitest

  1. Repository https://github.com/AstroTech/ecosystem-example-java

  2. Install openjdk-8-jdk and maven

  3. Set Java 8 as default update-alternatives --config java

  4. Add jUnit as a project dependency in pom.xml

  5. Install Pitest as a plugin in pom.xml

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.13</version>
    <scope>test</scope>
</dependency>
<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.5.2</version>
 </plugin>
mvn compile

# Unit Tests
mvn test

# Integration tests
mvn verify

# Mutation Tests
mvn org.pitest:pitest-maven:mutationCoverage