src/test/java/nl/uva/qcdis/sdia/commons/utils/ToscaHelperTest.java
/**
     * Test of setCredentialsInVMTopology method, of class ToscaHelper.
     */
Test of setCredentialsInVMTopology method, of class ToscaHelper.
Test of setCredentialsInVMTopology method of class ToscaHelper .
@Test
    public void testSetCredentialsInVMTopology() throws Exception {
        if (serviceUp) {
            toscaTemplateWithCredentials = null;
            instance.uploadToscaTemplate(provisionedToscaTemplate);
            System.out.println("setCredentialsInVMTopology");
            List<NodeTemplateMap> vmTopologies = instance.getVMTopologyTemplates();
            for (NodeTemplateMap vmTopologyMap : vmTopologies) {
                String provider = instance.getTopologyProvider(vmTopologyMap);
                Credential credential = new Credential();
                credential.setCloudProviderName(provider);
                credential.setProtocol("protocol");
                Map<String, String> keys = new HashMap<>();
                keys.put("key1", "eeeeeeavovfouirveiuvbepuyb8rwqovd8boacbdbvwy8oqry7f08r3euadinanzxcjc078yn0183xoqedw");
                credential.setKeys(keys);
                credential.setToken("ijwbfciweubfriw");
                credential.setTokenType("passwrd");
                credential.setUser("user");
                vmTopologyMap = instance.setCredentialsInVMTopology(vmTopologyMap, credential);
            }
        }
    }
@ Test public void testSetCredentialsInVMTopology ( ) throws Exception { if ( serviceUp ) { toscaTemplateWithCredentials = null ; instance . uploadToscaTemplate ( provisionedToscaTemplate ) ; System . out . println ( "setCredentialsInVMTopology" ) ; List < NodeTemplateMap > vmTopologies = instance . getVMTopologyTemplates ( ) ; for ( NodeTemplateMap vmTopologyMap : vmTopologies ) { String provider = instance . getTopologyProvider ( vmTopologyMap ) ; Credential credential = new Credential ( ) ; credential . setCloudProviderName ( provider ) ; credential . setProtocol ( "protocol" ) ; Map < String , String > keys = new HashMap < > ( ) ; keys . put ( "key1" , "eeeeeeavovfouirveiuvbepuyb8rwqovd8boacbdbvwy8oqry7f08r3euadinanzxcjc078yn0183xoqedw" ) ; credential . setKeys ( keys ) ; credential . setToken ( "ijwbfciweubfriw" ) ; credential . setTokenType ( "passwrd" ) ; credential . setUser ( "user" ) ; vmTopologyMap = instance . setCredentialsInVMTopology ( vmTopologyMap , credential ) ; } } }
Test of setCredentialsInVMTopology method, of class ToscaHelper.
Test of setCredentialsInVMTopology method of class ToscaHelper .