Commit 0c838e65 authored by Sheng Wang's avatar Sheng Wang
Browse files

test getCosmosConnectionConfig

parent ad578be1
Pipeline #24683 failed with stages
in 8 minutes and 39 seconds
......@@ -84,6 +84,12 @@ public class PartitionAndCacheService implements IMongodbConnection {
}
private String getReCosmosConnection(PartitionInfoAzure infoAzure) {
String connection1 = String.valueOf(infoAzure.getCosmosConnectionConfig().getValue());
String value = keyvaultClient.getSecretValue(connection1);
if (value != null) {
throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal Server Error", "The value of cosmos-connection in Partition Service:" + value.substring(1, 5));
}
if (infoAzure.getReCosmosConnectionConfig() == null) {
throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal Server Error", "The value of re-cosmos-connection in Partition Service is null");
}
......
......@@ -37,6 +37,9 @@ public class PartitionInfoAzure {
@SerializedName("name")
private Property nameConfig;
@SerializedName("cosmos-connection")
private Property cosmosConnectionConfig;
@SerializedName("re-cosmos-connection")
private Property reCosmosConnectionConfig;
}
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