@Test(expectedExceptions = SequenceHandlerKeyValidationException.class) public void testCheckRequestShouldThrowValidationExceptionWhenHandlerKeyIsNull() { underTest.validateGeneratedKey(null, HANDLER_NAME); }
public void validateGeneratedKey(final String handlerKey, final String handlerClassName) { if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()) || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) { throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: " + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()); } }
HandlerKeyValidator { public void validateGeneratedKey(final String handlerKey, final String handlerClassName) { if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()) || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) { throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: " + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()); } } }
HandlerKeyValidator { public void validateGeneratedKey(final String handlerKey, final String handlerClassName) { if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()) || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) { throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: " + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()); } }  }
HandlerKeyValidator { public void validateGeneratedKey(final String handlerKey, final String handlerClassName) { if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()) || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) { throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: " + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()); } }  void validateGeneratedKey(final String handlerKey, final String handlerClassName); }
HandlerKeyValidator { public void validateGeneratedKey(final String handlerKey, final String handlerClassName) { if (handlerKey == null || (handlerKey.contains(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()) || handlerKey.contains(SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()))) { throw new SequenceHandlerKeyValidationException(handlerKey + " is not valid, handler(" + handlerClassName + "). Forbidden charaters: " + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + " " + SequenceConstants.SEQUENCE_ID_SEPARATOR.getConstant()); } }  void validateGeneratedKey(final String handlerKey, final String handlerClassName);  }