diff --git a/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java b/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java index 70d81c093369b5c8169ddfe86dab6c15b385411a..812d7c305225145ccbe54e38c6165dd94ffee4b8 100644 --- a/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java +++ b/testing/notification-test-azure/src/test/java/org/opengroup/osdu/notification/api/TestPubsubEndpointHMAC.java @@ -58,4 +58,33 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests { // If HTTP is a need, corresponding infra changes will be required for this test to function. return; } + + // For the following 403 is the expceted result. + // Tracking in Issue: https://community.opengroup.org/osdu/platform/system/notification/-/issues/17 + @Test + @Override + public void should_return401_when_accessingWithNoAccessCredentials() throws Exception{ + ClientResponse response = descriptor.run(getArg(), testUtils.getNoAccessToken()); + assertEquals(error( response.getEntity(String.class)), 403, response.getStatus()); + } + + @Test + public void should_return401_when_noAccessOnCustomerTenant() throws Exception { + ClientResponse response = descriptor.runOnCustomerTenant(getArg(), getOsduTenantAdminCredentials()); + assertEquals(error( response.getEntity(String.class)), 403, response.getStatus()); + } + + @Test + @Override + public void should_return401_when_accessingWithEditorCredentials() throws Exception{ + ClientResponse response = descriptor.run(getArg(), testUtils.getEditorToken()); + assertEquals(error( response.getEntity(String.class)), 403, response.getStatus()); + } + + @Test + @Override + public void should_return401_when_accessingWithAdminCredentials() throws Exception{ + ClientResponse response = descriptor.run(getArg(), testUtils.getAdminToken()); + assertEquals(error( response.getEntity(String.class)), 403, response.getStatus()); + } } \ No newline at end of file