Search in sources :

Example 6 with GetTopicResponse

use of io.confluent.kafkarest.entities.v2.GetTopicResponse in project kafka-rest by confluentinc.

the class TopicsResourceTest method getTopics_existingCluster_returnsTopic.

@Test
public void getTopics_existingCluster_returnsTopic() {
    expect(topicManager.getTopic(TOPIC_1.getClusterId(), TOPIC_1.getName(), false)).andReturn(completedFuture(Optional.of(TOPIC_1)));
    replay(topicManager);
    FakeAsyncResponse response = new FakeAsyncResponse();
    topicsResource.getTopic(response, TOPIC_1.getClusterId(), TOPIC_1.getName(), false);
    GetTopicResponse expected = GetTopicResponse.create(newTopicData("topic-1", true, 3, 3));
    assertEquals(expected, response.getValue());
}
Also used : GetTopicResponse(io.confluent.kafkarest.entities.v3.GetTopicResponse) FakeAsyncResponse(io.confluent.kafkarest.response.FakeAsyncResponse) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)5 Response (javax.ws.rs.core.Response)4 GetTopicResponse (io.confluent.kafkarest.entities.v2.GetTopicResponse)3 GetTopicResponse (io.confluent.kafkarest.entities.v3.GetTopicResponse)3 TestUtils.assertErrorResponse (io.confluent.kafkarest.TestUtils.assertErrorResponse)2 TestUtils.assertOKResponse (io.confluent.kafkarest.TestUtils.assertOKResponse)2 CreateTopicResponse (io.confluent.kafkarest.entities.v3.CreateTopicResponse)2 GetTopicConfigResponse (io.confluent.kafkarest.entities.v3.GetTopicConfigResponse)2 ListTopicsResponse (io.confluent.kafkarest.entities.v3.ListTopicsResponse)2 List (java.util.List)2 Errors (io.confluent.kafkarest.Errors)1 Versions (io.confluent.kafkarest.Versions)1 TopicConfigManager (io.confluent.kafkarest.controllers.TopicConfigManager)1 TopicManager (io.confluent.kafkarest.controllers.TopicManager)1 Topic (io.confluent.kafkarest.entities.Topic)1 BrokerList (io.confluent.kafkarest.entities.v2.BrokerList)1 GetPartitionResponse (io.confluent.kafkarest.entities.v2.GetPartitionResponse)1 ResourceName (io.confluent.kafkarest.extension.ResourceAccesslistFeature.ResourceName)1 AsyncResponses (io.confluent.kafkarest.resources.AsyncResponses)1 FakeAsyncResponse (io.confluent.kafkarest.response.FakeAsyncResponse)1