From 479907d0de66c6c14637bbd1187565dc2b26084c Mon Sep 17 00:00:00 2001 From: Joshua Gleitze Date: Sun, 9 Nov 2025 21:40:43 +0100 Subject: [PATCH] chore(deps): update to Atrium v1.2 BREAKING CHANGE: Drop support for Java 8. This library now requires Java >= 11. --- .github/workflows/ci.yml | 2 +- .gitignore | 3 +++ build.gradle.kts | 4 ++-- src/test/kotlin/BaseNotationTest.kt | 8 +++---- src/test/kotlin/WordTest.kt | 34 ++++++++++++++--------------- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63c8b45..0a8fce7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [ 8, 11, 17, 21, 25 ] + java-version: [ 11, 17, 21, 25 ] steps: - name: Checkout uses: actions/checkout@v5 diff --git a/.gitignore b/.gitignore index a4cb730..1666bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ build/ ### IntelliJ /.idea/ + +### Kotlin +/.kotlin/ diff --git a/build.gradle.kts b/build.gradle.kts index 0d07e6f..5847996 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ repositories { } dependencies { - testImplementation("ch.tutteli.atrium:atrium-cc-en_GB-robstoll:0.15.0") + testImplementation("ch.tutteli.atrium:atrium-fluent:1.2.0") testImplementation("org.junit.jupiter:junit-jupiter-api:5.14.1") testImplementation("org.junit.jupiter:junit-jupiter-params:5.14.1") @@ -31,7 +31,7 @@ dependencies { testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.14.1") } -val compilationTargetJavaVersion = JavaLanguageVersion.of(8) +val compilationTargetJavaVersion = JavaLanguageVersion.of(11) java { toolchain { diff --git a/src/test/kotlin/BaseNotationTest.kt b/src/test/kotlin/BaseNotationTest.kt index 7461ee0..c0e5eab 100644 --- a/src/test/kotlin/BaseNotationTest.kt +++ b/src/test/kotlin/BaseNotationTest.kt @@ -1,7 +1,7 @@ package de.joshuagleitze.stringnotation import ch.tutteli.atrium.api.fluent.en_GB.feature -import ch.tutteli.atrium.api.fluent.en_GB.toBe +import ch.tutteli.atrium.api.fluent.en_GB.toEqual import ch.tutteli.atrium.api.verbs.expect import org.junit.jupiter.api.Assumptions.assumeTrue import org.junit.jupiter.api.TestInstance @@ -22,7 +22,7 @@ abstract class BaseNotationTest( fun `parses words correctly`(minimumJavaVersion: Int, input: String, expectedWord: Word) { assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion") expect(input.fromNotation(notation)) { - feature(Word::partsList).toBe(expectedWord.partsList) + feature(Word::partsList).toEqual(expectedWord.partsList) } } @@ -31,7 +31,7 @@ abstract class BaseNotationTest( fun `prints words correctly`(minimumJavaVersion: Int, expectedResult: String, sourceWord: Word) { assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion") expect(sourceWord) { - feature(Word::toNotation, notation).toBe(expectedResult) + feature(Word::toNotation, notation).toEqual(expectedResult) } } @@ -41,7 +41,7 @@ abstract class BaseNotationTest( assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion") expect(word) { feature(String::fromNotation, notation) { - feature(Word::toNotation, notation).toBe(word) + feature(Word::toNotation, notation).toEqual(word) } } } diff --git a/src/test/kotlin/WordTest.kt b/src/test/kotlin/WordTest.kt index 21092e5..01abef7 100644 --- a/src/test/kotlin/WordTest.kt +++ b/src/test/kotlin/WordTest.kt @@ -8,58 +8,58 @@ class WordTest { @Test fun `implements #equals`() { val aInstance = Word("a") - expect(aInstance).toBe(aInstance) - expect(aInstance).toBe(Word("a")) - expect(Word("a")).notToBe(Word("A")) + expect(aInstance).toEqual(aInstance) + expect(aInstance).toEqual(Word("a")) + expect(Word("a")).notToEqual(Word("A")) } @Test fun `implements #hashCode`() { expect(Word("a")) .feature(Word::hashCode) - .toBe(Word("a").hashCode()) + .toEqual(Word("a").hashCode()) } @Test fun `exposes parts as list`() { - expect(Word("with", "parts")).feature(Word::partsList).containsExactly("with", "parts") - expect(Word(listOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts") - expect(Word(sequenceOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts") + expect(Word("with", "parts")).feature(Word::partsList).toContainExactly("with", "parts") + expect(Word(listOf("with", "parts"))).feature(Word::partsList).toContainExactly("with", "parts") + expect(Word(sequenceOf("with", "parts"))).feature(Word::partsList).toContainExactly("with", "parts") } @Test fun `exposes parts as sequence`() { - expect(Word("with", "parts")).feature(Word::parts).asIterable().containsExactly("with", "parts") - expect(Word(listOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts") - expect(Word(sequenceOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts") + expect(Word("with", "parts")).feature(Word::parts).asIterable().toContainExactly("with", "parts") + expect(Word(listOf("with", "parts"))).feature(Word::parts).asIterable().toContainExactly("with", "parts") + expect(Word(sequenceOf("with", "parts"))).feature(Word::parts).asIterable().toContainExactly("with", "parts") } @Test fun `allows to add parts`() { expect((Word("with") + "more" + "parts")) - .toBe(Word("with", "more", "parts")) + .toEqual(Word("with", "more", "parts")) expect(Word("with").plus("more", "parts")) - .toBe(Word("with", "more", "parts")) + .toEqual(Word("with", "more", "parts")) } @Test fun `allows to add words`() { expect(Word("with") + Word("more", "parts")) - .toBe(Word("with", "more", "parts")) + .toEqual(Word("with", "more", "parts")) } @Test fun `allows to map parts`() { expect(Word("a", "b", "c")) .feature(Word::mapParts, String::uppercase) - .toBe(Word("A", "B", "C")) + .toEqual(Word("A", "B", "C")) } @Test fun `allows to flatMap parts`() { expect(Word("a", "b")) - .feature(Word::flatMapParts) { it -> sequenceOf("${it}1", "${it}2") } - .toBe(Word("a1", "a2", "b1", "b2")) + .feature(Word::flatMapParts) { sequenceOf("${it}1", "${it}2") } + .toEqual(Word("a1", "a2", "b1", "b2")) } @Test @@ -67,6 +67,6 @@ class WordTest { expect("these are words with UpperCamelCase") .feature(String::fromNotation, NormalWords) .feature(Word::partsFromNotation, UpperCamelCase) - .toBe(Word("these", "are", "words", "with", "upper", "camel", "case")) + .toEqual(Word("these", "are", "words", "with", "upper", "camel", "case")) } }