diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2b7494b..0238cf4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,8 +16,9 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'zulu' + java-version: 17 + distribution: 'temurin' + cache: gradle - name: Cache Gradle packages uses: actions/cache@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98ffe24..3af0e79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,9 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 - distribution: 'zulu' + java-version: 17 + distribution: 'temurin' + cache: gradle - name: Cache SonarCloud packages uses: actions/cache@v3 with: diff --git a/build.gradle b/build.gradle index 6aacf70..8763554 100644 --- a/build.gradle +++ b/build.gradle @@ -40,8 +40,8 @@ subprojects { mavenCentral() } - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 task sourceJar(type: Jar) { from sourceSets.main.allJava diff --git a/wiremock-spring-boot-starter/build.gradle b/wiremock-spring-boot-starter/build.gradle index 1a59745..d4a6a41 100644 --- a/wiremock-spring-boot-starter/build.gradle +++ b/wiremock-spring-boot-starter/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.7.12' + classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.7.18' } } @@ -17,7 +17,7 @@ group = 'com.epages' description = 'Spring Boot Starter for adding a WireMock server to your integration test' dependencies { - api 'com.github.tomakehurst:wiremock-standalone:2.27.2' + api 'org.wiremock:wiremock-standalone:3.5.3' implementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.springframework.boot:spring-boot-starter' diff --git a/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockAutoConfiguration.java b/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockAutoConfiguration.java index e8ec768..5ca74be 100644 --- a/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockAutoConfiguration.java +++ b/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockAutoConfiguration.java @@ -12,7 +12,6 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.common.ClasspathFileSource; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; -import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer; @AutoConfiguration @ConditionalOnClass({WireMockServer.class}) @@ -36,7 +35,6 @@ public WireMockConfiguration wireMockConfiguration(WireMockProperties properties if(properties.getStubPath() != null) { config.fileSource(new ClasspathFileSource(properties.getStubPath())); } - config.extensions(new ResponseTemplateTransformer(false)); return config; } diff --git a/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockListener.java b/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockListener.java index f940ab0..4bf17e2 100644 --- a/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockListener.java +++ b/wiremock-spring-boot-starter/src/main/java/com/epages/wiremock/starter/WireMockListener.java @@ -73,7 +73,7 @@ public void beforeTestMethod(TestContext testContext) { WireMockServer server = applicationContext.getBean(WireMockServer.class); server.resetMappings(); if(! stubPath.isEmpty()) { - server.loadMappingsUsing(new JsonFileMappingsSource(new ClasspathFileSource(stubPath))); + server.loadMappingsUsing(new JsonFileMappingsSource(new ClasspathFileSource(stubPath), null)); } } diff --git a/wiremock/build.gradle b/wiremock/build.gradle index 0f8c5dc..70babcc 100644 --- a/wiremock/build.gradle +++ b/wiremock/build.gradle @@ -3,9 +3,9 @@ dependencies { // See https://github.com/spring-projects/spring-restdocs/releases/tag/v2.0.4.RELEASE implementation 'org.springframework.restdocs:spring-restdocs-core:2.0.3.RELEASE' implementation 'com.jayway.jsonpath:json-path:2.8.0' - compileOnly 'junit:junit:4.13.1' - testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:2.18.0' + compileOnly 'junit:junit:4.13.2' + testImplementation 'junit:junit:4.13.2' + testImplementation 'org.mockito:mockito-core:5.11.0' testImplementation 'org.skyscreamer:jsonassert:1.5.1' testImplementation 'com.google.guava:guava:30.0-jre' testImplementation 'org.hamcrest:hamcrest:2.2'