AsyncMessageProcessHelper { public boolean addPatientDiscoveryRequest(final PRPAIN201305UV02 request, final AssertionType assertion, final String direction) { LOG.debug("Begin AsyncMessageProcessHelper.addPatientDiscoveryRequest(assertion)..."); final RespondingGatewayPRPAIN201305UV02RequestType newRequest = new RespondingGatewayPRPAIN201305UV02RequestType(); newRequest.setAssertion(assertion); newRequest.setPRPAIN201305UV02(request); LOG.debug("End AsyncMessageProcessHelper.addPatientDiscoveryRequest(assertion)..."); return addPatientDiscoveryRequest(newRequest, direction); }  boolean addPatientDiscoveryRequest(final PRPAIN201305UV02 request, final AssertionType assertion,
            final String direction); boolean addPatientDiscoveryRequest(final RespondingGatewayPRPAIN201305UV02RequestType request,
            final String direction); boolean processAck(final String messageId, String newStatus, final String errorStatus,
            final MCCIIN000002UV01 ack); boolean processMessageStatus(final String messageId, final String newStatus); boolean processPatientDiscoveryResponse(final String messageId, String newStatus, final String errorStatus,
            final RespondingGatewayPRPAIN201306UV02RequestType response); AssertionType copyAssertionTypeObject(final AssertionType orig); String marshalAssertionTypeObject(final AssertionType assertion);  }
@Test public void testAddPatientDiscoveryRequest() { PRPAIN201305UV02 request = new PRPAIN201305UV02(); AssertionType assertion = new AssertionType(); try { context.checking(new Expectations() { { exactly(2).of(mockDao).insertRecords(with(any(List.class))); will(returnValue(true)); } }); AsyncMessageProcessHelper asyncHelper = createAsyncMessageProcessHelper(); boolean result = asyncHelper.addPatientDiscoveryRequest(request, assertion, "INBOUND"); assertTrue(result); result = asyncHelper.addPatientDiscoveryRequest(request, assertion, "OUTBOUND"); assertTrue(result); } catch (Exception e) { e.printStackTrace(); fail("Error running testAddPatientDiscoveryRequest: " + e.getMessage()); } }