/** * <em>Test Case #2 </em> * * <p>Checka non-existent mailbox. * * <pre> * Input Data: * >S XMDUZ=9999999 * * Procedure Call: * >D TNMSGCT^XMWSOA07(.RETURN,XMDUZ) * * Expected Output: * * >ZW RETURN * RETURN="-1^User's mailbox doesn't exist" * * </pre> */ @Test public void testTnmsgct002() throws VistaWebServiceFault { String expectedOutput = "-1^User's mailbox doesn't exist"; XMXUTILTnmsgctRequest request = new XMXUTILTnmsgctRequest("9999999"); when(this.getVistaLinkContext().makeRPCCall(new RPCIdentifier(""), null)) .thenReturn(expectedOutput); XMXUTILTnmsgctEndpoint service = new XMXUTILTnmsgctEndpointImpl(getVistaLinkContext(), new XMXUTILResponseFactory()); XMXUTILTnmsgctResponse response = service.tnmsgct(request); assertNotNull(response); assertEquals("User's mailbox doesn't exist", response.getMsgRoot().get(1)); }
/** * <em>Test Case #1 </em> * * <p>Check a user’s mailbox. * * <pre> * Input Data: * >S XMDUZ=.5 * * Procedure Call: * >D TNMSGCT^XMWSOA07(.RETURN,XMDUZ) * * Expected Output: * >ZW RETURN * RETURN=2206 * * </pre> */ @Test public void testTnmsgct001() throws VistaWebServiceFault { String expectedOutput = "2206"; XMXUTILTnmsgctRequest request = new XMXUTILTnmsgctRequest(".5"); when(this.getVistaLinkContext().makeRPCCall(new RPCIdentifier(""), null)) .thenReturn(expectedOutput); XMXUTILTnmsgctEndpoint service = new XMXUTILTnmsgctEndpointImpl(getVistaLinkContext(), new XMXUTILResponseFactory()); XMXUTILTnmsgctResponse response = service.tnmsgct(request); assertNotNull(response); assertEquals(expectedOutput, response.getTotNumOfNewMsgs()); }