Skip to content

Commit cd304d4

Browse files
authored
Add health check path (#224)
* add path test constant * add special case for health check
1 parent 1331d7c commit cd304d4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

klass-api/src/test/java/no/ssb/klass/api/migration/KlassApiMigrationClient.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ public KlassApiMigrationClient() {
3434

3535
public boolean isApiAvailable(String host) {
3636
try {
37-
Response response = RestAssured.get(host + "/ping");
37+
Response response;
38+
if(host.equals(DATA_SSB_HOST)){
39+
response = RestAssured.get(host + BASE_PATH + "/ping");
40+
}
41+
else{
42+
response = RestAssured.get(host + "/ping");
43+
}
3844
return response.getStatusCode() == 200;
3945
} catch (Exception e) {
4046
return false;

klass-api/src/test/java/no/ssb/klass/api/migration/MigrationTestConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
public final class MigrationTestConstants {
88

99
// paths
10+
public static final String DATA_SSB_HOST = "https://data.ssb.no";
1011
public static final String BASE_PATH = "/api/klass";
1112
public static final String CLASSIFICATIONS_PATH = "/classifications";
1213
public static final String CHANGES = "changes";

0 commit comments

Comments
 (0)