Skip to content

Commit

Permalink
Bump assertk-jvm from 0.25 to 0.26.1 [BREAKING CHANGE]
Browse files Browse the repository at this point in the history
Bumps [assertk-jvm](https://github.com/willowtreeapps/assertk) from 0.25 to 0.26.1.
- [Release notes](https://github.com/willowtreeapps/assertk/releases)
- [Changelog](https://github.com/willowtreeapps/assertk/blob/main/CHANGELOG.md)
- [Commits](willowtreeapps/assertk@v0.25...v0.26.1)

Remove usages of deprecated `assertThat {}`.  Bump version
due to deprecation.

---
updated-dependencies:
- dependency-name: com.willowtreeapps.assertk:assertk-jvm
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and josephlbarnett committed Jun 6, 2023
1 parent 50fec8b commit 3287e42
Show file tree
Hide file tree
Showing 22 changed files with 143 additions and 126 deletions.
2 changes: 1 addition & 1 deletion build-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.trib3</groupId>
<artifactId>build-resources</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>

<name>Build Resources</name>
<description>Resources for use during the build process</description>
Expand Down
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>leakycauldron</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>leakycauldron</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.trib3.db.jooqext

import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.hasMessage
import assertk.assertions.isEmpty
import assertk.assertions.isEqualTo
import assertk.assertions.isFailure
import assertk.assertions.isInstanceOf
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -92,9 +91,9 @@ class ResultQueryFlowTest {
val list = mutableListOf<Int>()
runBlocking {
val collectJob = launch {
assertThat {
assertFailure {
query.consumeAsFlow().map { it["value"] as Int }.toList(list)
}.isFailure().isInstanceOf(RuntimeException::class.java).hasMessage("cancelled")
}.isInstanceOf(RuntimeException::class.java).hasMessage("cancelled")
}
launch {
iterateLatch.await() // wait for collection to start
Expand Down
2 changes: 1 addition & 1 deletion graphql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>leakycauldron</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.trib3.graphql.execution

import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isFailure
import assertk.assertions.isLessThan
import assertk.assertions.messageContains
import com.expediagroup.graphql.generator.extensions.get
Expand Down Expand Up @@ -80,9 +80,9 @@ class CoroutineBatchLoadersTest {
val loading = loader.load(setOf("1", "2", "3"), mockEnv)
this.coroutineContext[Job]?.cancelChildren()
val startAwaitTime = System.currentTimeMillis()
assertThat {
assertFailure {
loading.await()
}.isFailure().messageContains("was cancelled")
}.messageContains("was cancelled")
// ensure the delay() is not hit, but allow for slow test machines
assertThat(System.currentTimeMillis() - startAwaitTime).isLessThan(19000)
EasyMock.verify(mockEnv)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.trib3.graphql.execution

import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isFailure
import assertk.assertions.isInstanceOf
import assertk.assertions.isSuccess
import com.expediagroup.graphql.generator.SchemaGeneratorConfig
Expand Down Expand Up @@ -95,13 +95,15 @@ class LeakyCauldronHooksTest {
assertThat(result["year"]).isEqualTo("2020")
assertValidationErrors("""query {year(y:123)}""", """query {year(y:"123-45")}""")

assertThat {
assertFailure {
YEAR_SCALAR.coercing.serialize(123, GraphQLContext.getDefault(), Locale.getDefault())
}.isFailure().isInstanceOf(CoercingSerializeException::class)
}.isInstanceOf(CoercingSerializeException::class)

assertThat {
YEAR_SCALAR.coercing.serialize(Year.of(2019), GraphQLContext.getDefault(), Locale.getDefault())
}.isSuccess().isEqualTo("2019")
assertThat(
runCatching {
YEAR_SCALAR.coercing.serialize(Year.of(2019), GraphQLContext.getDefault(), Locale.getDefault())
},
).isSuccess().isEqualTo("2019")
}

@Test
Expand All @@ -120,17 +122,19 @@ class LeakyCauldronHooksTest {
assertThat(result["quarter"]).isEqualTo("2019-Q2")
assertValidationErrors("""query {quarter(q:123)}""", """query {quarter(q:"123")}""")

assertThat {
assertFailure {
YEAR_QUARTER_SCALAR.coercing.serialize(123, GraphQLContext.getDefault(), Locale.getDefault())
}.isFailure().isInstanceOf(CoercingSerializeException::class)

assertThat {
YEAR_QUARTER_SCALAR.coercing.serialize(
YearQuarter.of(2019, 2),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
}.isSuccess().isEqualTo("2019-Q2")
}.isInstanceOf(CoercingSerializeException::class)

assertThat(
runCatching {
YEAR_QUARTER_SCALAR.coercing.serialize(
YearQuarter.of(2019, 2),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
},
).isSuccess().isEqualTo("2019-Q2")
}

@Test
Expand All @@ -149,17 +153,19 @@ class LeakyCauldronHooksTest {
assertThat(result["month"]).isEqualTo("2019-02")
assertValidationErrors("""query {month(m:123)}""", """query {month(m:"123")}""")

assertThat {
assertFailure {
YEAR_MONTH_SCALAR.coercing.serialize(123, GraphQLContext.getDefault(), Locale.getDefault())
}.isFailure().isInstanceOf(CoercingSerializeException::class)

assertThat {
YEAR_MONTH_SCALAR.coercing.serialize(
YearMonth.of(2019, 10),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
}.isSuccess().isEqualTo("2019-10")
}.isInstanceOf(CoercingSerializeException::class)

assertThat(
runCatching {
YEAR_MONTH_SCALAR.coercing.serialize(
YearMonth.of(2019, 10),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
},
).isSuccess().isEqualTo("2019-10")
}

@Test
Expand All @@ -179,17 +185,19 @@ class LeakyCauldronHooksTest {
assertThat(result["localDateTime"]).isEqualTo("2019-10-31T01:01:00.000")
assertValidationErrors("""query {localDateTime(l:123)}""", """query {localDateTime(l:"123")}""")

assertThat {
assertFailure {
LOCAL_DATETIME_SCALAR.coercing.serialize(123, GraphQLContext.getDefault(), Locale.getDefault())
}.isFailure().isInstanceOf(CoercingSerializeException::class)

assertThat {
LOCAL_DATETIME_SCALAR.coercing.serialize(
LocalDateTime.of(2019, 10, 31, 1, 1),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
}.isSuccess().isEqualTo("2019-10-31T01:01:00.000")
}.isInstanceOf(CoercingSerializeException::class)

assertThat(
runCatching {
LOCAL_DATETIME_SCALAR.coercing.serialize(
LocalDateTime.of(2019, 10, 31, 1, 1),
GraphQLContext.getDefault(),
Locale.getDefault(),
)
},
).isSuccess().isEqualTo("2019-10-31T01:01:00.000")
}

@Test
Expand Down Expand Up @@ -260,9 +268,11 @@ class LeakyCauldronHooksTest {
fun testUUIDGeneration() {
val result = graphQL.execute("""query { newuuid }""")
.getData<Map<String, String>>()
assertThat {
UUID.fromString(result["newuuid"])
}.isSuccess()
assertThat(
runCatching {
UUID.fromString(result["newuuid"])
},
).isSuccess()
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.trib3.graphql.resources

import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.endsWith
import assertk.assertions.isEqualTo
import assertk.assertions.isFailure
import assertk.assertions.isNotNull
import assertk.assertions.isNull
import assertk.assertions.messageContains
Expand Down Expand Up @@ -147,15 +147,15 @@ class GraphQLResourceIntegrationTest : ResourceTestBase<GraphQLResource>() {
try {
val uri = resource.target("/graphql").queryParam("fail", "true").uriBuilder.scheme("ws").build()
val adapter = WebSocketAdapter()
assertThat {
assertFailure {
client.connect(
adapter,
uri,
ClientUpgradeRequest().also {
it.cookies = listOf(HttpCookie("authCookie", "user"))
},
).get()
}.isFailure().messageContains("Failed to upgrade")
}.messageContains("Failed to upgrade")
} finally {
client.stop()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ class GraphQLResourceTest {
EasyMock.expect(mockContext[Job]).andReturn(null).anyTimes()
EasyMock.replay(mockScope, mockContext)
resource.runningFutures["987"] = mockScope
assertThat {
resource.cancel(Optional.empty(), "987")
}.isSuccess()
assertThat(
runCatching {
resource.cancel(Optional.empty(), "987")
},
).isSuccess()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ class GraphQLSseResourceTest {
val mockSse = LeakyMock.mock<Sse>()
EasyMock.expect(mockSse.newEventBuilder()).andReturn(OutboundEvent.Builder()).anyTimes()
EasyMock.replay(mockSink, mockSse)
assertThat {
resource.querySse(
mockSink,
mockSse,
Optional.of(principal),
GraphQLRequest("query"),
)
}.isSuccess()
assertThat(
runCatching {
resource.querySse(
mockSink,
mockSse,
Optional.of(principal),
GraphQLRequest("query"),
)
},
).isSuccess()
assertThat(eventCapture.values[0].name).isEqualTo("next")
assertThat(eventCapture.values[0].data.toString()).contains(""""message":"fake error"""")
assertThat(eventCapture.values[1].name).isEqualTo("complete")
Expand Down
2 changes: 1 addition & 1 deletion json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>leakycauldron</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
14 changes: 7 additions & 7 deletions json/src/test/kotlin/com/trib3/json/ObjectMapperTest.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.trib3.json

import assertk.all
import assertk.assertFailure
import assertk.assertThat
import assertk.assertions.contains
import assertk.assertions.doesNotContain
import assertk.assertions.isEqualTo
import assertk.assertions.isFailure
import assertk.assertions.isInstanceOf
import assertk.assertions.isNotNull
import assertk.assertions.isNull
Expand Down Expand Up @@ -129,9 +129,9 @@ class ObjectMapperTest
assertThat(mapper.writeValueAsString(yq)).isEqualTo("\"2010-Q1\"")
assertThat(mapper.readValue<YearQuarter>("\"2010-Q1\"")).isEqualTo(yq)
assertThat(mapper.readValue<YearQuarter>("\"\"")).isNull()
assertThat {
assertFailure {
mapper.readValue<YearQuarter>("123")
}.isFailure().all {
}.all {
isInstanceOf(JsonMappingException::class)
message().isNotNull().contains("Expected VALUE_STRING for YearQuarter but saw")
}
Expand All @@ -151,9 +151,9 @@ class ObjectMapperTest
val map = mapOf(YearQuarter.of(2010, 1) to YearQuarter.of(2011, 2))
assertThat(mapper.writeValueAsString(map)).isEqualTo("{\"2010-Q1\":\"2011-Q2\"}")
assertThat(mapper.readValue<Map<YearQuarter, YearQuarter>>("{\"2010-Q1\":\"2011-Q2\"}")).isEqualTo(map)
assertThat {
assertFailure {
mapper.readValue<Map<YearQuarter, YearQuarter>>("{\"abc\": \"2011-Q2\"}")
}.isFailure().all {
}.all {
isInstanceOf(JsonMappingException::class)
message().isNotNull().contains("Unexpected quarter")
}
Expand All @@ -171,9 +171,9 @@ class ObjectMapperTest

@Test
fun testNeedInjectionForUnDeserializable() {
assertThat {
assertFailure {
mapper.readValue<CantDeserializeBean>("""{"foo": "blah"}""")
}.isFailure()
}
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.trib3</groupId>
<artifactId>parent-pom</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Trib3 parent pom</name>
Expand Down Expand Up @@ -46,7 +46,7 @@
<version.annotation>1.3.5</version.annotation>
<version.ant>1.10.13</version.ant>
<version.argparse4j>0.9.0</version.argparse4j>
<version.assertk>0.25</version.assertk>
<version.assertk>0.26.1</version.assertk>
<version.aws.java>2.20.79</version.aws.java>
<version.byte-buddy>1.14.5</version.byte-buddy>
<version.caffeine>3.1.6</version.caffeine>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>parent-pom</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>parent-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.trib3</groupId>
<artifactId>leakycauldron</artifactId>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 3287e42

Please sign in to comment.