summaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-01-11 19:19:05 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-01-17 10:44:23 +0000
commit035ad742f60bdb375ee4e2da4345d404949a19b4 (patch)
tree7d40e43a0d6422036403cf1f0d3bbfd3248fa61a /catalog-be
parentc29a4519545ff509c038c9a19781ef210b2ee14f (diff)
Improve test coverage
- extract duplicated code - remove redundant and unused code Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I7ae3592951f53bbebf10a80f7cce22d54b2940b6 Issue-ID: SDC-4317
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java
index 0c1399bc51..66c5510591 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/path/utils/GraphTestUtils.java
@@ -102,7 +102,7 @@ public final class GraphTestUtils {
}
public static void clearGraph(JanusGraphDao janusGraphDao) {
- Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getGraph();
+ Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getJanusGraphClient().getGraph();
JanusGraph graph = graphResult.left().value();
Iterable<JanusGraphVertex> vertices = graph.query().vertices();
8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .nt { color: #f92672 } /* Name.Tag */ .highlight .nv { color: #f8f8f2 } /* Name.Variable */ .highlight .ow { color: #f92672 } /* Operator.Word */ .highlight .w { color: #f8f8f2 } /* Text.Whitespace */ .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */ .highlight .mf { color: #ae81ff } /* Literal.Number.Float */ .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
*** Settings ***
Documentation   Creates VID VNF Instance

Library    ExtendedSelenium2Library    60
Library         UUID
Library         String
Library        DateTime
Library         RequestsLibrary

Resource          ../mso_interface.robot
Resource          vid_interface.robot
 
*** Keywords ***  
    
Create VID VNF
    [Documentation]    Creates a VNF instance using VID for passed instance id with the passed service instance name  
    [Arguments]    ${service_instance_id}    ${service_instance_name}    ${product_family}    ${lcp_region}    ${tenant}   ${vnf_type}        
    Go To VID HOME
    Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
    Wait Until Page Contains    Please search by    timeout=60s
    #Wait Until Page Contains Element    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    #Wait Until Element Is Not Visible    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    
    # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) 
    Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
    Click Button    button=Submit
    Wait Until Page Contains Element    link=View/Edit    timeout=60s
    Click Element     xpath=//a[contains(text(), 'View/Edit')]    
    Wait Until Page Contains    View/Edit Service Instance     timeout=60s
    #Wait Until Page Contains Element    xpath=//div[@class='statusLine aaiVisible']    timeout=120s
    #Wait Until Element Is Not Visible    xpath=//div[@class='statusLine aaiVisible']    timeout=60s
    Click Element    button=Add VNF
    
    # This is where firefox breaks. Th elink never becomes visible when run with the script.
    Click Element    link=${vnf_type}
    Wait Until Page Contains Element    xpath=//input[@parameter-id='instanceName']    20s
    Wait Until Element Is Enabled    xpath=//input[@parameter-id='instanceName']    20s
    
    ## Without this sleep, the input text below gets immediately wiped out. 
    ## Wait Until Angular Ready just sleeps for its timeout value
    Sleep    10s
    Input Text    xpath=//input[@parameter-id='instanceName']    ${service_instance_name}
    Select From List By Label     xpath=//select[@parameter-id='productFamily']    ${product_family}      
    Select From List By Label    xpath=//select[@parameter-id='lcpRegion']    ${lcp_region}      
    Select From List By Label    xpath=//select[@parameter-id='tenant']    ${tenant}      
    Click Element    button=Confirm
  Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    Status: OK (200)    timeout=120
    ${response text}=    Get Text    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
  Should Not Contain    ${response text}    FAILED   
    Click Element    button=Close
    ${instance_id}=    Parse Instance Id     ${response text}
    Wait Until Page Contains    ${service_instance_name}    60s
    [Return]     ${instance_id}  

Delete VID VNF   
    [Arguments]    ${service_instance_id}    ${lcp_region}    ${tenant}    ${vnf_instance_id} 
    Go To VID HOME
    Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
    Wait Until Page Contains    Please search by    timeout=60s
    Wait Until Page Contains Element    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    Wait Until Element Is Not Visible    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    
    # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) 
    Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
    Click Button    button=Submit
    Wait Until Page Contains Element    link=View/Edit    timeout=60s
    Click Element     link=View/Edit   
    Wait Until Page Contains    View/Edit Service Instance     timeout=60s
    Wait Until Page Contains Element    xpath=//div[@class='statusLine']    timeout=120s
    Wait Until Element Is Not Visible    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    

    
    Click On Element When Visible    xpath=//li/div[contains(.,'${vnf_instance_id}')]/a/span[@class='glyphicon glyphicon-remove']    timeout=120s  
    Select From List By Label    xpath=//select[@parameter-id='lcpRegion']    ${lcp_region}      
    Select From List By Label    xpath=//select[@parameter-id='tenant']    ${tenant}      
    Click Element    xpath=//div[@class='buttonRow']/button[@ngx-enabled='true']
    #//*[@id="mContent"]/div/div/div/div/table/tbody/tr/td/div/div[2]/div/div[1]/div[5]/button[1]
    
    ${response text}=    Get Text    xpath=//div[@ng-controller='deletionDialogController']//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']
    ${request_id}=    Parse Request Id     ${response text}
    Poll MSO Get Request    ${GLOBAL_MSO_STATUS_PATH}${request_id}   COMPLETE
  
Create VID VNF module    
    [Arguments]    ${service_instance_id}    ${vf_module_name}    ${LCP_REGION}    ${TENANT}    ${VNF_TYPE}       
    Go To VID HOME
    Click Link       xpath=//div[@heading = 'Search for Existing Service Instances']/a
    Wait Until Page Contains    Please search by    timeout=60s
    Wait Until Page Contains Element    xpath=//div[@class='statusLine aaiHidden']    timeout=60s
    
     # If we don't wait for this control to be enabled, the submit results in a 'not found' pop-up (UnexpectedAlertPresentException) 
    Input Text When Enabled    //input[@name='selectedServiceInstance']    ${service_instance_id}
    Click Button    button=Submit
    Wait Until Page Contains Element    link=View/Edit    timeout=60s
    Click Element     link=View/Edit   
    Wait Until Page Contains    View/Edit Service Instance     timeout=60s
    Wait Until Page Contains Element    xpath=//div[@class='statusLine']    timeout=120s
    Wait Until Element Is Not Visible    xpath=//div[@class='statusLine aaiHidden']    timeout=120s
    Wait Until Element Is Visible    button=Add VF-Module   timeout=120s  
    Click Element    button=Add VF-Module
    
    # This is where firefox breaks. Th elink never becomes visible when run with the script.
    Click Element    link=${vnf_type}
    Wait Until Page Contains Element    xpath=//input[@parameter-id='instanceName']    20s
    Wait Until Element Is Enabled    xpath=//input[@parameter-id='instanceName']    20s
    
    ## Without this sleep, the input text below gets immediately wiped out. 
    ## Wait Until Angular Ready just sleeps for its timeout value
    Sleep    10s
    Input Text    xpath=//input[@parameter-id='instanceName']    ${vf_module_name}     
    Select From List By Label    xpath=//select[@parameter-id='lcpRegion']    ${lcp_region}      
    Select From List By Label    xpath=//select[@parameter-id='tenant']    ${tenant}      
    Click Element    button=Confirm
  Wait Until Element Contains    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']    requestId    timeout=120
    ${response text}=    Get Text    xpath=//div[@ng-controller= 'msoCommitController']/pre[@class = 'log ng-binding']  
    Click Element    button=Close
    ${instance_id}=    Parse Instance Id     ${response text}
    
    ${request_id}=    Parse Request Id     ${response text}
    Poll MSO Get Request    ${GLOBAL_MSO_STATUS_PATH}${request_id}   COMPLETE
    
    [Return]     ${instance_id}