Skip to content
Snippets Groups Projects
Commit b003f7e5 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

minor fix

parent eabb54b1
No related branches found
No related tags found
1 merge request!20Adding helm charts and Istio config
Pipeline #12349 failed
......@@ -16,13 +16,21 @@
package org.opengroup.osdu.register.subscriber;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opengroup.osdu.register.model.Topic;
import org.opengroup.osdu.register.util.AzureTestUtils;
import org.opengroup.osdu.register.util.RestDescriptor;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class TestListTopicsApi extends ListTopicsApiTest {
......@@ -38,6 +46,18 @@ public class TestListTopicsApi extends ListTopicsApiTest {
this.testUtils = null;
}
@Override
protected void validate20XResponse(ClientResponse response, RestDescriptor descriptor) {
String body = response.getEntity(String.class);
java.lang.reflect.Type listType = new TypeToken<ArrayList<Topic>>() {
}.getType();
Gson gson = new Gson();
List<Topic> messages = gson.fromJson(body, listType);
assertTrue(messages.size() > 0);
String topic = System.getProperty("TEST_TOPIC_NAME", System.getenv("TEST_TOPIC_NAME"));
assertTrue(messages.stream().anyMatch(m -> m.name.equalsIgnoreCase(topic)));
}
@Test
@Override
public void should_return400_when_makingHttpRequestWithoutToken() throws Exception {
......
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