Skip to content

Commit

Permalink
Revert sharing test code
Browse files Browse the repository at this point in the history
  • Loading branch information
snf2ye committed Nov 13, 2023
1 parent 15ae4ac commit 103fa73
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/test/java/bio/terra/integration/DataRepoFixtures.java
Original file line number Diff line number Diff line change
Expand Up @@ -1107,19 +1107,31 @@ public ColumnStatisticsIntModel retrieveColumnIntStats(
TestConfiguration.User user, UUID datasetId, String table, String columnName, String filter)
throws Exception {
DataRepoResponse<ColumnStatisticsIntModel> response =
retrieveColumnStatsRaw(user, datasetId, table, columnName, filter);
retrieveColumnStatsIntRaw(user, datasetId, table, columnName, filter);
return validateResponse(response, "dataset column stats", HttpStatus.OK, null);
}

public ColumnStatisticsTextModel retrieveColumnStats(
TestConfiguration.User user, UUID datasetId, String table, String columnName, String filter)
throws Exception {
DataRepoResponse<ColumnStatisticsTextModel> response =
retrieveColumnStatsRaw(user, datasetId, table, columnName, filter);
retrieveColumnStatsTextRaw(user, datasetId, table, columnName, filter);
return validateResponse(response, "dataset column stats", HttpStatus.OK, null);
}

private <T> DataRepoResponse<T> retrieveColumnStatsRaw(
private DataRepoResponse<ColumnStatisticsIntModel> retrieveColumnStatsIntRaw(
TestConfiguration.User user, UUID datasetId, String table, String columnName, String filter)
throws Exception {
String url =
"/api/repository/v1/datasets/%s/data/%s/statistics/%s"
.formatted(datasetId, table, columnName);
var requestModel = new QueryColumnStatisticsRequestModel();
requestModel.filter(Objects.requireNonNullElse(filter, ""));
return dataRepoClient.post(
user, url, TestUtils.mapToJson(requestModel), new TypeReference<>() {});
}

private DataRepoResponse<ColumnStatisticsTextModel> retrieveColumnStatsTextRaw(
TestConfiguration.User user, UUID datasetId, String table, String columnName, String filter)
throws Exception {
String url =
Expand Down

0 comments on commit 103fa73

Please sign in to comment.