4545public class TransferEndToEndTest {
4646 // Management API base URL of the consumer connector, goes through Ingress controller
4747 private static final String CONSUMER_MANAGEMENT_URL = "http://cp.consumer.localhost:8080" ;
48- // Catalog Query API URL of the consumer connector, goes through ingress controller
49- private static final String CONSUMER_CATALOG_URL = "http://127.0.0.1/consumer/fc" ;
5048 // DSP service URL of the provider, not reachable outside the cluster
5149 private static final String PROVIDER_DSP_URL = "http://controlplane.provider.svc.cluster.local:8082/api/dsp/2025-1" ;
5250 // DID of the provider company
5351 private static final String PROVIDER_ID = "did:web:identityhub.provider.svc.cluster.local%3A7083:provider" ;
54- // public API endpoint of the provider-qna connector, goes through the ingress controller
55- private static final String PROVIDER_PUBLIC_URL = "http://dp.provider.localhost:8080/public" ;
52+ private static final String CONSUMER_PROXY_URL = "http://dp.consumer.localhost:8080/api/proxy" ;
5653 private static final String PROVIDER_MANAGEMENT_URL = "http://cp.provider.localhost:8080" ;
5754
5855 private final TypeTransformerRegistry transformerRegistry = new TypeTransformerRegistryImpl ();
@@ -69,23 +66,23 @@ private static RequestSpecification baseRequest() {
6966 @ DisplayName ("Tests a successful End-to-End contract negotiation and data transfer" )
7067 @ Test
7168 void transferData_hasPermission_shouldTransferData () {
72- System .out .println ("Waiting for Provider dataplane to come online" );
73- // wait until provider's dataplane is available
74- await ().atMost (TEST_TIMEOUT_DURATION )
75- .pollDelay (TEST_POLL_DELAY )
76- .untilAsserted (() -> {
77- var jp = baseRequest ()
78- .get (PROVIDER_MANAGEMENT_URL + "/api/mgmt/v4/dataplanes" )
79- .then ()
80- .statusCode (200 )
81- .log ().ifValidationFails ()
82- .extract ().body ().jsonPath ();
83-
84- var state = jp .getString ("state" );
85- assertThat (state ).isEqualTo ("[REGISTERED]" );
86- });
87-
88- System .out .println ("Provider dataplane is online, fetching catalog" );
69+ // System.out.println("Waiting for Provider dataplane to come online");
70+ // // wait until provider's dataplane is available
71+ // await().atMost(TEST_TIMEOUT_DURATION)
72+ // .pollDelay(TEST_POLL_DELAY)
73+ // .untilAsserted(() -> {
74+ // var jp = baseRequest()
75+ // .get(PROVIDER_MANAGEMENT_URL + "/api/mgmt/v4/dataplanes")
76+ // .then()
77+ // .statusCode(200)
78+ // .log().ifValidationFails()
79+ // .extract().body().jsonPath();
80+ //
81+ // var state = jp.getString("state");
82+ // assertThat(state).isEqualTo("[REGISTERED]");
83+ // });
84+ //
85+ // System.out.println("Provider dataplane is online, fetching catalog");
8986
9087 var catalogRequestBody = Json .createObjectBuilder ()
9188 .add ("@context" , Json .createObjectBuilder ().add ("edc" , "https://w3id.org/edc/connector/management/v2" ))
@@ -178,36 +175,36 @@ void transferData_hasPermission_shouldTransferData() {
178175 assertThat (jp .getString ("state" )).contains ("STARTED" );
179176 });
180177
181- System .out .printf ("Fetch EDR with ID %s%n" , transferProcessId );
178+ System .out .printf ("Fetch dataflow with ID %s from custom proxy %n" , transferProcessId );
182179 // fetch EDR for transfer processs
183180 var endpoint = new AtomicReference <String >();
184181 var token = new AtomicReference <String >();
185182 await ().atMost (TEST_TIMEOUT_DURATION )
186183 .pollDelay (TEST_POLL_DELAY )
187184 .untilAsserted (() -> {
188185 var jp = baseRequest ()
189- .get (CONSUMER_MANAGEMENT_URL + "/api/mgmt/v3/edrs/%s/dataaddress " .formatted (transferProcessId ))
186+ .get (CONSUMER_PROXY_URL + "/flows/%s " .formatted (transferProcessId ))
190187 .then ()
191188 .log ().ifValidationFails ()
192189 .statusCode (200 )
193- .onFailMessage ("Expected to find an EDR with transfer ID %s but did not!" .formatted (transferProcessId ))
190+ .onFailMessage ("Expected to find a DataFlow ID %s but did not!" .formatted (transferProcessId ))
194191 .extract ().body ().jsonPath ();
195192
196193 endpoint .set (jp .getString ("endpoint" ));
197- token .set (jp .getString ("authorization" ));
194+ // token.set(jp.getString("authorization"));
198195
199- assertThat (endpoint .get ()).isNotNull ().endsWith ("/api/public" );
200- assertThat (token .get ()).isNotNull ();
196+ assertThat (endpoint .get ()).isNotNull ().endsWith ("/api/public/data/source " );
197+ // assertThat(token.get()).isNotNull();
201198 });
202199
203200 //download exemplary JSON data from public endpoint
204201 var response = given ()
205- .header ("Authorization" , token .get ())
206- .get (PROVIDER_PUBLIC_URL + "/api/public" )
202+ // .header("Authorization", token.get())
203+ .get (CONSUMER_PROXY_URL + "/flows/%s/data" . formatted ( transferProcessId ) )
207204 .then ()
208205 .log ().ifError ()
209206 .statusCode (200 )
210- .extract ().body ().asString ( );
207+ .extract ().body ().as ( Object []. class );
211208
212209 assertThat (response ).isNotEmpty ();
213210 }
0 commit comments