Search in sources :

Example 1 with MockSecretServiceDelegate

use of com.walmartlabs.concord.plugins.hashivault.model.MockSecretServiceDelegate in project concord-plugins by walmartlabs.

the class HashiVaultTaskV2Test method getTask.

private HashiVaultTask getTask(boolean setDefaults) {
    Map<String, Object> vars = new HashMap<>();
    if (setDefaults) {
        Map<String, Object> defaults = new HashMap<>();
        defaults.put("baseUrl", getBaseUrl());
        defaults.put("apiToken", getApiToken());
        vars.put("hashivaultParams", defaults);
    }
    Context ctx = new MockContextV2(vars, null);
    SecretService s = new MockSecretServiceV2(new MockSecretServiceDelegate() {

        @Override
        public String exportString(String o, String n, String p) {
            return getApiToken();
        }
    });
    return new HashiVaultTask(ctx, s);
}
Also used : Context(com.walmartlabs.concord.runtime.v2.sdk.Context) MockSecretServiceV2(com.walmartlabs.concord.plugins.hashivault.model.MockSecretServiceV2) MockSecretServiceDelegate(com.walmartlabs.concord.plugins.hashivault.model.MockSecretServiceDelegate) MockContextV2(com.walmartlabs.concord.plugins.hashivault.model.MockContextV2) HashMap(java.util.HashMap) HashiVaultTask(com.walmartlabs.concord.plugins.hashivault.v2.HashiVaultTask) SecretService(com.walmartlabs.concord.runtime.v2.sdk.SecretService)

Aggregations

MockContextV2 (com.walmartlabs.concord.plugins.hashivault.model.MockContextV2)1 MockSecretServiceDelegate (com.walmartlabs.concord.plugins.hashivault.model.MockSecretServiceDelegate)1 MockSecretServiceV2 (com.walmartlabs.concord.plugins.hashivault.model.MockSecretServiceV2)1 HashiVaultTask (com.walmartlabs.concord.plugins.hashivault.v2.HashiVaultTask)1 Context (com.walmartlabs.concord.runtime.v2.sdk.Context)1 SecretService (com.walmartlabs.concord.runtime.v2.sdk.SecretService)1 HashMap (java.util.HashMap)1