Skip to content

Commit

Permalink
chore: Upgrade Kotlin to 1.8.21, KTor to 2.3, plugin driver to 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed May 5, 2023
1 parent a4d0597 commit 1fafbf4
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
module: [ core, consumer, provider, pact-specification-test ]
jdk: [ 11, 17, 18 ]
jdk: [ 17, 18 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repositories {
}

dependencies {
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22'
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21'
implementation 'io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0'
implementation 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.20'
implementation 'org.jetbrains.dokka:dokka-gradle-plugin:1.8.10'
implementation 'org.apache.commons:commons-text:1.5'
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,41 @@ repositories {
version = '4.6.0'

java {
targetCompatibility = '11'
sourceCompatibility = '11'
targetCompatibility = '17'
sourceCompatibility = '17'
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
}
}

dependencies {
constraints {
// Define dependency versions as constraints
api 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
api 'org.apache.httpcomponents.client5:httpclient5-fluent:5.1.3'
api 'org.json:json:20220924'
api 'io.pact.plugin.driver:core:0.3.2'
api 'org.apache.tika:tika-core:1.28.5'
api 'org.apache.httpcomponents.client5:httpclient5:5.2.1'
api 'org.apache.httpcomponents.client5:httpclient5-fluent:5.2.1'
api 'org.json:json:20230227'
api 'io.pact.plugin.driver:core:0.4.0'
api 'org.apache.tika:tika-core:2.7.0'

implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.apache.tika:tika-core:1.28.5'
implementation 'com.google.guava:guava:30.1.1-jre'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'io.ktor:ktor-http-jvm:1.6.8'
implementation 'io.ktor:ktor-server-netty:1.6.8'
implementation 'io.ktor:ktor-network-tls-certificates:1.6.8'
implementation 'io.netty:netty-handler:4.1.84.Final'
implementation 'org.apache.tika:tika-core:2.7.0'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'io.ktor:ktor-http-jvm:2.3.0'
implementation 'io.ktor:ktor-server-netty:2.3.0'
implementation 'io.ktor:ktor-network-tls-certificates:2.3.0'
implementation 'io.ktor:ktor-server-call-logging:2.3.0'
implementation 'io.netty:netty-handler:4.1.86.Final'
implementation 'org.apache.groovy:groovy:4.0.11'
implementation 'org.apache.groovy:groovy-json:4.0.11'
implementation 'io.pact.plugin.driver:core:0.3.2'
implementation 'io.pact.plugin.driver:core:0.4.0'
implementation 'commons-codec:commons-codec:1.15'

testImplementation 'org.apache.groovy:groovy:4.0.11'
testImplementation 'org.apache.groovy:groovy-json:4.0.11'
Expand All @@ -56,9 +58,9 @@ dependencies {
testImplementation 'org.apache.groovy:groovy-nio:4.0.11'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'junit:junit:4.13.2'
testImplementation 'ch.qos.logback:logback-classic:1.4.4'
testImplementation 'ch.qos.logback:logback-core:1.4.4'
testImplementation 'net.bytebuddy:byte-buddy:1.12.7'
testImplementation 'ch.qos.logback:logback-classic:1.4.5'
testImplementation 'ch.qos.logback:logback-core:1.4.5'
testImplementation 'net.bytebuddy:byte-buddy:1.12.21'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.34.0'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
Expand Down
1 change: 1 addition & 0 deletions consumer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies {
implementation 'org.slf4j:slf4j-api'
implementation 'io.ktor:ktor-server-netty'
implementation 'io.ktor:ktor-network-tls-certificates'
implementation 'io.ktor:ktor-server-call-logging'
implementation('io.pact.plugin.driver:core') {
exclude group: 'au.com.dius.pact.core'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ import au.com.dius.pact.core.model.Pact
import au.com.dius.pact.core.model.Request
import au.com.dius.pact.core.model.Response
import au.com.dius.pact.core.support.Result
import io.ktor.application.ApplicationCall
import io.ktor.application.ApplicationCallPipeline
import io.ktor.application.install
import io.ktor.features.CallLogging
import io.ktor.http.HttpMethod
import io.ktor.http.HttpStatusCode
import io.ktor.request.httpMethod
import io.ktor.request.path
import io.ktor.request.receiveStream
import io.ktor.response.header
import io.ktor.response.respond
import io.ktor.response.respondBytes
import io.ktor.server.engine.ApplicationEngineEnvironment
import io.ktor.server.application.ApplicationCall
import io.ktor.server.application.ApplicationCallPipeline
import io.ktor.server.application.install
import io.ktor.server.engine.applicationEngineEnvironment
import io.ktor.server.engine.connector
import io.ktor.server.engine.embeddedServer
import io.ktor.server.engine.sslConnector
import io.ktor.server.netty.Netty
import io.ktor.server.netty.NettyApplicationEngine
import io.ktor.server.plugins.callloging.CallLogging
import io.ktor.server.request.httpMethod
import io.ktor.server.request.path
import io.ktor.server.request.receiveStream
import io.ktor.server.response.header
import io.ktor.server.response.respond
import io.ktor.server.response.respondBytes
import io.ktor.util.network.hostname
import io.ktor.util.network.port
import io.netty.channel.Channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import au.com.dius.pact.consumer.model.MockProviderConfig
import au.com.dius.pact.core.model.PactSpecVersion
import au.com.dius.pact.core.model.RequestResponsePact
import groovy.json.JsonSlurper
import io.ktor.network.tls.certificates.KeyType
import org.apache.hc.client5.http.classic.methods.HttpPost
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder
import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager
Expand Down Expand Up @@ -77,7 +78,7 @@ class PactTest {
.toPact()

def jksFile = File.createTempFile('PactTest', '.jks')
def keystore = generateCertificate(jksFile, 'SHA1withRSA', 'PactTest', 'changeit', 'changeit', 1024)
def keystore = generateCertificate(jksFile, 'SHA1withRSA', 'PactTest', 'changeit', 'changeit', 1024, KeyType.Server)

MockProviderConfig config = new MockHttpsProviderConfig('localhost', 8443, PactSpecVersion.V3,
keystore, 'PactTest', 'changeit', 'changeit')
Expand Down
1 change: 1 addition & 0 deletions core/model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies {

implementation 'org.apache.commons:commons-lang3'
implementation 'org.apache.commons:commons-collections4'
implementation 'commons-codec:commons-codec'
implementation 'org.slf4j:slf4j-api'
implementation 'com.github.mifmif:generex:1.0.2'
implementation 'javax.mail:mail:1.5.0-b01'
Expand Down
3 changes: 2 additions & 1 deletion core/support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ description = 'Pact-JVM Support module with common utilities'
group = 'au.com.dius.pact.core'

dependencies {
api 'io.github.microutils:kotlin-logging-jvm:2.1.23'
api 'io.github.microutils:kotlin-logging-jvm:3.0.4'
api 'org.apache.httpcomponents.client5:httpclient5'
api 'org.apache.httpcomponents.client5:httpclient5-fluent'

implementation 'org.apache.commons:commons-text'
implementation 'commons-codec:commons-codec'

testImplementation 'org.apache.groovy:groovy'
testImplementation 'org.hamcrest:hamcrest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ package au.com.dius.pact.core.support
import au.com.dius.pact.core.support.Utils.lookupVersion
import mu.KLogging
import org.apache.commons.codec.digest.DigestUtils
import java.util.concurrent.TimeUnit
import org.apache.hc.client5.http.fluent.Request
import org.apache.hc.core5.http.ContentType
import org.apache.hc.core5.http.message.BasicNameValuePair
import java.util.UUID
import java.util.concurrent.TimeUnit

/**
* Metric events to send
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package au.com.dius.pact.core.support

import org.apache.hc.client5.http.impl.classic.ProtocolExec
import org.apache.hc.client5.http.impl.classic.MainClientExec
import org.apache.hc.client5.http.protocol.RequestDefaultHeaders
import spock.lang.Specification

Expand All @@ -16,7 +16,7 @@ class HttpClientSpec extends Specification {
def defaultHeaders = null
def execChain = result.component1().execChain
while (defaultHeaders == null && execChain != null) {
if (execChain.handler instanceof ProtocolExec) {
if (execChain.handler instanceof MainClientExec) {
def interceptor = execChain.handler.httpProcessor.requestInterceptors.find {
it instanceof RequestDefaultHeaders
}
Expand Down

0 comments on commit 1fafbf4

Please sign in to comment.