@Test public void testExtractAgreementId() throws Exception { assertEquals(SeaCloudsApplicationData.extractAgreementId(toscaDamMap), AGREEMENT_ID); }
static String extractAgreementId(Map toscaDamMap) throws JAXBException { Map topologyTemplate = (Map) toscaDamMap.get(YAML_TOPOLOGY_TEMPLATE_TAG); Map groups = (Map) topologyTemplate.get(YAML_GROUPS_TEMPLATE_TAG); Map seaCloudsConfigurationMember = (Map) groups.get(YAML_SEACLOUDS_POLICY_TAG); Map seaCloudsConfigurationPolicy = (Map) ((Map)((List) seaCloudsConfigurationMember.get(YAML_POLICIES_TAG)).get(0)).get(YAML_SEACLOUDS_POLICY_CONFIGURATION_TAG); String agreementB64String = (String) seaCloudsConfigurationPolicy.get(YAML_SEACLOUDS_AGREEMENT_TAG); String agreementString = new String(BaseEncoding.base64().decode(agreementB64String)); Agreement agreement = ObjectMapperHelpers.XmlToObject(agreementString, Agreement.class); return agreement.getAgreementId(); }
SeaCloudsApplicationData implements Serializable { static String extractAgreementId(Map toscaDamMap) throws JAXBException { Map topologyTemplate = (Map) toscaDamMap.get(YAML_TOPOLOGY_TEMPLATE_TAG); Map groups = (Map) topologyTemplate.get(YAML_GROUPS_TEMPLATE_TAG); Map seaCloudsConfigurationMember = (Map) groups.get(YAML_SEACLOUDS_POLICY_TAG); Map seaCloudsConfigurationPolicy = (Map) ((Map)((List) seaCloudsConfigurationMember.get(YAML_POLICIES_TAG)).get(0)).get(YAML_SEACLOUDS_POLICY_CONFIGURATION_TAG); String agreementB64String = (String) seaCloudsConfigurationPolicy.get(YAML_SEACLOUDS_AGREEMENT_TAG); String agreementString = new String(BaseEncoding.base64().decode(agreementB64String)); Agreement agreement = ObjectMapperHelpers.XmlToObject(agreementString, Agreement.class); return agreement.getAgreementId(); } }
SeaCloudsApplicationData implements Serializable { static String extractAgreementId(Map toscaDamMap) throws JAXBException { Map topologyTemplate = (Map) toscaDamMap.get(YAML_TOPOLOGY_TEMPLATE_TAG); Map groups = (Map) topologyTemplate.get(YAML_GROUPS_TEMPLATE_TAG); Map seaCloudsConfigurationMember = (Map) groups.get(YAML_SEACLOUDS_POLICY_TAG); Map seaCloudsConfigurationPolicy = (Map) ((Map)((List) seaCloudsConfigurationMember.get(YAML_POLICIES_TAG)).get(0)).get(YAML_SEACLOUDS_POLICY_CONFIGURATION_TAG); String agreementB64String = (String) seaCloudsConfigurationPolicy.get(YAML_SEACLOUDS_AGREEMENT_TAG); String agreementString = new String(BaseEncoding.base64().decode(agreementB64String)); Agreement agreement = ObjectMapperHelpers.XmlToObject(agreementString, Agreement.class); return agreement.getAgreementId(); } SeaCloudsApplicationData(String toscaDam);   SeaCloudsApplicationData(Map toscaDamMap); }
SeaCloudsApplicationData implements Serializable { static String extractAgreementId(Map toscaDamMap) throws JAXBException { Map topologyTemplate = (Map) toscaDamMap.get(YAML_TOPOLOGY_TEMPLATE_TAG); Map groups = (Map) topologyTemplate.get(YAML_GROUPS_TEMPLATE_TAG); Map seaCloudsConfigurationMember = (Map) groups.get(YAML_SEACLOUDS_POLICY_TAG); Map seaCloudsConfigurationPolicy = (Map) ((Map)((List) seaCloudsConfigurationMember.get(YAML_POLICIES_TAG)).get(0)).get(YAML_SEACLOUDS_POLICY_CONFIGURATION_TAG); String agreementB64String = (String) seaCloudsConfigurationPolicy.get(YAML_SEACLOUDS_AGREEMENT_TAG); String agreementString = new String(BaseEncoding.base64().decode(agreementB64String)); Agreement agreement = ObjectMapperHelpers.XmlToObject(agreementString, Agreement.class); return agreement.getAgreementId(); } SeaCloudsApplicationData(String toscaDam);   SeaCloudsApplicationData(Map toscaDamMap); void setDeployerApplicationId(ApplicationSummary application); void setDeployerApplicationId(TaskSummary applicationTask); void setMonitoringRulesIds(MonitoringRules monitoringRules); void setAgreementId(Agreement agreement); @JsonProperty String getSeaCloudsApplicationId(); @JsonProperty String getName(); @JsonProperty Set<String> getMonitoringRulesIds(); @JsonProperty String getAgreementId(); @JsonProperty String getToscaDam(); @JsonProperty String getDeployerApplicationId(); @JsonProperty Status getDeploymentStatus(); @JsonProperty IGuaranteeTerm.GuaranteeTermStatusEnum getAgreementStatus(); void setAgreementStatus(IGuaranteeTerm.GuaranteeTermStatusEnum agreementStatus); void setDeploymentStatus(Status deploymentStatus); @Override boolean equals(Object o); @Override int hashCode(); }
SeaCloudsApplicationData implements Serializable { static String extractAgreementId(Map toscaDamMap) throws JAXBException { Map topologyTemplate = (Map) toscaDamMap.get(YAML_TOPOLOGY_TEMPLATE_TAG); Map groups = (Map) topologyTemplate.get(YAML_GROUPS_TEMPLATE_TAG); Map seaCloudsConfigurationMember = (Map) groups.get(YAML_SEACLOUDS_POLICY_TAG); Map seaCloudsConfigurationPolicy = (Map) ((Map)((List) seaCloudsConfigurationMember.get(YAML_POLICIES_TAG)).get(0)).get(YAML_SEACLOUDS_POLICY_CONFIGURATION_TAG); String agreementB64String = (String) seaCloudsConfigurationPolicy.get(YAML_SEACLOUDS_AGREEMENT_TAG); String agreementString = new String(BaseEncoding.base64().decode(agreementB64String)); Agreement agreement = ObjectMapperHelpers.XmlToObject(agreementString, Agreement.class); return agreement.getAgreementId(); } SeaCloudsApplicationData(String toscaDam);   SeaCloudsApplicationData(Map toscaDamMap); void setDeployerApplicationId(ApplicationSummary application); void setDeployerApplicationId(TaskSummary applicationTask); void setMonitoringRulesIds(MonitoringRules monitoringRules); void setAgreementId(Agreement agreement); @JsonProperty String getSeaCloudsApplicationId(); @JsonProperty String getName(); @JsonProperty Set<String> getMonitoringRulesIds(); @JsonProperty String getAgreementId(); @JsonProperty String getToscaDam(); @JsonProperty String getDeployerApplicationId(); @JsonProperty Status getDeploymentStatus(); @JsonProperty IGuaranteeTerm.GuaranteeTermStatusEnum getAgreementStatus(); void setAgreementStatus(IGuaranteeTerm.GuaranteeTermStatusEnum agreementStatus); void setDeploymentStatus(Status deploymentStatus); @Override boolean equals(Object o); @Override int hashCode();  }