Skip to content

Commit

Permalink
add: support for spring boot
Browse files Browse the repository at this point in the history
1. exclude coverage check on Application.class
2. add actuator
  • Loading branch information
fengyuanyang committed Jan 18, 2021
1 parent c16ae39 commit acdc2ee
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
20 changes: 13 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@ plugins {
id 'java'
id 'jacoco'
id 'checkstyle'
id 'org.springframework.boot' version '2.3.8.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
}

group 'com.ordestiny'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8
sourceCompatibility = 11

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

testImplementation('org.springframework.boot:spring-boot-starter-test') {
// Vintage provide a way for junit5 to test junit4
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}

// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.5.13'

// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.7.0'

// https://mvnrepository.com/artifact/org.assertj/assertj-core
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.17.2'
}

jacoco {
Expand All @@ -41,7 +46,8 @@ jacocoTestCoverageVerification {
excludes = [
'io.reflectoring.coverage.part.PartlyCovered',
'io.reflectoring.coverage.ignored.*',
'io.reflectoring.coverage.part.NotCovered'
'io.reflectoring.coverage.part.NotCovered',
'com.ordestiny.tdd.Application'
]
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/ordestiny/tdd/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.ordestiny.tdd;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
server:
port: 8080
servlet:
context-path: /tdd

0 comments on commit acdc2ee

Please sign in to comment.