Skip to content

Commit

Permalink
Merge pull request #156 from holomekc/feat/wiremock-3.5.2
Browse files Browse the repository at this point in the history
feat: Update to WireMock 3.5.2
  • Loading branch information
holomekc authored Apr 1, 2024
2 parents 254d56b + c03781e commit 99bc316
Show file tree
Hide file tree
Showing 185 changed files with 5,540 additions and 1,360 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ notes.txt
# MINE #
Guide.txt
docker
src/main/resources/wiremock-gui-version.properties
87 changes: 87 additions & 0 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 96 additions & 63 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {

plugins {
id 'java-library'
id 'java-test-fixtures'
id 'scala'
id 'signing'
id 'maven-publish'
Expand All @@ -23,7 +24,8 @@ plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id "org.sonarqube" version "4.4.1.3373"
id 'jacoco'
id 'com.github.node-gradle.node' version '7.0.1'
id "me.champeau.jmh" version "0.7.2"
id 'com.github.node-gradle.node' version '7.0.2'
}

group = 'org.wiremock'
Expand All @@ -32,8 +34,8 @@ project.ext {
versions = [
handlebars : '4.3.1',
jetty : '11.0.20',
guava : '33.0.0-jre',
jackson : '2.16.1',
guava : '33.1.0-jre',
jackson : '2.17.0',
xmlUnit : '2.9.1',
jsonUnit : '2.38.0',
junitJupiter: '5.10.2'
Expand All @@ -58,7 +60,7 @@ dependencies {
api "org.eclipse.jetty:jetty-alpn-java-client"
api "org.eclipse.jetty:jetty-alpn-client"

api "org.eclipse.jetty.websocket:websocket-jakarta-server"
api "org.eclipse.jetty.websocket:websocket-jakarta-server:$versions.jetty"

api "io.jsonwebtoken:jjwt-api:0.11.5"
api "io.jsonwebtoken:jjwt-impl:0.11.5"
Expand All @@ -83,7 +85,6 @@ dependencies {
api "com.jayway.jsonpath:json-path:2.9.0", {
exclude group: 'org.ow2.asm', module: 'asm'
}
api "org.ow2.asm:asm:9.6"

implementation "org.slf4j:slf4j-api:1.7.36"
standaloneOnly "org.slf4j:slf4j-nop:1.7.36"
Expand All @@ -96,60 +97,52 @@ dependencies {
compileOnly(platform("org.junit:junit-bom:$versions.junitJupiter"))
compileOnly("org.junit.jupiter:junit-jupiter")

api 'org.apache.commons:commons-lang3:3.14.0'
api "com.github.jknack:handlebars:$versions.handlebars", {
exclude group: 'org.mozilla', module: 'rhino'
}
api("com.github.jknack:handlebars-helpers:$versions.handlebars") {
exclude group: 'org.mozilla', module: 'rhino'
exclude group: 'org.apache.commons', module: 'commons-lang3'
}

api 'commons-fileupload:commons-fileupload:1.5', {
exclude group: 'commons-io', module: 'commons-io'
}
api "commons-io:commons-io:2.15.1"

api 'com.networknt:json-schema-validator:1.3.3'

testImplementation "junit:junit:4.13"
testImplementation("org.junit.jupiter:junit-jupiter:$versions.junitJupiter")
testImplementation("org.junit.platform:junit-platform-testkit")
api "commons-io:commons-io:2.16.0"

api 'com.networknt:json-schema-validator:1.4.0'

testFixturesApi("org.junit.jupiter:junit-jupiter:$versions.junitJupiter")
testFixturesApi("org.junit.platform:junit-platform-testkit")
testFixturesApi("org.junit.platform:junit-platform-launcher")
testFixturesApi("org.junit.jupiter:junit-jupiter-params")
testFixturesApi('org.junit-pioneer:junit-pioneer:2.2.0')
testFixturesApi "org.hamcrest:hamcrest-core:2.2"
testFixturesApi "org.hamcrest:hamcrest-library:2.2"
testFixturesApi 'org.mockito:mockito-core:5.11.0'
testFixturesApi 'org.mockito:mockito-junit-jupiter:5.11.0'
testFixturesApi "net.javacrumbs.json-unit:json-unit:$versions.jsonUnit"
testFixturesApi "org.skyscreamer:jsonassert:1.5.1"
testFixturesApi 'com.toomuchcoding.jsonassert:jsonassert:0.8.0'
testFixturesApi 'org.awaitility:awaitility:4.2.1'
testFixturesApi "commons-io:commons-io:2.16.0"

testImplementation "junit:junit:4.13.2"
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
testImplementation("org.junit.platform:junit-platform-launcher")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation('org.junit-pioneer:junit-pioneer:2.2.0')

testImplementation "org.hamcrest:hamcrest-core:2.2"
testImplementation "org.hamcrest:hamcrest-library:2.2"
testImplementation 'org.mockito:mockito-core:5.10.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.10.0'
testImplementation "net.javacrumbs.json-unit:json-unit:$versions.jsonUnit"
testImplementation "org.skyscreamer:jsonassert:1.2.3"
testImplementation 'com.toomuchcoding.jsonassert:jsonassert:0.8.0'
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation "com.googlecode.jarjar:jarjar:1.3"
testImplementation "commons-io:commons-io:2.15.1"
testImplementation 'org.scala-lang:scala-library:2.13.13'
testImplementation 'com.tngtech.archunit:archunit-junit5:0.23.1'

testImplementation "org.eclipse.jetty:jetty-client"
testImplementation "org.eclipse.jetty.http2:http2-http-client-transport"
testRuntimeOnly "org.slf4j:log4j-over-slf4j:2.0.12"
testRuntimeOnly "ch.qos.logback:logback-classic:1.4.0"
testRuntimeOnly files('src/test/resources/classpath file source/classpathfiles.zip', 'src/test/resources/classpath-filesource.jar')

testImplementation('net.jockx:littleproxy:1.1.3') {
exclude group: 'com.google.guava', module: 'guava'
exclude group: 'org.apache.commons', module: 'commons-lang3'
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'io.netty', module: 'netty-all'
}
testImplementation "io.netty:netty-all:4.1.107.Final"

testImplementation files('test-extension/test-extension.jar')

testImplementation 'org.openjdk.jmh:jmh-core:1.37'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.37'

constraints {
implementation "net.minidev:json-smart:2.5.0", {
implementation "net.minidev:json-smart:2.5.1", {
because 'Pinning this above the transitive version from json-path to get CVE fix'
}
}
Expand Down Expand Up @@ -226,10 +219,6 @@ allprojects {
version = '1.0.0-Snapshot'
}


sourceCompatibility = 11
targetCompatibility = 11

compileJava {
options.encoding = 'UTF-8'

Expand All @@ -244,6 +233,10 @@ allprojects {
options.compilerArgs += '--add-exports=java.base/sun.security.x509=ALL-UNNAMED'
}

compileTestFixturesJava {
options.encoding = 'UTF-8'
}

test {
// Set the timezone for testing somewhere other than my machine to increase the chances of catching timezone bugs
systemProperty 'user.timezone', 'Australia/Sydney'
Expand Down Expand Up @@ -277,7 +270,11 @@ allprojects {
shadowJar.dependsOn jar
}

test.classpath += sourceSets.main.compileClasspath + sourceSets.main.runtimeClasspath

java {
sourceCompatibility = 11
targetCompatibility = 11
withSourcesJar()
withJavadocJar()
}
Expand Down Expand Up @@ -376,36 +373,55 @@ publishing {
}
}

components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }

getComponents().withType(AdhocComponentWithVariants).each { c ->
c.withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publications {
mavenJava(MavenPublication) { publication ->
artifactId = "${jar.getArchiveBaseName().get()}"
from components.java
artifact testJar
if (JavaVersion.current().isJava11()) {
publications {
mavenJava(MavenPublication) { publication ->
artifactId = "${jar.getArchiveBaseName().get()}"
from components.java
artifact testJar

pom.withXml {
asNode().appendNode('description', 'A web service test double for all occasions')
asNode().children().last() + pomInfo
pom.withXml {
asNode().appendNode('description', 'A web service test double for all occasions')
asNode().children().last() + pomInfo
}
}
}

standaloneJar(MavenPublication) { publication ->
artifactId = "${jar.getArchiveBaseName().get()}-standalone"
project.shadow.component(publication)
standaloneJar(MavenPublication) { publication ->
artifactId = "${jar.getArchiveBaseName().get()}-standalone"
project.shadow.component(publication)

artifact sourcesJar
artifact javadocJar
artifact testJar
artifact sourcesJar
artifact javadocJar
artifact testJar

pom.packaging 'jar'
pom.withXml {
asNode().appendNode('description', 'A web service test double for all occasions - standalone edition')
asNode().children().last() + pomInfo
pom.packaging 'jar'
pom.withXml {
asNode().appendNode('description', 'A web service test double for all occasions - standalone edition')
asNode().children().last() + pomInfo
}
}
}
}

nexusPublishing {
// See https://github.com/wiremock/community/blob/main/infra/maven-central.md
repositories {
sonatype {
def envUsername = providers.environmentVariable("OSSRH_USERNAME").orElse("").get()
def envPassword = providers.environmentVariable("OSSRH_TOKEN").orElse("").get()
if (!envUsername.isEmpty() && !envPassword.isEmpty()) {
username.set(envUsername)
password.set(envPassword)
}
}
}
}
Expand All @@ -416,7 +432,6 @@ task checkReleasePreconditions {
def REQUIRED_GIT_BRANCH = 'master'
def currentGitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()
assert currentGitBranch == REQUIRED_GIT_BRANCH, "Must be on the $REQUIRED_GIT_BRANCH branch in order to release to Sonatype"
assert JavaVersion.current().isJava11(), 'Must use Java 8 when releasing'
}
}

Expand All @@ -443,8 +458,21 @@ task generateWebapp(type: NpmTask) {
args = ['run', 'prod']
}

task finalizeWebapp(type: Copy) {
task versionTxt() {
dependsOn generateWebapp
doLast {
def wiremockVersionProps = new Properties()
wiremockVersionProps.load(new FileInputStream(projectDir.getAbsolutePath() + "/src/main/resources/version.properties"))
def wiremockVersion = wiremockVersionProps.getProperty("version")
new File(projectDir.getAbsolutePath() + "/src/main/resources", "wiremock-gui-version.properties").text = """# version file
gui-version=$version
version=$wiremockVersion
"""
}
}

task finalizeWebapp(type: Copy) {
dependsOn versionTxt
// Because of: https://github.com/angular/angular-cli/issues/26304
// we need to copy some things around.
from 'webapp/wiremock/dist/browser'
Expand Down Expand Up @@ -593,3 +621,8 @@ wrapper {
gradleVersion = '8.6'
distributionType = Wrapper.DistributionType.BIN
}

jmh {
includes = ['.*benchmarks.*']
threads = 50
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.apache.commons.lang3.RandomStringUtils.randomAscii;

public class LoadTestConfiguration {

Expand Down
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
rootProject.name = 'wiremock'
if (JavaVersion.current() >= JavaVersion.VERSION_17) {
include 'wiremock-jetty12'
}
Loading

0 comments on commit 99bc316

Please sign in to comment.