diff --git a/provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/di/TenantFactoryImplTest.java b/provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/di/TenantFactoryImplTest.java index 1838c0006857f6787a47a3599d05dde6e12e38f0..1948d1bbdf9d8325bcc8783a497411bc9beb4e45 100644 --- a/provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/di/TenantFactoryImplTest.java +++ b/provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/di/TenantFactoryImplTest.java @@ -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("")); + } }