Skip to content
Snippets Groups Projects
Commit 2131bd38 authored by Aalekh Jain's avatar Aalekh Jain
Browse files

Added UTs for `exists` method in `TenantFactoryImpl.java`

parent 393d31fd
No related branches found
No related tags found
1 merge request!61Improve code coverage
......@@ -42,8 +42,8 @@ public class TenantFactoryImplTest {
private static final String dataPartitionId = "data-partition-id";
private String[] ids = {"id1", "id2"};
private String[] complianceRuleSets = {"compliance-rule-set-1", "compliance-rule-set-2"};
private final String[] ids = {"id1", "id2"};
private final String[] complianceRuleSets = {"compliance-rule-set-1", "compliance-rule-set-2"};
@Mock
private CosmosStore cosmosStore;
......@@ -65,5 +65,18 @@ public class TenantFactoryImplTest {
}
doReturn(tenantInfoDocs).when(cosmosStore).findAllItems(eq(dataPartitionId), any(), any(), any());
}
@Test
public void testExists_whenExistingTenantNameGiven() {
for (String tenantName: ids) {
assertTrue(sut.exists(tenantName));
}
}
@Test
public void testExists_whenNonExistingTenantNameGiven() {
assertFalse(sut.exists("id-that-does-not-exist"));
assertFalse(sut.exists(""));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment