Skip to content

Commit

Permalink
test: add assertions for schema version to topic test #62
Browse files Browse the repository at this point in the history
'Migrate stats queries to new schema'
#62

Co-authored-by: Michael Auer <[email protected]>
  • Loading branch information
mmerdes and mcauer committed Feb 14, 2025
1 parent a6cbb6e commit baa29d9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package org.heigit.ohsome.now.statsservice.topic

import org.assertj.core.api.Assertions.assertThat
import org.heigit.ohsome.now.statsservice.file
import org.heigit.ohsome.now.statsservice.schemaVersion
import org.heigit.ohsome.now.statsservice.utils.CountryHandler
import org.heigit.ohsome.now.statsservice.utils.HashtagHandler
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -29,6 +30,7 @@ class TopicRepoUnitTests {

val sql = repo.topicStatsFromTimeSpanSQL(fixedHashtag, allCountries, amenityTopic)
assertThat(sql)
.contains("_$schemaVersion")
.isEqualToNormalizingPunctuationAndWhitespace(expected)
}

Expand All @@ -40,6 +42,7 @@ class TopicRepoUnitTests {

val sql = repo.topicStatsFromTimeSpanIntervalSQL(wildcardHashtag, bolivia, placeTopic)
assertThat(sql)
.contains("_$schemaVersion")
.isEqualToNormalizingPunctuationAndWhitespace(expected)
}

Expand All @@ -51,6 +54,7 @@ class TopicRepoUnitTests {

val sql = repo.topicStatsFromTimeSpanSQL(fixedHashtag, allCountries, healthcareTopic)
assertThat(sql)
.contains("_$schemaVersion")
.isEqualToNormalizingPunctuationAndWhitespace(expected)
}

Expand All @@ -62,6 +66,7 @@ class TopicRepoUnitTests {

val sql = repo.topicStatsFromTimeSpanCountrySQL(wildcardHashtag, placeTopic)
assertThat(sql)
.contains("_$schemaVersion")
.isEqualToNormalizingPunctuationAndWhitespace(expected)
}

Expand All @@ -72,7 +77,9 @@ class TopicRepoUnitTests {
val expected = file("topic_place_by_userid")

val sql = repo.topicForUserIdForHotOSMProjectSQL(placeTopic, HashtagHandler("hotosm-project-*"))
assertThat(sql).isEqualToNormalizingPunctuationAndWhitespace(expected)
assertThat(sql)
.contains("_$schemaVersion")
.isEqualToNormalizingPunctuationAndWhitespace(expected)
}

}
Expand Down

0 comments on commit baa29d9

Please sign in to comment.