99import org .junit .jupiter .api .Test ;
1010import org .junit .jupiter .api .TestInstance ;
1111
12+ import java .util .LinkedHashMap ;
13+ import java .util .Map ;
14+
1215import static org .assertj .core .api .Assertions .assertThat ;
1316
1417/**
15- * Smoke test for the review deploy pipeline. The review workflow currently supplies
16- * the ai-dial-chat base URL via {@code E2E_HOST}, not the sdmx-proxy service URL.
18+ * Review deploy smoke: DIAL Core fronts SDMX routes; {@code E2E_HOST} is the Core origin
19+ * (e.g. {@code https://core-statgpt-sdmx-proxy-pr-124.example.com}).
20+ * <p>
21+ * DIAL {@code Api-Key} is read from {@code E2E_PASSWORD} (same secret ai-dial-ci passes for E2E).
1722 */
1823@ TestInstance (TestInstance .Lifecycle .PER_CLASS )
1924@ DisplayName ("Review environment placeholder E2E" )
2025@ Tag ("e2e" )
2126@ Tag ("review" )
2227class ReviewEnvironmentPlaceholderE2ETest {
2328
24- private static final String HEALTH_ENDPOINT = "/api/health" ;
25- private static final String EXPECTED_HEALTH_RESPONSE = "Healthy " ;
29+ private static final String DATA_PATH =
30+ "/statgpt/sdmx-proxy/api/v0/sdmx/3.0/data/dataflow/BIS/WS_EER/1.0/*.N.B.US " ;
2631
2732 private RestClient restClient ;
2833
@@ -32,16 +37,32 @@ void setUp() {
3237 }
3338
3439 @ Test
35- @ DisplayName ("Review chat health endpoint is reachable" )
36- void reviewChatHealthEndpointIsReachable () {
37- Response response = restClient .getResponse (HEALTH_ENDPOINT );
40+ @ DisplayName ("BIS WS_EER data query via Core returns HTTP 200" )
41+ void bisWsEerDataQueryViaCoreReturnsOk () {
42+ String apiKey = System .getenv ("E2E_PASSWORD" );
43+ assertThat (apiKey )
44+ .as ("E2E_PASSWORD must be set to the DIAL API key (sent as Api-Key header)" )
45+ .isNotBlank ();
46+
47+ Map <String , String > headers = Map .of (
48+ "Api-Key" , apiKey ,
49+ "Content-Type" , "application/json" );
50+
51+ Map <String , Object > queryParams = new LinkedHashMap <>();
52+ queryParams .put ("c[TIME_PERIOD]" , "ge:2024-05-01+le:2026-05-31" );
53+ queryParams .put ("includeHistory" , "false" );
54+ queryParams .put ("limit" , "1000" );
55+ queryParams .put ("attributes" , "all" );
56+ queryParams .put ("dimensionAtObservation" , "TIME_PERIOD" );
57+
58+ Response response = restClient .get (DATA_PATH )
59+ .headers (headers )
60+ .queryParams (queryParams )
61+ .when ()
62+ .get ();
3863
3964 assertThat (response .getStatusCode ())
40- .as ("Chat health endpoint should return HTTP 200" )
65+ .as ("SDMX data endpoint should return HTTP 200" )
4166 .isEqualTo (200 );
42-
43- assertThat (response .getBody ().asString ())
44- .as ("Chat health endpoint should return Healthy" )
45- .contains (EXPECTED_HEALTH_RESPONSE );
4667 }
4768}
0 commit comments