@@ -229,7 +229,7 @@ func TestMeConsentByIDStripsHopByHopHeadersFromUpstreamError(t *testing.T) {
229229 bff := newPhase2Server (t , upstream .URL )
230230 defer bff .Close ()
231231
232- resp , err := http .Get (bff .URL + "/me/consents/missing " )
232+ resp , err := http .Get (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440999 " )
233233 if err != nil {
234234 t .Fatalf ("request failed: %v" , err )
235235 }
@@ -259,11 +259,11 @@ func TestApproveAndRevokeMappings(t *testing.T) {
259259
260260 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
261261 switch {
262- case r .Method == http .MethodGet && r .URL .Path == "/api/v1/consents/consent-123 " :
262+ case r .Method == http .MethodGet && r .URL .Path == "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
263263 w .Header ().Set ("Content-Type" , "application/json" )
264264 w .WriteHeader (http .StatusOK )
265265 _ , _ = w .Write ([]byte (`{
266- "id":"consent-123 ",
266+ "id":"550e8400-e29b-41d4-a716-446655440000 ",
267267 "clientId":"TPP-CLIENT-001",
268268 "type":"accounts",
269269 "status":"CREATED",
@@ -295,7 +295,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
295295 ]}
296296 ]
297297 }` ))
298- case r .Method == http .MethodPut && r .URL .Path == "/api/v1/consents/consent-123 " :
298+ case r .Method == http .MethodPut && r .URL .Path == "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
299299 gotMethod = r .Method
300300 gotPath = r .URL .Path
301301 gotTPPClientID = r .Header .Get ("TPP-client-id" )
@@ -326,7 +326,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
326326 defer bff .Close ()
327327
328328 payload := []byte (`[{"purposeName":"profile_access","elementName":"last_name"}]` )
329- resp , err := http .Post (bff .URL + "/me/consents/consent-123 /approve" , "application/json" , bytes .NewReader (payload ))
329+ resp , err := http .Post (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 /approve" , "application/json" , bytes .NewReader (payload ))
330330 if err != nil {
331331 t .Fatalf ("request failed: %v" , err )
332332 }
@@ -340,7 +340,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
340340 if gotMethod != http .MethodPut {
341341 t .Fatalf ("expected PUT, got %s" , gotMethod )
342342 }
343- if gotPath != "/api/v1/consents/consent-123 " {
343+ if gotPath != "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " {
344344 t .Fatalf ("unexpected path: %s" , gotPath )
345345 }
346346 if gotTPPClientID != "TPP-CLIENT-001" {
@@ -439,7 +439,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
439439 bff := newPhase2Server (t , upstream .URL )
440440 defer bff .Close ()
441441
442- req , err := http .NewRequest (http .MethodPut , bff .URL + "/me/consents/consent-123 /revoke" , bytes .NewReader ([]byte (`{"revocationReason":"test"}` )))
442+ req , err := http .NewRequest (http .MethodPut , bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 /revoke" , bytes .NewReader ([]byte (`{"revocationReason":"test"}` )))
443443 if err != nil {
444444 t .Fatalf ("request creation failed: %v" , err )
445445 }
@@ -458,7 +458,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
458458 if gotMethod != http .MethodPut {
459459 t .Fatalf ("expected PUT, got %s" , gotMethod )
460460 }
461- if gotPath != "/api/v1/consents/consent-123 /revoke" {
461+ if gotPath != "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 /revoke" {
462462 t .Fatalf ("unexpected path: %s" , gotPath )
463463 }
464464 if gotBody ["actionBy" ] != "user@example.com" {
@@ -486,7 +486,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
486486 bff := newPhase2Server (t , upstream .URL )
487487 defer bff .Close ()
488488
489- req , err := http .NewRequest (http .MethodPut , bff .URL + "/me/consents/consent-123 /revoke" , bytes .NewReader ([]byte (`null` )))
489+ req , err := http .NewRequest (http .MethodPut , bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 /revoke" , bytes .NewReader ([]byte (`null` )))
490490 if err != nil {
491491 t .Fatalf ("request creation failed: %v" , err )
492492 }
@@ -505,7 +505,7 @@ func TestApproveAndRevokeMappings(t *testing.T) {
505505 if gotMethod != http .MethodPut {
506506 t .Fatalf ("expected PUT, got %s" , gotMethod )
507507 }
508- if gotPath != "/api/v1/consents/consent-123 /revoke" {
508+ if gotPath != "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 /revoke" {
509509 t .Fatalf ("unexpected path: %s" , gotPath )
510510 }
511511 if gotBody ["actionBy" ] != "user@example.com" {
@@ -646,7 +646,7 @@ func TestRequestBodySizeLimitReturns413(t *testing.T) {
646646
647647 t .Run ("me approve returns 413 with json error" , func (t * testing.T ) {
648648 big := bytes .Repeat ([]byte ("b" ), 64 )
649- resp , err := http .Post (bff .URL + "/me/consents/c-1 /approve" , "application/json" , bytes .NewReader (big ))
649+ resp , err := http .Post (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440001 /approve" , "application/json" , bytes .NewReader (big ))
650650 if err != nil {
651651 t .Fatalf ("request failed: %v" , err )
652652 }
@@ -750,9 +750,9 @@ func TestMeEndpointsReturn503WhenPlaceholderModeDisabled(t *testing.T) {
750750 body string
751751 }{
752752 {name : "me consents" , method : http .MethodGet , path : "/me/consents" },
753- {name : "me consent by id" , method : http .MethodGet , path : "/me/consents/consent-123 " },
754- {name : "me approve" , method : http .MethodPost , path : "/me/consents/consent-123 /approve" , body : "[]" },
755- {name : "me revoke" , method : http .MethodPut , path : "/me/consents/consent-123 /revoke" , body : "{}" },
753+ {name : "me consent by id" , method : http .MethodGet , path : "/me/consents/550e8400-e29b-41d4-a716-446655440000 " },
754+ {name : "me approve" , method : http .MethodPost , path : "/me/consents/550e8400-e29b-41d4-a716-446655440000 /approve" , body : "[]" },
755+ {name : "me revoke" , method : http .MethodPut , path : "/me/consents/550e8400-e29b-41d4-a716-446655440000 /revoke" , body : "{}" },
756756 }
757757
758758 for _ , tc := range testCases {
@@ -802,11 +802,11 @@ func TestMeEndpointsReturn503WhenPlaceholderModeDisabled(t *testing.T) {
802802func TestMeConsentByIDAggregatesPurposeAndElementDetails (t * testing.T ) {
803803 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
804804 switch r .URL .Path {
805- case "/api/v1/consents/consent-123 " :
805+ case "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
806806 w .Header ().Set ("Content-Type" , "application/json" )
807807 w .WriteHeader (http .StatusOK )
808808 _ , _ = w .Write ([]byte (`{
809- "id":"consent-123 ",
809+ "id":"550e8400-e29b-41d4-a716-446655440000 ",
810810 "clientId":"TPP-CLIENT-001",
811811 "type":"accounts",
812812 "status":"ACTIVE",
@@ -857,7 +857,7 @@ func TestMeConsentByIDAggregatesPurposeAndElementDetails(t *testing.T) {
857857 bff := newPhase2Server (t , upstream .URL )
858858 defer bff .Close ()
859859
860- resp , err := http .Get (bff .URL + "/me/consents/consent-123 " )
860+ resp , err := http .Get (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 " )
861861 if err != nil {
862862 t .Fatalf ("request failed: %v" , err )
863863 }
@@ -908,11 +908,11 @@ func TestMeConsentByIDAggregatesPurposeAndElementDetails(t *testing.T) {
908908func TestMeConsentByIDFailsClosedWhenPurposeMetadataMissing (t * testing.T ) {
909909 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
910910 switch r .URL .Path {
911- case "/api/v1/consents/consent-123 " :
911+ case "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
912912 w .Header ().Set ("Content-Type" , "application/json" )
913913 w .WriteHeader (http .StatusOK )
914914 _ , _ = w .Write ([]byte (`{
915- "id":"consent-123 ",
915+ "id":"550e8400-e29b-41d4-a716-446655440000 ",
916916 "clientId":"TPP-CLIENT-001",
917917 "type":"accounts",
918918 "status":"ACTIVE",
@@ -933,7 +933,7 @@ func TestMeConsentByIDFailsClosedWhenPurposeMetadataMissing(t *testing.T) {
933933 bff := newPhase2Server (t , upstream .URL )
934934 defer bff .Close ()
935935
936- resp , err := http .Get (bff .URL + "/me/consents/consent-123 " )
936+ resp , err := http .Get (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 " )
937937 if err != nil {
938938 t .Fatalf ("request failed: %v" , err )
939939 }
@@ -957,11 +957,11 @@ func TestMeConsentByIDFailsClosedWhenPurposeMetadataMissing(t *testing.T) {
957957func TestMeConsentByIDHandlesNullableAndMixedProperties (t * testing.T ) {
958958 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
959959 switch r .URL .Path {
960- case "/api/v1/consents/consent-123 " :
960+ case "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
961961 w .Header ().Set ("Content-Type" , "application/json" )
962962 w .WriteHeader (http .StatusOK )
963963 _ , _ = w .Write ([]byte (`{
964- "id":"consent-123 ",
964+ "id":"550e8400-e29b-41d4-a716-446655440000 ",
965965 "clientId":"TPP-CLIENT-001",
966966 "type":"accounts",
967967 "status":"ACTIVE",
@@ -996,7 +996,7 @@ func TestMeConsentByIDHandlesNullableAndMixedProperties(t *testing.T) {
996996 bff := newPhase2Server (t , upstream .URL )
997997 defer bff .Close ()
998998
999- resp , err := http .Get (bff .URL + "/me/consents/consent-123 " )
999+ resp , err := http .Get (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 " )
10001000 if err != nil {
10011001 t .Fatalf ("request failed: %v" , err )
10021002 }
@@ -1039,11 +1039,11 @@ func TestMeConsentByIDHandlesNullableAndMixedProperties(t *testing.T) {
10391039func TestMeConsentByIDPurposeLookupFallsBackWithoutClientFilter (t * testing.T ) {
10401040 upstream := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
10411041 switch r .URL .Path {
1042- case "/api/v1/consents/consent-123 " :
1042+ case "/api/v1/consents/550e8400-e29b-41d4-a716-446655440000 " :
10431043 w .Header ().Set ("Content-Type" , "application/json" )
10441044 w .WriteHeader (http .StatusOK )
10451045 _ , _ = w .Write ([]byte (`{
1046- "id":"consent-123 ",
1046+ "id":"550e8400-e29b-41d4-a716-446655440000 ",
10471047 "clientId":"TPP-CLIENT-003",
10481048 "type":"accounts",
10491049 "status":"ACTIVE",
@@ -1074,7 +1074,7 @@ func TestMeConsentByIDPurposeLookupFallsBackWithoutClientFilter(t *testing.T) {
10741074 bff := newPhase2Server (t , upstream .URL )
10751075 defer bff .Close ()
10761076
1077- resp , err := http .Get (bff .URL + "/me/consents/consent-123 " )
1077+ resp , err := http .Get (bff .URL + "/me/consents/550e8400-e29b-41d4-a716-446655440000 " )
10781078 if err != nil {
10791079 t .Fatalf ("request failed: %v" , err )
10801080 }
0 commit comments