@Test
public void updateSubscriptionFailIfTypeChange() throws Exception {

    Subscription subscription = TestUtils.getDefaultSubscription();
    subscription.setType(SubscriptionType.HIPCHAT);
    try {
        subscriptionService.updateSubscription(subscription, TestUtils.DEFAULT_ALARM_ID);
        fail("Update type of a subscription should throw an exception");
    } catch (CerebroException ce) {
        assertEquals(ErrorCode.SUBSCRIPTION_UPDATE_INVALID, ce.getErrorCode());
    }
}