Commit 75fe7f0b authored by Anastasiia Gelmut's avatar Anastasiia Gelmut
Browse files

GONRG-3532 Integration Test Implement Clean-up for Datastore

parent 9cb6c9df
Pipeline #70536 failed with stages
in 32 minutes and 52 seconds
......@@ -36,14 +36,17 @@ public class TestCreatePartition extends CreatePartitionTest {
@Override
@After
public void tearDown() throws Exception {
deleteResource();
this.testUtils = null;
}
@Override
@Test
public void should_return40XResponseCode_when_makingRequest_withInvalidPayload() throws Exception {
public void should_return40XResponseCode_when_makingRequest_withInvalidPayload()
throws Exception {
String invalidPayload = "{\"properties_invalid\":{}}";
ClientResponse response = descriptor.runWithCustomPayload(getId(), invalidPayload, testUtils.getAccessToken());
ClientResponse response = descriptor.runWithCustomPayload(getId(), invalidPayload,
testUtils.getAccessToken());
assertEquals(400, response.getStatus());
}
}
......@@ -32,6 +32,7 @@ public class TestDeletePartition extends DeletePartitionTest {
@Override
@After
public void tearDown() throws Exception {
deleteResource();
this.testUtils = null;
}
}
......@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestGetPartitionById extends GetPartitionByIdApitTest {
......@@ -32,6 +34,14 @@ public class TestGetPartitionById extends GetPartitionByIdApitTest {
@Override
@After
public void tearDown() throws Exception {
deleteResource();
this.testUtils = null;
}
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
}
......@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestListPartitions extends ListPartitionsApitTest {
......@@ -32,6 +34,14 @@ public class TestListPartitions extends ListPartitionsApitTest {
@Override
@After
public void tearDown() throws Exception {
deleteResource();
this.testUtils = null;
}
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
}
......@@ -17,8 +17,10 @@
package org.opengroup.osdu.partition.api;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;
import org.junit.Before;
import org.opengroup.osdu.partition.api.descriptor.DeletePartitionDescriptor;
import org.opengroup.osdu.partition.util.GCPTestUtils;
public class TestUpdatePartition extends UpdatePartitionTest {
......@@ -31,7 +33,15 @@ public class TestUpdatePartition extends UpdatePartitionTest {
@Override
@After
public void tearDown() {
public void tearDown() throws Exception {
deleteResource();
this.testUtils = null;
}
@Override
protected void deleteResource() throws Exception {
DeletePartitionDescriptor deletePartitionDes = new DeletePartitionDescriptor();
deletePartitionDes.setPartitionId(getId());
ClientResponse response = deletePartitionDes.run(getId(), this.testUtils.getAccessToken());
}
}
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