@Test
public void addSubscriptionFailWithNoDayToSendAlert() throws Exception {

    Subscription subscription = TestUtils.getDefaultSubscription();
    String subId = "subTestId";
    subscription.setId(subId);
    subscription.setTarget("test@anotherteam.org");
    subscription.setSu(true);
    subscription.setMo(false);
    subscription.setTu(false);
    subscription.setWe(false);
    subscription.setTh(false);
    subscription.setFr(false);
    subscription.setSa(false);
    subscription.setSu(false);
    try {
        subscriptionService.addSubscription(subscription, TestUtils.DEFAULT_ALARM_ID);
        fail("Create a subscription with no alerting day should throw an exception");
    } catch (CerebroException ce) {
        assertEquals(ErrorCode.SUBSCRIPTION_INVALID, ce.getErrorCode());
    }
}