@PostConstruct
    public void applyPluginMetadata() {
        String pluginId = getPluginId();
        for (ConfigurationProperty configurationProperty : configuration) {
            SCMMetadataStore scmMetadataStore = SCMMetadataStore.getInstance();
            if (scmMetadataStore.getConfigurationMetadata(pluginId) != null) {
                boolean isSecureProperty = scmMetadataStore.hasOption(pluginId, configurationProperty.getConfigurationKey().getName(), SCMConfiguration.SECURE);
                configurationProperty.handleSecureValueConfiguration(isSecureProperty);
            }
        }
    }
@Test
    void shouldMakeConfigurationSecureBasedOnMetadata() throws Exception {
        GoCipher goCipher = new GoCipher();

        //meta data of SCM
        SCMConfigurations scmConfiguration = new SCMConfigurations();
        scmConfiguration.add(new SCMConfiguration("key1").with(SECURE, true));
        scmConfiguration.add(new SCMConfiguration("key2").with(SECURE, false));
        SCMMetadataStore.getInstance().addMetadataFor("plugin-id", scmConfiguration, null);

        /*secure property is set based on metadata*/
        ConfigurationProperty secureProperty = new ConfigurationProperty(new ConfigurationKey("key1"), new ConfigurationValue("value1"), null, goCipher);
        ConfigurationProperty nonSecureProperty = new ConfigurationProperty(new ConfigurationKey("key2"), new ConfigurationValue("value2"), null, goCipher);
        SCM scm = SCMMother.create("scm-id", "scm-name", "plugin-id", "1.0", new Configuration(secureProperty, nonSecureProperty));

        scm.applyPluginMetadata();

        //assert SCM properties
        assertThat(secureProperty.isSecure()).isTrue();
        assertThat(secureProperty.getEncryptedConfigurationValue()).isNotNull();
        assertThat(secureProperty.getEncryptedValue()).isEqualTo(goCipher.encrypt("value1"));

        assertThat(nonSecureProperty.isSecure()).isFalse();
        assertThat(nonSecureProperty.getValue()).isEqualTo("value2");
    }