Commit e0be77fb authored by Komal Makkar's avatar Komal Makkar
Browse files

Addressing failed test for option request.

parent 8a179dfc
Pipeline #23763 failed with stages
in 1 minute and 5 seconds
......@@ -29,6 +29,7 @@ import org.opengroup.osdu.notification.provider.interfaces.IPubsubRequestBodyExt
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.annotation.RequestScope;
import javax.servlet.http.HttpServletRequest;
......@@ -152,7 +153,7 @@ public class EventGridRequestBodyExtractor implements IPubsubRequestBodyExtracto
// TODO : @komakkar sanitize the exceptions to match the SpringExceptionMapper and throw ValidationException
private NotificationRequest extractNotificationRequestFromHttpRequest() {
NotificationRequest notificationRequest = null;
if (this.notificationRequest == null) {
if (this.notificationRequest == null && this.httpServletRequest.getMethod().equalsIgnoreCase("post")) {
try {
String requestBody = getBody(this.httpServletRequest);
NotificationRequest[] notificationRequestArray = GSON.fromJson(requestBody, NotificationRequest[].class);
......
......@@ -213,7 +213,7 @@ public class EventGridRequestBodyExtractorTest {
BufferedReader reader = new BufferedReader(new StringReader(validHandshakeRequestRoot));
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(validHandshakeRequestRoot.getBytes());
when(httpServletRequest.getMethod()).thenReturn("POST");
when(httpServletRequest.getInputStream()).thenReturn(new ServletInputStream() {
@Override
public boolean isFinished() {
......
......@@ -90,7 +90,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
}
@Test
@Override// ignoring because it is flaky. Fixing in a different MR
@Override
public void should_return20X_when_usingCredentialsWithOpsPermission() throws Exception {
this.createResource();
......@@ -115,7 +115,7 @@ public class TestPubsubEndpointHMAC extends PubsubEndpointHMACTests {
}
@Test
@Override// ignoring because it is flaky. Debugging it to fix.
@Override
public void should_return20XResponseCode_when_makingValidHttpsRequest() throws Exception {
this.createResource();
......
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