Skip to content

Commit 8456624

Browse files
committed
chore(deps): update to Atrium v1.2
BREAKING CHANGE: Drop support for Java 8. This library now requires Java >= 11.
1 parent 8439c98 commit 8456624

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
java-version: [ 8, 11, 17, 21, 25 ]
17+
java-version: [ 11, 17, 21, 25 ]
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v5

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ build/
44

55
### IntelliJ
66
/.idea/
7+
8+
### Kotlin
9+
/.kotlin/

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919
}
2020

2121
dependencies {
22-
testImplementation("ch.tutteli.atrium:atrium-cc-en_GB-robstoll:0.15.0")
22+
testImplementation("ch.tutteli.atrium:atrium-fluent:1.2.0")
2323
testImplementation("org.junit.jupiter:junit-jupiter-api:5.14.1")
2424
testImplementation("org.junit.jupiter:junit-jupiter-params:5.14.1")
2525

@@ -31,7 +31,7 @@ dependencies {
3131
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.14.1")
3232
}
3333

34-
val compilationTargetJavaVersion = JavaLanguageVersion.of(8)
34+
val compilationTargetJavaVersion = JavaLanguageVersion.of(11)
3535

3636
java {
3737
toolchain {

src/test/kotlin/BaseNotationTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.joshuagleitze.stringnotation
22

33
import ch.tutteli.atrium.api.fluent.en_GB.feature
4-
import ch.tutteli.atrium.api.fluent.en_GB.toBe
4+
import ch.tutteli.atrium.api.fluent.en_GB.toEqual
55
import ch.tutteli.atrium.api.verbs.expect
66
import org.junit.jupiter.api.Assumptions.assumeTrue
77
import org.junit.jupiter.api.TestInstance
@@ -22,7 +22,7 @@ abstract class BaseNotationTest(
2222
fun `parses words correctly`(minimumJavaVersion: Int, input: String, expectedWord: Word) {
2323
assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion")
2424
expect(input.fromNotation(notation)) {
25-
feature(Word::partsList).toBe(expectedWord.partsList)
25+
feature(Word::partsList).toEqual(expectedWord.partsList)
2626
}
2727
}
2828

@@ -31,7 +31,7 @@ abstract class BaseNotationTest(
3131
fun `prints words correctly`(minimumJavaVersion: Int, expectedResult: String, sourceWord: Word) {
3232
assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion")
3333
expect(sourceWord) {
34-
feature(Word::toNotation, notation).toBe(expectedResult)
34+
feature(Word::toNotation, notation).toEqual(expectedResult)
3535
}
3636
}
3737

@@ -41,7 +41,7 @@ abstract class BaseNotationTest(
4141
assumeTrue(currentJavaVersion >= minimumJavaVersion, "Requires at least Java $minimumJavaVersion")
4242
expect(word) {
4343
feature(String::fromNotation, notation) {
44-
feature(Word::toNotation, notation).toBe(word)
44+
feature(Word::toNotation, notation).toEqual(word)
4545
}
4646
}
4747
}

src/test/kotlin/WordTest.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,65 @@ class WordTest {
88
@Test
99
fun `implements #equals`() {
1010
val aInstance = Word("a")
11-
expect(aInstance).toBe(aInstance)
12-
expect(aInstance).toBe(Word("a"))
13-
expect(Word("a")).notToBe(Word("A"))
11+
expect(aInstance).toEqual(aInstance)
12+
expect(aInstance).toEqual(Word("a"))
13+
expect(Word("a")).notToEqual(Word("A"))
1414
}
1515

1616
@Test
1717
fun `implements #hashCode`() {
1818
expect(Word("a"))
1919
.feature(Word::hashCode)
20-
.toBe(Word("a").hashCode())
20+
.toEqual(Word("a").hashCode())
2121
}
2222

2323
@Test
2424
fun `exposes parts as list`() {
25-
expect(Word("with", "parts")).feature(Word::partsList).containsExactly("with", "parts")
26-
expect(Word(listOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts")
27-
expect(Word(sequenceOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts")
25+
expect(Word("with", "parts")).feature(Word::partsList).toContainExactly("with", "parts")
26+
expect(Word(listOf("with", "parts"))).feature(Word::partsList).toContainExactly("with", "parts")
27+
expect(Word(sequenceOf("with", "parts"))).feature(Word::partsList).toContainExactly("with", "parts")
2828
}
2929

3030
@Test
3131
fun `exposes parts as sequence`() {
32-
expect(Word("with", "parts")).feature(Word::parts).asIterable().containsExactly("with", "parts")
33-
expect(Word(listOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts")
34-
expect(Word(sequenceOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts")
32+
expect(Word("with", "parts")).feature(Word::parts).asIterable().toContainExactly("with", "parts")
33+
expect(Word(listOf("with", "parts"))).feature(Word::parts).asIterable().toContainExactly("with", "parts")
34+
expect(Word(sequenceOf("with", "parts"))).feature(Word::parts).asIterable().toContainExactly("with", "parts")
3535
}
3636

3737
@Test
3838
fun `allows to add parts`() {
3939
expect((Word("with") + "more" + "parts"))
40-
.toBe(Word("with", "more", "parts"))
40+
.toEqual(Word("with", "more", "parts"))
4141
expect(Word("with").plus("more", "parts"))
42-
.toBe(Word("with", "more", "parts"))
42+
.toEqual(Word("with", "more", "parts"))
4343
}
4444

4545
@Test
4646
fun `allows to add words`() {
4747
expect(Word("with") + Word("more", "parts"))
48-
.toBe(Word("with", "more", "parts"))
48+
.toEqual(Word("with", "more", "parts"))
4949
}
5050

5151
@Test
5252
fun `allows to map parts`() {
5353
expect(Word("a", "b", "c"))
5454
.feature(Word::mapParts, String::uppercase)
55-
.toBe(Word("A", "B", "C"))
55+
.toEqual(Word("A", "B", "C"))
5656
}
5757

5858
@Test
5959
fun `allows to flatMap parts`() {
6060
expect(Word("a", "b"))
61-
.feature(Word::flatMapParts) { it -> sequenceOf("${it}1", "${it}2") }
62-
.toBe(Word("a1", "a2", "b1", "b2"))
61+
.feature(Word::flatMapParts) { sequenceOf("${it}1", "${it}2") }
62+
.toEqual(Word("a1", "a2", "b1", "b2"))
6363
}
6464

6565
@Test
6666
fun `allows to parse parts from a notation`() {
6767
expect("these are words with UpperCamelCase")
6868
.feature(String::fromNotation, NormalWords)
6969
.feature(Word::partsFromNotation, UpperCamelCase)
70-
.toBe(Word("these", "are", "words", "with", "upper", "camel", "case"))
70+
.toEqual(Word("these", "are", "words", "with", "upper", "camel", "case"))
7171
}
7272
}

0 commit comments

Comments
 (0)