use of quickfix.field.SenderLocationID in project wso2-synapse by wso2.
the class FIXTransportSenderTest method testIsTargetValid.
@Test
public void testIsTargetValid() throws Exception {
Map<String, String> fieldValues = new HashMap<>();
fieldValues.put(FIXConstants.BEGIN_STRING, "FIX.4.1");
fieldValues.put(FIXConstants.DELIVER_TO_COMP_ID, "SYNAPSE");
fieldValues.put(FIXConstants.DELIVER_TO_SUB_ID, "sy");
fieldValues.put(FIXConstants.DELIVER_TO_LOCATION_ID, "randomLoc");
SessionID id = new SessionID(new BeginString("FIX.4.1"), new SenderCompID("BANZAI"), new SenderSubID("ba"), new SenderLocationID("senderLoc"), new TargetCompID("SYNAPSE"), new TargetSubID("sy"), new TargetLocationID("randomLoc"), "FIX.4.1:SYNAPSE->BANZAI");
FIXTransportSender sender = new FIXTransportSender();
Class senderClass = sender.getClass();
Method isTargetvalid = senderClass.getDeclaredMethod("isTargetValid", Map.class, SessionID.class, boolean.class);
isTargetvalid.setAccessible(true);
Object result = isTargetvalid.invoke(senderClass.newInstance(), fieldValues, id, true);
Assert.assertEquals("Invalid target!", "true", result.toString());
}
Aggregations