NakadiClient { @Deprecated public Subscription subscribe(String applicationName, String eventName, String consumerGroup) throws IOException { return subscription(applicationName, eventName).withConsumerGroup(consumerGroup).subscribe(); } NakadiClient(URI baseUri, RequestFactory clientHttpRequestFactory, ObjectMapper objectMapper, CursorManager cursorManager); static NakadiClientBuilder builder(URI baseUri); List<Partition> getPartitions(String eventName); void publish(String eventName, List<T> events); @Deprecated Subscription subscribe(String applicationName, String eventName, String consumerGroup); SubscriptionBuilder subscription(String applicationName, String eventName); SubscriptionBuilder subscription(String applicationName, Set<String> eventNames); void deleteSubscription(String subscriptionId); StreamBuilder.SubscriptionStreamBuilder stream(Subscription subscription); StreamBuilder.LowLevelStreamBuilder stream(String eventName);  }
@Test public void shouldThrowExceptionOnSubscriptionToUnknownEvent() throws IOException { server.expectRequestTo("http: .andRespondWith(422, ContentType.APPLICATION_JSON, "{\n" + " \"type\": \"http: " \"title\": \"Unprocessable Entity\",\n" + " \"status\": 422,\n" + " \"detail\": \"Eventtype does not exist.\"\n" + "}").setup(); expectedException.expect(IOProblem.class); expectedException.expectMessage("Problem [http: client.subscribe("nakadi-client-test", Collections.singleton("non-existing-event"), "nakadi-client-test-consumer", SubscriptionRequest.Position.BEGIN, null, null); server.verify(); }