From a289c4723fc1c1dcf8b6e6b442347827d0a9fbca Mon Sep 17 00:00:00 2001 From: Alex Danilenko Date: Wed, 24 Apr 2024 15:16:35 +0200 Subject: [PATCH] upgrade dependencies --- .github/workflows/gradle.yml | 2 +- build.gradle | 6 ++-- core/build.gradle | 2 +- .../src/main/java/spotty/version/Version.java | 18 ++-------- .../spotty/server/SpottyStartSpec.groovy | 33 ++++++++++++++++--- gradle.properties | 24 ++++++++------ 6 files changed, 52 insertions(+), 33 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 8c3e6eb..afdbfd9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,5 +27,5 @@ jobs: if: failure() with: name: test-report - path: server/build/reports + path: core/build/reports retention-days: 1 \ No newline at end of file diff --git a/build.gradle b/build.gradle index f516cf3..ff51000 100644 --- a/build.gradle +++ b/build.gradle @@ -31,11 +31,13 @@ subprojects { compileOnly "org.slf4j:slf4j-api:$slf4jApiVersion" runtimeOnly "ch.qos.logback:logback-classic:$logbackClassicVersion" - testImplementation "org.codehaus.groovy:groovy-all:$groovyVersion" + testImplementation "org.apache.groovy:groovy-all:$groovyVersion" testImplementation "org.spockframework:spock-core:$spockVersion" + testImplementation "org.objenesis:objenesis:$objenesis" - testIntegrationImplementation "org.codehaus.groovy:groovy-all:$groovyVersion" + testIntegrationImplementation "org.apache.groovy:groovy-all:$groovyVersion" testIntegrationImplementation "org.spockframework:spock-core:$spockVersion" + testIntegrationImplementation "org.objenesis:objenesis:$objenesis" } test { diff --git a/core/build.gradle b/core/build.gradle index b009296..362d45d 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -8,7 +8,7 @@ dependencies { implementation "org.apache.tika:tika-core:$apacheTika" testImplementation "org.apache.commons:commons-lang3:$apacheCommons" - testImplementation "org.apache.httpcomponents:httpclient:$apacheHttpClientVersion" + testImplementation "org.apache.httpcomponents.client5:httpclient5:$apacheHttpClientVersion" testImplementation "org.awaitility:awaitility:$awaitilityVersion" testImplementation "com.konghq:unirest-java:$unirestVersion" } diff --git a/core/src/main/java/spotty/version/Version.java b/core/src/main/java/spotty/version/Version.java index f1a69f5..ac548c0 100644 --- a/core/src/main/java/spotty/version/Version.java +++ b/core/src/main/java/spotty/version/Version.java @@ -24,9 +24,9 @@ public final class Version implements Comparable, Serializable { private static final long serialVersionUID = 1L; - private final int major; - private final int minor; - private final int patch; + public final int major; + public final int minor; + public final int patch; private final String toString; private final int hash; @@ -55,18 +55,6 @@ public static Version parse(String version) { return new Version(major, minor, patch); } - public int major() { - return major; - } - - public int minor() { - return minor; - } - - public int patch() { - return patch; - } - @Override public int compareTo(Version version) { if (this.equals(version)) { diff --git a/core/src/testIntegration/groovy/spotty/server/SpottyStartSpec.groovy b/core/src/testIntegration/groovy/spotty/server/SpottyStartSpec.groovy index 020c88d..807ae9e 100644 --- a/core/src/testIntegration/groovy/spotty/server/SpottyStartSpec.groovy +++ b/core/src/testIntegration/groovy/spotty/server/SpottyStartSpec.groovy @@ -22,8 +22,7 @@ class SpottyStartSpec extends Specification { server.start() then: - !server.isStarted() - !server.isRunning() + server.isStarted() == false } def "should wait until started"() { @@ -32,8 +31,34 @@ class SpottyStartSpec extends Specification { server.awaitUntilStart() then: - server.isStarted() - server.isRunning() + server.isStarted() == true + } + + def "should not wait until stopped"() { + when: + server.start() + server.awaitUntilStart() + + server.stop() + + then: + server.isStarted() == true + } + + def "should wait until stopped"() { + when: + server.start() + server.awaitUntilStart() + + then: + server.isStarted() == true + + when: + server.stop() + server.awaitUntilStop() + + then: + server.isStarted() == false } } diff --git a/gradle.properties b/gradle.properties index 0879b1b..2fccaf8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,13 +8,17 @@ group=com.spotty-server version=1.0.5 # dependencies -groovyVersion=3.0.10 -spockVersion=2.2-M1-groovy-3.0 -slf4jApiVersion=1.7.36 -logbackClassicVersion=1.2.11 -unirestVersion=3.13.10 -apacheHttpClientVersion=4.5.13 -apacheCommons=3.12.0 -apacheTika=2.4.1 -awaitilityVersion=4.2.0 -googleGuavaVersion=31.1-jre \ No newline at end of file +groovyVersion=4.0.21 +spockVersion=2.4-M4-groovy-4.0 + +# spock requires this dependency +objenesis=3.3 + +slf4jApiVersion=2.0.13 +logbackClassicVersion=1.3.14 +unirestVersion=3.14.5 +apacheHttpClientVersion=5.3.1 +apacheCommons=3.14.0 +apacheTika=2.9.2 +awaitilityVersion=4.2.1 +googleGuavaVersion=33.1.0-jre \ No newline at end of file