Commit 13cbf595 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

new test on publish to check if all services related with provider where removed if use 2 apfs

parent 68ec4e06
Loading
Loading
Loading
Loading
Loading
+17 −14
Original line number Diff line number Diff line
@@ -325,12 +325,12 @@ Delete APIs Published by NON Authorised apfId
    ...    detail=User not authorized
    ...    cause=Certificate not authorized


Retrieve single APIs Published by Authorised apfId TEST
    [Tags]    capif_api_publish_service-x
    # Register APF
Check Two Published APIs with different APFs are removed when Provider is deleted
    [Tags]    capif_api_publish_service-14
    # Register APF with 2 APF roles
    ${register_user_info}=    Provider Default Registration    total_apf_roles=2

    # Publish APIs with both APFs
    ${service_api_description_published_1}    ${resource_url}    ${request_body}=    Publish Service Api
    ...    ${register_user_info}
    ...    service_1
@@ -343,7 +343,7 @@ Retrieve single APIs Published by Authorised apfId TEST
    ${serviceApiId1}=    Set Variable    ${service_api_description_published_1['apiId']}
    ${serviceApiId2}=    Set Variable    ${service_api_description_published_2['apiId']}

    # Retrieve Services 1
    # Retrieve Service1
    ${resp}=    Get Request Capif
    ...    /published-apis/v1/${register_user_info['apf_id']}/service-apis/${serviceApiId1}
    ...    server=${CAPIF_HTTPS_URL}
@@ -353,7 +353,7 @@ Retrieve single APIs Published by Authorised apfId TEST
    Check Response Variable Type And Values    ${resp}    200    ServiceAPIDescription
    Dictionaries Should Be Equal    ${resp.json()}    ${service_api_description_published_1}

    # Retrieve Services 1
    # Retrieve Service2
    ${resp}=    Get Request Capif
    ...    /published-apis/v1/${register_user_info['apf_roles']['${APF_PROVIDER_USERNAME}_1']['apf_id']}/service-apis/${serviceApiId2}
    ...    server=${CAPIF_HTTPS_URL}
@@ -363,6 +363,7 @@ Retrieve single APIs Published by Authorised apfId TEST
    Check Response Variable Type And Values    ${resp}    200    ServiceAPIDescription
    Dictionaries Should Be Equal    ${resp.json()}    ${service_api_description_published_2}

    # Get all services present at CCF
    ${resp}=    Get Request Capif
    ...    /helper/getServices
    ...    server=${CAPIF_HTTPS_URL}
@@ -386,8 +387,7 @@ Retrieve single APIs Published by Authorised apfId TEST
    ...    username=${SUPERADMIN_USERNAME}

    Log Dictionary    ${resp.json()}

    Run Keyword And Continue On Failure  Length Should Be    ${resp.json()['services']}    0
    ${services_present_on_ccf}=    Get Length    ${resp.json()['services']}

    ${resp}=    Delete Request Capif
    ...    /published-apis/v1/${register_user_info['apf_roles']['${APF_PROVIDER_USERNAME}_1']['apf_id']}/service-apis/${serviceApiId2}
@@ -402,4 +402,7 @@ Retrieve single APIs Published by Authorised apfId TEST
    ...    username=${SUPERADMIN_USERNAME}

    Log Dictionary    ${resp.json()}
    Length Should Be    ${resp.json()['services']}    0
 No newline at end of file
    ${services_present_on_ccf_after_provider_deletion}=    Get Length    ${resp.json()['services']}
    ${services_removed}=   Evaluate    ${services_present_on_ccf} - ${services_present_on_ccf_after_provider_deletion}
    
    Should Be Equal    ${services_removed}    2      msg=Not all services removed after delete provider (removed) vs (expected)