use of co.cask.cdap.proto.StreamDetail in project cdap by caskdata.
the class StreamHandlerTest method listStreams.
private List<StreamDetail> listStreams(NamespaceId namespaceId) throws Exception {
URL url = createURL(namespaceId.getNamespace(), "streams");
HttpRequest request = HttpRequest.get(url).build();
HttpResponse response = HttpRequests.execute(request);
if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
throw new NamespaceNotFoundException(namespaceId);
}
Assert.assertEquals(200, response.getResponseCode());
return GSON.fromJson(response.getResponseBodyAsString(), new TypeToken<List<StreamDetail>>() {
}.getType());
}
use of co.cask.cdap.proto.StreamDetail in project cdap by caskdata.
the class IntegrationTestBase method assertNoStreams.
private void assertNoStreams(NamespaceId namespace) throws Exception {
List<StreamDetail> streams = getStreamClient().list(namespace);
List<String> streamNames = Lists.newArrayList();
for (StreamDetail stream : streams) {
streamNames.add(stream.getName());
}
Assert.assertTrue("Must have no streams, but found the following streams: " + Joiner.on(", ").join(streamNames), streamNames.isEmpty());
}
Aggregations