There is a security vulnerability in SSH key-generation using GitKraken < v8.0.1. If you used this tool to create SSH keys, please update GitKraken and regenerate. If you need help with this, contact forum-support@opengroup.org

Commit 4e661726 authored by Nikhil Singh[MicroSoft]'s avatar Nikhil Singh[MicroSoft]
Browse files

Ignore IT conditionally

parent 5f542e41
Pipeline #62887 failed with stages
in 30 minutes and 39 seconds
......@@ -21,11 +21,15 @@ import org.opengroup.osdu.notification.util.Config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import static org.junit.Assert.assertEquals;
@ConditionalOnProperty(value = "requestScope.enabled", havingValue = "true", matchIfMissing = false)
public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
@BeforeClass
public static void classSetup() throws Exception {
String isEventGridEnabled = System.getenv("event_grid_enabled");
if (isEventGridEnabled != null) {
org.junit.Assume.assumeTrue(Boolean.parseBoolean(isEventGridEnabled));
}
PubsubEndpointHMACTests.classSetup();
}
......@@ -48,7 +52,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
@Test
@Override
public void should_return400_when_makingHttpRequestWithoutToken() throws Exception {
ClientResponse response = descriptor.run(getArg(), "");
ClientResponse response = descriptor.run(getArg(), "");
assertEquals(error(response.getEntity(String.class)), 403, response.getStatus());
}
......@@ -64,30 +68,30 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
// Tracking in Issue: https://community.opengroup.org/osdu/platform/system/notification/-/issues/17
@Test
@Override
public void should_return401_when_accessingWithNoAccessCredentials() throws Exception{
public void should_return401_when_accessingWithNoAccessCredentials() throws Exception {
ClientResponse response = descriptor.run(getArg(), testUtils.getNoAccessToken());
assertEquals(error( response.getEntity(String.class)), 401, response.getStatus());
assertEquals(error(response.getEntity(String.class)), 401, response.getStatus());
}
@Test
@Override
public void should_return401_when_noAccessOnCustomerTenant() throws Exception {
ClientResponse response = descriptor.runOnCustomerTenant(getArg(), getOsduTenantAdminCredentials());
assertEquals(error( response.getEntity(String.class)), 403, response.getStatus());
assertEquals(error(response.getEntity(String.class)), 403, response.getStatus());
}
@Test
@Override
public void should_return401_when_accessingWithEditorCredentials() throws Exception{
public void should_return401_when_accessingWithEditorCredentials() throws Exception {
ClientResponse response = descriptor.run(getArg(), testUtils.getNoAccessToken());
assertEquals(error( response.getEntity(String.class)), 401, response.getStatus());
assertEquals(error(response.getEntity(String.class)), 401, response.getStatus());
}
@Test
@Override
public void should_return401_when_accessingWithAdminCredentials() throws Exception{
public void should_return401_when_accessingWithAdminCredentials() throws Exception {
ClientResponse response = descriptor.run(getArg(), testUtils.getNoAccessToken());
assertEquals(error( response.getEntity(String.class)), 401, response.getStatus());
assertEquals(error(response.getEntity(String.class)), 401, response.getStatus());
}
@Test
......@@ -97,7 +101,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
try {
ClientResponse response = descriptor.run(this.getArg(), this.testUtils.getOpsToken());
Assert.assertEquals(this.error(response.getStatus() == 204 ? "" : (String)response.getEntity(String.class)), (long)this.expectedOkResponseCode(), (long)response.getStatus());
Assert.assertEquals(this.error(response.getStatus() == 204 ? "" : (String) response.getEntity(String.class)), (long) this.expectedOkResponseCode(), (long) response.getStatus());
Assert.assertEquals("GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH", response.getHeaders().getFirst("Access-Control-Allow-Methods"));
Assert.assertEquals("access-control-allow-origin, origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey", response.getHeaders().getFirst("Access-Control-Allow-Headers"));
Assert.assertEquals("*", response.getHeaders().getFirst("Access-Control-Allow-Origin"));
......@@ -122,7 +126,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
try {
ClientResponse response = descriptor.run(this.getArg(), this.testUtils.getOpsToken());
Assert.assertEquals(this.error(""), (long)this.expectedOkResponseCode(), (long)response.getStatus());
Assert.assertEquals(this.error(""), (long) this.expectedOkResponseCode(), (long) response.getStatus());
this.validate20XResponse(response, descriptor);
} finally {
this.deleteResource();
......
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