Commit 7f6f1dc6 authored by neelesh thakur's avatar neelesh thakur
Browse files

remove cosmosdb bootstrap settings

parent f6f62d4f
Pipeline #9480 canceled with stages
in 1 minute and 55 seconds
// Copyright 2017-2020, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.partition.provider.azure.di;
import com.azure.security.keyvault.secrets.SecretClient;
import com.azure.security.keyvault.secrets.models.KeyVaultSecret;
import org.junit.Test;
import org.mockito.Mockito;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.doReturn;
public class AzureBootstrapConfigTest {
private AzureBootstrapConfig bootstrapConfig = new AzureBootstrapConfig();
private SecretClient kv = Mockito.mock(SecretClient.class);
@Test
public void config_returnsCorrectSecret_cosmosKey() {
KeyVaultSecret secret = Mockito.mock(KeyVaultSecret.class);
doReturn("cosmos-key-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-primary-key");
String secretValue = bootstrapConfig.cosmosKey(kv);
assertEquals("Secret value was incorrect", "cosmos-key-secret", secretValue);
}
@Test
public void config_returnsCorrectSecret_cosmosEndpoint() {
KeyVaultSecret secret = Mockito.mock(KeyVaultSecret.class);
doReturn("cosmos-endpoint-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-endpoint");
String secretValue = bootstrapConfig.cosmosEndpoint(kv);
assertEquals("Secret value was incorrect", "cosmos-endpoint-secret", secretValue);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment