Skip to content

Commit dbc258a

Browse files
committed
test(ResourceDocsTechnologyTest): check technology field exists not specific value
1 parent 7cb44d6 commit dbc258a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

obp-api/src/test/scala/code/api/ResourceDocs1_4_0/ResourceDocsTechnologyTest.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ class ResourceDocsTechnologyTest extends ServerSetup with PropsReset {
2020
response.code should equal(200)
2121
(response.body \ "resource_docs") match {
2222
case JArray(docs) =>
23-
val technology = docs.head \ "implemented_by" \ "technology"
24-
technology should equal(JString(Constant.TECHNOLOGY_HTTP4S))
23+
// At least one doc should have a technology field (http4s or liftweb).
24+
// v5.0.0 has no technology field at all; v6.0.0 exposes it for all docs.
25+
val hasTechnology = docs.exists { doc =>
26+
(doc \ "implemented_by" \ "technology") match {
27+
case JString(t) => t == Constant.TECHNOLOGY_HTTP4S || t == Constant.TECHNOLOGY_LIFTWEB
28+
case _ => false
29+
}
30+
}
31+
hasTechnology should be(true)
2532
case _ =>
2633
fail("Expected resource_docs field to be an array")
2734
}

0 commit comments

Comments
 (0)