|
29 | 29 | import com.imsweb.seerapi.client.rx.Rx;
|
30 | 30 | import com.imsweb.seerapi.client.rx.RxSearchResults;
|
31 | 31 | import com.imsweb.seerapi.client.rx.RxService;
|
| 32 | +import com.imsweb.seerapi.client.staging.StagingAlgorithm; |
32 | 33 | import com.imsweb.seerapi.client.staging.StagingSchema;
|
33 | 34 | import com.imsweb.seerapi.client.staging.StagingSchemaInfo;
|
34 | 35 | import com.imsweb.seerapi.client.staging.StagingService;
|
35 | 36 | import com.imsweb.seerapi.client.staging.StagingTable;
|
| 37 | +import com.imsweb.seerapi.client.staging.StagingVersion; |
36 | 38 |
|
37 | 39 | import static org.assertj.core.api.Assertions.assertThat;
|
38 | 40 |
|
@@ -121,6 +123,30 @@ private Map<String, String> getAlgorithmVersions() {
|
121 | 123 | return versions;
|
122 | 124 | }
|
123 | 125 |
|
| 126 | + @Test |
| 127 | + void testStagingAlgorithmsAndVersions() throws IOException { |
| 128 | + StagingService prodService = new SeerApi.Builder().url(PROD_URL).apiKey(getApiKey()).connect().staging(); |
| 129 | + StagingService localService = new SeerApi.Builder().url(LOCAL_URL).apiKey(getApiKey()).connect().staging(); |
| 130 | + |
| 131 | + List<StagingAlgorithm> prodAlgorithms = prodService.algorithms().execute().body(); |
| 132 | + List<StagingAlgorithm> localAlgorithms = localService.algorithms().execute().body(); |
| 133 | + |
| 134 | + assertThat(localAlgorithms) |
| 135 | + .hasSameSizeAs(prodAlgorithms) // Ensure both lists have the same size |
| 136 | + .usingRecursiveComparison() |
| 137 | + .isEqualTo(prodAlgorithms); |
| 138 | + |
| 139 | + for (StagingAlgorithm algorithm : Objects.requireNonNull(prodAlgorithms)) { |
| 140 | + List<StagingVersion> prodVersions = prodService.versions(algorithm.getAlgorithm()).execute().body(); |
| 141 | + List<StagingVersion> localVersions = localService.versions(algorithm.getAlgorithm()).execute().body(); |
| 142 | + |
| 143 | + assertThat(localVersions) |
| 144 | + .hasSameSizeAs(prodVersions) |
| 145 | + .usingRecursiveComparison() |
| 146 | + .isEqualTo(prodVersions); |
| 147 | + } |
| 148 | + } |
| 149 | + |
124 | 150 | @Test
|
125 | 151 | void testStagingSchemas() throws IOException {
|
126 | 152 | StagingService prodService = new SeerApi.Builder().url(PROD_URL).apiKey(getApiKey()).connect().staging();
|
|
0 commit comments