// The following 4 tests are to make sure that the subscriberId validation
// also works when it is a hub subscriber and we're expecting the
// subscriberId to be in the "hub" specific format.
@Test(timeout=10000)
public void testSyncHubSubscribeWithInvalidSubscriberId() throws Exception {
Client hubClient = new HedwigHubClient(new HubClientConfiguration());
Subscriber hubSubscriber = hubClient.getSubscriber();
boolean subscribeSuccess = false;
try {
hubSubscriber.subscribe(getTopic(0), localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH);
} catch (InvalidSubscriberIdException e) {
subscribeSuccess = true;
} catch (Exception ex) {
subscribeSuccess = false;
}
assertTrue(subscribeSuccess);
hubClient.close();
}