This is weird. I have this method in a unit test: ...
# coroutines
r
This is weird. I have this method in a unit test:
Copy code
@AfterEach
  fun truncate() {
    @Suppress("ConstantConditionIf")
    if (doTeardown) {
      runBlocking {
        collection.truncate().await()
      }
    }
  }
It fails with
java.lang.ClassCastException: com.arangodb.entity.CollectionEntity cannot be cast to kotlin.Unit
.
CollectionEntity
is what is returned by
collection.truncate().await()
where
await()
is
CompletionStage<T>.await()
. I can make it work by doing
runBlocking<Unit> {...}
or commenting out the
@Suppress
annotation. Wtf?