NgsiValidation { public void checkUpdateSubscription(String subscriptionID, UpdateContextSubscription updateContextSubscription) throws MissingRequestParameterException, MismatchIdException { checkUpdateContextSubscription(updateContextSubscription); if (!subscriptionID.equals(updateContextSubscription.getSubscriptionId())) { throw new MismatchIdException(subscriptionID, updateContextSubscription.getSubscriptionId()); } }  void checkUpdateContext(UpdateContext updateContext); void checkNotifyContext(NotifyContext notifyContext); void checkRegisterContext(RegisterContext registerContext); void checkSubscribeContext(SubscribeContext subscribeContext); void checkUpdateContextSubscription(UpdateContextSubscription updateContextSubscription); void checkUnsubscribeContext(UnsubscribeContext unsubscribeContext); void checkQueryContext(QueryContext queryContext); void checkAppendContextElement(AppendContextElement appendContextElement); void checkUpdateContextElement(UpdateContextElement updateContextElement); void checkUpdateContextAttribute(String entityID, String attributeName, String valueID, UpdateContextAttribute updateContextAttribute); void checkUpdateSubscription(String subscriptionID, UpdateContextSubscription updateContextSubscription);  }
@Test public void differentSubscriptionIDInUpdateSubscription() throws Exception { UpdateContextSubscription updateContextSubscription = new UpdateContextSubscription(); EntityId entityId = new EntityId("Room1","Room",false); updateContextSubscription.setSubscriptionId("12345"); thrown.expect(MismatchIdException.class); thrown.expectMessage("mismatch id between parameter 54321 and body 12345"); ngsiValidation.checkUpdateSubscription("54321", updateContextSubscription); }