mkobit
05/16/2019, 6:49 PMval 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?mkobit
05/16/2019, 6:50 PMcompose
is the right way here, going to take a stab at itmkobit
05/16/2019, 7:06 PMcompose("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 issuerobfletcher
05/16/2019, 8:36 PMcompose
inline like that. I’m kind of confused by what this is doing, tho