Skip to content

Commit

Permalink
Merge pull request #394 from bci-oss/feature/edc-extension-swap-reque…
Browse files Browse the repository at this point in the history
…st-parameters

EDC extension - Update due to EDC changes
  • Loading branch information
agg3fe authored Apr 18, 2024
2 parents a9d479f + 8384f09 commit d6923de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public DtrDataPlaneAccessControlService(
}

@Override
public Result<Void> checkAccess( ClaimToken claimToken, DataAddress address, Map<String, Object> additionalData, Map<String, Object> requestData ) {
public Result<Void> checkAccess( ClaimToken claimToken, DataAddress address, Map<String, Object> requestData, Map<String, Object> additionalData ) {
if ( isNotActive() ) {
//no DTR clients are registered, therefore the extension is turned off
return Result.success();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void test_DtrLookupCall_ShouldSucceed_WhenBpnHeaderIsPresent() {
when( uriInfo.getRequestUri() ).thenReturn( URI.create( "http://edc.example.com/public/v2/api/dtr/resource?param1=value1" ) );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( address ).getStringProperty( ADDRESS_HEADER_EDC_BPN );
Expand All @@ -115,7 +115,7 @@ void test_DtrLookupCall_ShouldSucceed_WhenBpnHeaderIsMissing() {
when( uriInfo.getRequestUri() ).thenReturn( URI.create( "http://edc.example.com/public/v2/api/dtr/resource?param1=value1" ) );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( address ).getStringProperty( ADDRESS_HEADER_EDC_BPN );
Expand All @@ -138,7 +138,7 @@ void test_AspectModelBackendRequest_ShouldSucceed_WhenBpnHeaderIsPresentAndDtrRe
when( client.shouldAllowAccess( proxyPath, queryString, Map.of( HEADER_EDC_BPN, BPN_0001 ) ) ).thenReturn( true );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( monitor, never() ).info( anyString() );
Expand All @@ -164,7 +164,7 @@ void test_AspectModelBackendRequest_ShouldReturnFailure_WhenBpnHeaderIsPresentAn
when( client.shouldAllowAccess( proxyPath, queryString, Map.of( HEADER_EDC_BPN, BPN_0001 ) ) ).thenReturn( false );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( monitor, never() ).info( anyString() );
Expand All @@ -190,7 +190,7 @@ void test_AspectModelBackendRequest_ShouldReturnFailure_WhenBpnHeaderIsMissing(
when( client.shouldAllowAccess( proxyPath, queryString, Collections.emptyMap() ) ).thenReturn( false );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( monitor, never() ).info( anyString() );
Expand All @@ -217,7 +217,7 @@ void test_AspectModelBackendRequest_ShouldReturnFailure_WhenBpnHeaderIsPresentBu
when( client.shouldAllowAccess( proxyPath, queryString, Map.of( HEADER_EDC_BPN, BPN_0001 ) ) ).thenReturn( false );

//when
final Result<Void> actual = underTest.checkAccess( claimToken, address, additionalData, requestData );
final Result<Void> actual = underTest.checkAccess( claimToken, address, requestData, additionalData );

//then
verify( monitor, never() ).info( anyString() );
Expand Down

0 comments on commit d6923de

Please sign in to comment.