@Test
public void addSubscriptionFailWithNoTarget() throws Exception {

    Subscription subscription = TestUtils.getDefaultSubscription();
    String subId = "subTestId";
    subscription.setId(subId);
    subscription.setTarget("");
    try {
        subscriptionService.addSubscription(subscription, TestUtils.DEFAULT_ALARM_ID);
        fail("Create a subscription with no target should throw an exception");
    } catch (CerebroException ce) {
        assertEquals(ErrorCode.SUBSCRIPTION_INVALID, ce.getErrorCode());
    }
}