Commit 52fa7245 authored by Riabokon Stanislav(EPAM)[GCP]'s avatar Riabokon Stanislav(EPAM)[GCP]
Browse files

Fixed int tests for GCP.

parent 4009f936
......@@ -95,7 +95,7 @@ public abstract class UpdatePartitionTest extends BaseTestTemplate {
return sb.toString();
}
private String getValidBodyForUpdatePartition() {
protected String getValidBodyForUpdatePartition() {
StringBuffer sb = new StringBuffer();
sb.append("{\n");
sb.append(" \"properties\": {")
......
......@@ -17,9 +17,14 @@
package org.opengroup.osdu.partition.api;
import static org.junit.Assert.assertEquals;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.partition.util.GCPTestUtils;
import org.springframework.http.HttpStatus;
public class TestUpdatePartition extends UpdatePartitionTest {
......@@ -29,6 +34,32 @@ public class TestUpdatePartition extends UpdatePartitionTest {
this.testUtils = new GCPTestUtils();
}
@Override
@Test
public void should_return20XResponseCode_when_makingValidHttpsRequest() throws Exception {
createResource();
ClientResponse response = this.descriptor
.runWithCustomPayload(this.getId(), getValidBodyForUpdatePartition(),
this.testUtils.getAccessToken());
deleteResource();
assertEquals(response.getStatus(), HttpStatus.NO_CONTENT.value());
assertEquals("GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH",
response.getHeaders().getFirst("Access-Control-Allow-Methods"));
assertEquals(
"origin, content-type, accept, authorization, data-partition-id, correlation-id, appkey",
response.getHeaders().getFirst("Access-Control-Allow-Headers"));
assertEquals("*", response.getHeaders().getFirst("Access-Control-Allow-Origin"));
assertEquals("true", response.getHeaders().getFirst("Access-Control-Allow-Credentials"));
assertEquals("default-src 'self'", response.getHeaders().getFirst("Content-Security-Policy"));
assertEquals("max-age=31536000; includeSubDomains",
response.getHeaders().getFirst("Strict-Transport-Security"));
assertEquals("0", response.getHeaders().getFirst("Expires"));
assertEquals("DENY", response.getHeaders().getFirst("X-Frame-Options"));
assertEquals("private, max-age=300", response.getHeaders().getFirst("Cache-Control"));
assertEquals("1; mode=block", response.getHeaders().getFirst("X-XSS-Protection"));
assertEquals("nosniff", response.getHeaders().getFirst("X-Content-Type-Options"));
}
@Override
@After
public void tearDown() throws Exception {
......
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