Skip to content

Commit

Permalink
Fixed unit tests #951
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed May 19, 2024
1 parent 62ad615 commit 59fa0ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/groovy/au/org/ala/ecodata/ParatooServiceSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ class ParatooServiceSpec extends MongoSpec implements ServiceUnitTest<ParatooSer
then:
outputSpeciesId != null
result == [name: "Acacia glauca Willd. (Acacia glauca)", scientificName: "Acacia glauca Willd.", guid: "A_GUID", commonName: "Acacia glauca", taxonRank: "Species"]
2 * speciesReMatchService.searchByName(_) >> null
1 * speciesReMatchService.searchByName(_) >> null
1 * speciesReMatchService.searchByName(_, false, true) >> null

when: // no scientific name
result = service.transformSpeciesName("Frogs [Class] (scientific: )")
Expand All @@ -722,7 +723,8 @@ class ParatooServiceSpec extends MongoSpec implements ServiceUnitTest<ParatooSer
then:
outputSpeciesId != null
result == [name: "Frogs", scientificName: "", guid: "A_GUID", commonName: "Frogs", taxonRank: "Class"]
2 * speciesReMatchService.searchByName(_) >> null
1 * speciesReMatchService.searchByName(_) >> null
1 * speciesReMatchService.searchByName(_, false, true) >> null
}

void "buildTreeFromParentChildRelationships should build tree correctly"() {
Expand Down Expand Up @@ -1431,7 +1433,7 @@ class ParatooServiceSpec extends MongoSpec implements ServiceUnitTest<ParatooSer
result.lut.remove('outputSpeciesId')
then:
1 * speciesReMatchService.searchByName("Felis catus") >> null
1 * speciesReMatchService.searchByName("Cats") >> [
1 * speciesReMatchService.searchByName("Cats", false, true) >> [
commonName: "Cat",
scientificName: "Felis catus",
guid: "TAXON_ID",
Expand Down

0 comments on commit 59fa0ba

Please sign in to comment.