Skip to content
Snippets Groups Projects
Commit d531aa9d authored by Volodymyr Sydorenko's avatar Volodymyr Sydorenko
Browse files

Refactoring of integration tests

(cherry picked from commit 33aeee6e3e96be243975925377ef586de72bd160)
parent 35d229bc
No related branches found
No related tags found
1 merge request!489Trailing slash fix
/*
* Copyright 2017-2020, Schlumberger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.opengroup.osdu.register.util;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.Test;
import org.springframework.http.HttpMethod;
import static org.junit.Assert.assertEquals;
public abstract class HealthCheckTest extends BaseTestTemplate {
public HealthCheckTest(RestDescriptor getDescriptor) {
super(getDescriptor);
}
private String id = "retrievetest" + System.currentTimeMillis();
@Override
protected String getId() {
return id;
}
@Override
protected void deleteResource() throws Exception {
}
@Override
protected void deleteResourcewitharg(String ext) throws Exception {
}
@Override
protected void createResource() throws Exception {
}
@Override
protected void createResourcewitharg(String ext) throws Exception {
}
@Override
protected int expectedOkResponseCode() {
return 200;
}
@Test
public void should_returnTrailingOk() throws Exception {
ClientResponse response =
TestUtils.send("api/register/v1/ah/liveness_check/", HttpMethod.GET.name(), this.testUtils.getOpsAccessToken(), "", "");
assertEquals(expectedOkResponseCode(), response.getStatus());
}
}
......@@ -19,8 +19,6 @@ package org.opengroup.osdu.register.util;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import java.util.ArrayList;
import java.util.List;
......@@ -112,11 +110,4 @@ public abstract class RetrieveApiTestTemplate extends BaseTestTemplate {
assertEquals(error("Expected all successful responses. Actual " + sucessResponseCount), 10, sucessResponseCount);
assertEquals(error("Unexpected error response returned"), 0, errorResponseCount);
}
@Test
public void should_returnTrailingOk() throws Exception {
ClientResponse response =
TestUtils.send("api/register/v1/ah/liveness_check/", HttpMethod.GET.name(), this.testUtils.getOpsAccessToken(), "", "");
assertEquals(expectedOkResponseCode(), response.getStatus());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment