Slackbot
02/15/2024, 4:49 PMTom
02/15/2024, 5:44 PMEric Deandrea
02/15/2024, 5:45 PMTom
02/15/2024, 5:45 PMEric Deandrea
02/15/2024, 5:46 PMTom
02/15/2024, 5:47 PM./gradlew shadowJar
with JDK11 against the current HEAD/master?Eric Deandrea
02/15/2024, 5:47 PMwiremock-grpc-extension
repo?Tom
02/15/2024, 5:48 PMwiremock
Eric Deandrea
02/15/2024, 5:49 PMTom
02/15/2024, 5:53 PMEric Deandrea
02/15/2024, 6:00 PMEric Deandrea
02/15/2024, 6:00 PMTom
02/15/2024, 6:00 PMEric Deandrea
02/15/2024, 6:01 PMconfigurations.all {
resolutionStrategy.eachDependency { details ->
if ((details.requested.group == 'org.ow2.asm') && (details.requested.name == 'asm')) {
details.useVersion '9.4'
details.because 'we need to use Java 11 as a baseline'
}
}
}
Tom
02/15/2024, 6:01 PMEric Deandrea
02/15/2024, 6:04 PMEric Deandrea
02/15/2024, 6:04 PMconfigurations.all
stanza into the buildscript
blockEric Deandrea
02/15/2024, 6:05 PMbuildscript {
repositories {
maven {
url "<https://oss.sonatype.org>"
}
mavenCentral()
}
configurations.all {
resolutionStrategy.eachDependency { details ->
if ((details.requested.group == 'org.ow2.asm') && (details.requested.name == 'asm')) {
details.useVersion '9.4'
details.because 'we need to use Java 11 as a baseline'
}
}
}
}
Eric Deandrea
02/15/2024, 6:05 PM./gradlew buildEnvironment
I can see that asm is now downgraded…Tom
02/15/2024, 6:06 PMEric Deandrea
02/15/2024, 6:06 PMEric Deandrea
02/15/2024, 6:06 PMclasspath
+--- com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:6.25.0
| \--- com.diffplug.spotless:spotless-plugin-gradle:6.25.0
| +--- com.diffplug.durian:durian-core:1.2.0
| +--- com.diffplug.durian:durian-io:1.2.0
| | +--- com.diffplug.durian:durian-core:1.2.0
| | \--- com.diffplug.durian:durian-collect:1.2.0
| | \--- com.diffplug.durian:durian-core:1.2.0
| +--- com.diffplug.durian:durian-collect:1.2.0 (*)
| +--- org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r
| | +--- com.googlecode.javaewah:JavaEWAH:1.2.3
| | +--- org.slf4j:slf4j-api:1.7.36
| | \--- commons-codec:commons-codec:1.16.0
| +--- com.diffplug.spotless:spotless-lib:2.45.0
| \--- com.diffplug.spotless:spotless-lib-extra:2.45.0
| +--- com.diffplug.durian:durian-core:1.2.0
| +--- com.diffplug.durian:durian-collect:1.2.0 (*)
| +--- org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r (*)
| +--- com.googlecode.concurrent-trees:concurrent-trees:2.6.1
| +--- dev.equo.ide:solstice:1.7.5
| | +--- org.tukaani:xz:1.9
| | +--- com.squareup.okhttp3:okhttp:4.12.0
| | | +--- com.squareup.okio:okio:3.6.0
| | | | \--- com.squareup.okio:okio-jvm:3.6.0
| | | | +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
| | | | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10
| | | | | | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
| | | | | | \--- org.jetbrains:annotations:13.0
| | | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
| | | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*)
| | | | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
| | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
| | +--- org.slf4j:slf4j-api:1.7.36
| | +--- com.diffplug.durian:durian-swt.os:4.2.2
| | \--- org.eclipse.platform:org.eclipse.osgi:3.18.300
| \--- com.diffplug.spotless:spotless-lib:2.45.0
+--- com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.0
| \--- com.github.johnrengelman:shadow:8.1.0
| +--- org.jdom:jdom2:2.0.6.1
| +--- org.ow2.asm:asm:9.4
| +--- org.ow2.asm:asm-commons:9.4
| | +--- org.ow2.asm:asm:9.4
| | \--- org.ow2.asm:asm-tree:9.4
| | \--- org.ow2.asm:asm:9.4
| +--- commons-io:commons-io:2.11.0
| +--- org.apache.ant:ant:1.10.13
| | \--- org.apache.ant:ant-launcher:1.10.13
| +--- org.codehaus.plexus:plexus-utils:3.5.0
| +--- org.apache.logging.log4j:log4j-core:2.20.0
| | \--- org.apache.logging.log4j:log4j-api:2.20.0
| \--- org.vafer:jdependency:2.8.0
+--- org.sonarqube:org.sonarqube.gradle.plugin:4.4.1.3373
| \--- org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373
| \--- org.sonarsource.scanner.api:sonar-scanner-api:2.16.2.588
\--- org.apache.logging.log4j:log4j-core:{require 2.17.1; reject [2.0, 2.17.1)} -> 2.20.0 (c)
Tom
02/15/2024, 6:07 PMTom
02/15/2024, 6:08 PMEric Deandrea
02/15/2024, 6:09 PMEric Deandrea
02/15/2024, 6:09 PMapi
dependency directly to 9.6Tom
02/15/2024, 6:10 PMTom
02/15/2024, 6:10 PMEric Deandrea
02/15/2024, 6:39 PMEric Deandrea
02/15/2024, 6:41 PMTom
02/15/2024, 6:41 PMEric Deandrea
02/15/2024, 6:41 PMEric Deandrea
02/15/2024, 6:41 PMEric Deandrea
02/15/2024, 7:13 PMruntimeClasspath
and standaloneOnly
configurations
tasks.register('printManifests') {
doLast {
(configurations.runtimeClasspath + configurations.standaloneOnly).each { dep ->
println '==============================='
println "Inside dependency: $dep.name"
println resources.text.fromArchiveEntry(dep, 'META-INF/MANIFEST.MF').asString()
}
}
}
Eric Deandrea
02/15/2024, 8:23 PMtasks.register('unzipDeps') {
doLast {
(configurations.runtimeClasspath + configurations.standaloneOnly).asFileTree.each { dep ->
copy {
from(zipTree(dep)) {
include '**/*.class'
exclude '**/META-INF/**'
includeEmptyDirs false
}
into "$buildDir/deps/$dep.name"
duplicatesStrategy = DuplicatesStrategy.WARN
}
}
}
}
tasks.register('findClassVersion') {
dependsOn 'unzipDeps'
doLast {
file("$buildDir/deps").eachFileRecurse(groovy.io.FileType.FILES) {file ->
println '============================='
println "file: $file"
exec {
ignoreExitValue true
workingDir file.parent
commandLine 'bash', '-c', "javap -verbose $file.name | grep major"
}
}
}
}
Eric Deandrea
02/15/2024, 8:26 PM./gradlew findClassVersion > classVersions.txt
Eric Deandrea
02/15/2024, 8:30 PMEric Deandrea
02/15/2024, 8:30 PMEric Deandrea
02/15/2024, 9:06 PMTom
02/15/2024, 9:10 PMEric Deandrea
02/15/2024, 9:10 PMEric Deandrea
02/15/2024, 9:10 PMEric Deandrea
02/15/2024, 9:19 PMEric Deandrea
02/15/2024, 9:20 PMdependencies {
sample 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0'
sample 'com.github.johnrengelman:shadow:8.1.1'
sample 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.4.1.3373'
sample 'org.apache.logging.log4j:log4j-core:2.20.0'
}
and also had to add gradlePluginPortal()
to the repositories
Eric Deandrea
02/15/2024, 9:44 PMEric Deandrea
02/15/2024, 9:49 PMEric Deandrea
02/15/2024, 10:01 PMTom
02/15/2024, 10:03 PMEric Deandrea
02/15/2024, 10:04 PMTom
02/16/2024, 2:30 PMEric Deandrea
02/16/2024, 3:13 PMTom
02/16/2024, 3:15 PMTom
02/16/2024, 3:15 PMEric Deandrea
02/16/2024, 3:16 PMEric Deandrea
02/16/2024, 3:16 PMTom
02/16/2024, 3:17 PMEric Deandrea
02/16/2024, 3:18 PMTom
02/16/2024, 3:19 PM.class
rather than limiting itself to specific roots.Tom
02/17/2024, 11:17 AMTom
02/17/2024, 11:18 AMTom
02/17/2024, 11:18 AMEric Deandrea
02/19/2024, 12:42 PMEric Deandrea
02/20/2024, 6:38 PM@RegisterExtension
and instead follow the usage instructions on the extension README (https://github.com/wiremock/wiremock-grpc-extension?tab=readme-ov-file#java-usage) to use the WireMockServer
WireMockServer wm = new WireMockServer(wireMockConfig()
.dynamicPort()
.withRootDirectory("src/test/resources/wiremock")
.extensions(new GrpcExtensionFactory())
));
WireMockGrpcService mockGreetingService =
new WireMockGrpcService(
new WireMock(wm.getPort()),
"com.example.grpc.GreetingService"
);
But that doesn’t seem to work. When I re-run the tests in GrpcTest
I get
╰─ ./gradlew clean build
Failed to map supported failure 'org.opentest4j.AssertionFailedError: Expected io.grpc.StatusRuntimeException to be thrown, but nothing was thrown.' with mapper 'org.gradle.api.internal.tasks.testing.failure.mappers.OpenTestAssertionFailedMapper@5e26f1ed': Cannot invoke "Object.getClass()" because "obj" is null
> Task :test FAILED
GrpcTest > dynamic_response_via_JSON() PASSED
GrpcTest > request_matching_with_JSON() FAILED
org.opentest4j.AssertionFailedError: Expected io.grpc.StatusRuntimeException to be thrown, but nothing was thrown.
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
at app//org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3115)
at app//wiremock.grpc.GrpcTest.request_matching_with_JSON(GrpcTest.java:114)
GrpcTest > non_OK_status() PASSED
GrpcTest > streaming_request_unary_response() PASSED
GrpcTest > unary_request_streaming_response() PASSED
GrpcTest > request_matching_with_message() FAILED
java.lang.AssertionError:
Expected: is "NOT_FOUND: No matching stub mapping found for gRPC request"
but: was "FAILED_PRECONDITION: Failed some blah prerequisite"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
at wiremock.grpc.GrpcTest.request_matching_with_message(GrpcTest.java:128)
GrpcTest > response_from_message() PASSED
7 tests completed, 2 failed
Eric Deandrea
02/20/2024, 6:48 PMEric Deandrea
02/20/2024, 6:52 PMEric Deandrea
02/20/2024, 6:53 PMTom
02/21/2024, 10:27 AM