@Test public void validEndMessageDelegates() { given: heartBeatsAreKnownMessages(); messageIsAHeartBeat(); validateMessageType(); when: validator.onComplete(); then: verify(acceptor).onComplete(); }
public MessageControl onComplete() { final IntHashSet missingFields = requiredFields.values(messageType).difference(fieldsForMessage); if (missingFields == null) { return delegate.onComplete(); } else { for (final int value : missingFields) { delegate.onError(MISSING_REQUIRED_FIELD, messageType, value, stringField); } } return MessageControl.CONTINUE; }
OtfValidator implements OtfMessageAcceptor { public MessageControl onComplete() { final IntHashSet missingFields = requiredFields.values(messageType).difference(fieldsForMessage); if (missingFields == null) { return delegate.onComplete(); } else { for (final int value : missingFields) { delegate.onError(MISSING_REQUIRED_FIELD, messageType, value, stringField); } } return MessageControl.CONTINUE; } }
OtfValidator implements OtfMessageAcceptor { public MessageControl onComplete() { final IntHashSet missingFields = requiredFields.values(messageType).difference(fieldsForMessage); if (missingFields == null) { return delegate.onComplete(); } else { for (final int value : missingFields) { delegate.onError(MISSING_REQUIRED_FIELD, messageType, value, stringField); } } return MessageControl.CONTINUE; } OtfValidator(
        final OtfMessageAcceptor delegate,
        final LongDictionary allFields,
        final LongDictionary requiredFields); }
OtfValidator implements OtfMessageAcceptor { public MessageControl onComplete() { final IntHashSet missingFields = requiredFields.values(messageType).difference(fieldsForMessage); if (missingFields == null) { return delegate.onComplete(); } else { for (final int value : missingFields) { delegate.onError(MISSING_REQUIRED_FIELD, messageType, value, stringField); } } return MessageControl.CONTINUE; } OtfValidator(
        final OtfMessageAcceptor delegate,
        final LongDictionary allFields,
        final LongDictionary requiredFields); MessageControl onNext(); MessageControl onComplete(); MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length); MessageControl onGroupHeader(final int tag, final int numInGroup); MessageControl onGroupBegin(final int tag, final int numInGroup, final int index); MessageControl onGroupEnd(final int tag, final int numInGroup, final int index); boolean onError(
        final ValidationError error, final long messageType, final int tagNumber, final AsciiFieldFlyweight value); }
OtfValidator implements OtfMessageAcceptor { public MessageControl onComplete() { final IntHashSet missingFields = requiredFields.values(messageType).difference(fieldsForMessage); if (missingFields == null) { return delegate.onComplete(); } else { for (final int value : missingFields) { delegate.onError(MISSING_REQUIRED_FIELD, messageType, value, stringField); } } return MessageControl.CONTINUE; } OtfValidator(
        final OtfMessageAcceptor delegate,
        final LongDictionary allFields,
        final LongDictionary requiredFields); MessageControl onNext(); MessageControl onComplete(); MessageControl onField(final int tag, final AsciiBuffer buffer, final int offset, final int length); MessageControl onGroupHeader(final int tag, final int numInGroup); MessageControl onGroupBegin(final int tag, final int numInGroup, final int index); MessageControl onGroupEnd(final int tag, final int numInGroup, final int index); boolean onError(
        final ValidationError error, final long messageType, final int tagNumber, final AsciiFieldFlyweight value);  }