@Test public void shouldSendMessageWithValidation() throws FieldNotFound, IncorrectTagValue, IncorrectDataFormat { mockMessage(expectedBeginString, expectedSender, expectedTarget); mockSessionFound(); mockDataDictionary(); SessionID expectedSessionID = new SessionID(expectedBeginString, expectedSender, expectedTarget); given(session.send(message)).willReturn(true); boolean sent = quickFixJTemplate.send(message); assertSessionID(expectedSessionID); assertThat(sent).isTrue(); assertMessageSent(expectedSender, expectedTarget); ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class); verify(applicationDataDictionary).validate(messageCaptor.capture(), eq(true)); }
@Override public boolean send(Message message) { Assert.notNull(message, "'message' must not be null"); SessionID sessionID = QuickFixJSessionID.quickFixJSessionIDBuilder() .message(message) .build().toSessionID(); return doSend(message, sessionID); }
QuickFixJTemplate implements QuickFixJOperations { @Override public boolean send(Message message) { Assert.notNull(message, "'message' must not be null"); SessionID sessionID = QuickFixJSessionID.quickFixJSessionIDBuilder() .message(message) .build().toSessionID(); return doSend(message, sessionID); } }
QuickFixJTemplate implements QuickFixJOperations { @Override public boolean send(Message message) { Assert.notNull(message, "'message' must not be null"); SessionID sessionID = QuickFixJSessionID.quickFixJSessionIDBuilder() .message(message) .build().toSessionID(); return doSend(message, sessionID); } QuickFixJTemplate();  QuickFixJTemplate(SessionLookupHandler sessionLookupHandler); }
QuickFixJTemplate implements QuickFixJOperations { @Override public boolean send(Message message) { Assert.notNull(message, "'message' must not be null"); SessionID sessionID = QuickFixJSessionID.quickFixJSessionIDBuilder() .message(message) .build().toSessionID(); return doSend(message, sessionID); } QuickFixJTemplate();  QuickFixJTemplate(SessionLookupHandler sessionLookupHandler); void setSessionLookupHandler(SessionLookupHandler sessionLookupHandler); void setDoValidation(boolean doValidation); @Override boolean send(Message message); @Override boolean send(Message message, String qualifier); @Override boolean send(Message message, String senderCompID, String targetCompID); @Override boolean send(Message message, String senderCompID, String targetCompID, String qualifier); @Override boolean send(Message message, SessionID sessionID); }
QuickFixJTemplate implements QuickFixJOperations { @Override public boolean send(Message message) { Assert.notNull(message, "'message' must not be null"); SessionID sessionID = QuickFixJSessionID.quickFixJSessionIDBuilder() .message(message) .build().toSessionID(); return doSend(message, sessionID); } QuickFixJTemplate();  QuickFixJTemplate(SessionLookupHandler sessionLookupHandler); void setSessionLookupHandler(SessionLookupHandler sessionLookupHandler); void setDoValidation(boolean doValidation); @Override boolean send(Message message); @Override boolean send(Message message, String qualifier); @Override boolean send(Message message, String senderCompID, String targetCompID); @Override boolean send(Message message, String senderCompID, String targetCompID, String qualifier); @Override boolean send(Message message, SessionID sessionID);  }