i have an old assertj assertion that uses conditio...
# strikt
m
i have an old assertj assertion that uses conditions that is
Copy code
val hpi = condition<String>(".hpi extension") { it.endsWith("@hpi") }
      val jpi = condition<String>(".jpi extension") { it.endsWith("@jpi") }
      val war = condition<String>(".war extension") { it.endsWith("@war") }
      val jenkinsWar = condition<String>("Jenkins WAR group and module") { it.contains("org.jenkins-ci.main:jenkins-war") }
      assertThat(line)
        .has(anyOf(allOf(war, jenkinsWar), hpi, jpi))
where
condition
is a helper to create https://joel-costigliola.github.io/assertj/core-8/api/org/assertj/core/api/Condition.html is there anything comparable in
strikt
yet to accomplish the
anyOf
and
allOf
style composition above?
im guessing something using
compose
is the right way here, going to take a stab at it
Copy code
compose("any of") {
  endsWith("@hpi")
  endsWith("@jpi")
  compose("all of") {
    contains("FAILorg.jenkins-ci.main:jenkins-war")
    endsWith("@war")
  } then {
    when {
      allPassed -> pass()
      else -> fail()
    }
  }
} then {
  when {
    anyPassed -> pass()
    else -> fail()
  }
}
seems to work, but im going to open an issue
r
you shouldn’t need to use
compose
inline like that. I’m kind of confused by what this is doing, tho