Skip to content

Commit

Permalink
#10 - cleaned up unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Feb 18, 2025
1 parent a5eedcf commit f07c5d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ trait RawEndpointsSuite extends EndpointsSuite with DataInitializer {
s"http://test.com/v1/raw/concept/${name}",
response =>
assertEquals(response.code, StatusCode.Ok)
val rawConcept = checkResponse[RawConcept](response.body)
assertEquals(rawConcept.primaryName, name)
println(rawConcept.stringify)
val obtained = checkResponse[RawConcept](response.body)
val expected = RawConcept.from(child)
assertEquals(obtained.primaryName, name)
assertEquals(obtained, expected)
// println(rawConcept.stringify)
)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ object TestEntityFactory:
def buildNode(maxBreadth: Int): ConceptEntity =
val entity = createConcept()
val metadata = entity.getConceptMetadata
if (random.nextBoolean()) {
val aphiaid = random.nextLong(Int.MaxValue)
entity.setAphiaId(aphiaid)
}

if maxBreadth > 0 then

Expand Down

0 comments on commit f07c5d6

Please sign in to comment.