AbstractService implements EgovIntegrationService { public EgovIntegrationMessage sendSync(EgovIntegrationMessage requestMessage) { LOGGER.debug("sendSync called without timeout"); if (requestMessage == null) { LOGGER.error("requestMessage is null"); throw new IllegalArgumentException(); } LOGGER.debug("call sendSync with defauleTimeout"); return sendSync(requestMessage, defaultTimeout); } AbstractService(String id, long defaultTimeout); long getDefaultTimeout(); String getId(); EgovIntegrationServiceResponse sendAsync(
			final EgovIntegrationMessage requestMessage); void sendAsync(final EgovIntegrationMessage requestMessage,
			EgovIntegrationServiceCallback callback); EgovIntegrationMessage sendSync(EgovIntegrationMessage requestMessage); EgovIntegrationMessage sendSync(
			EgovIntegrationMessage requestMessage, long timeout);  }
@Test public void testSendSyncSucceeds() throws Exception { EgovIntegrationMessage responseMessage = echoService.sendSync(requestMessage); assertEquals(requestMessage, responseMessage); }
@Test public void testSendSyncWithTimeoutSucceeds() throws Exception { EgovIntegrationMessage responseMessage = echoService.sendSync(requestMessage, TIMEOUT_WILL_SUCCEED); assertEquals(requestMessage, responseMessage); }
@Test public void testSendSyncTimedOut() throws Exception { EgovIntegrationMessage responseMessage = echoService.sendSync(requestMessage, TIMEOUT_WILL_BE_TIMED_OUT); assertEquals(ResultCode.TIME_OUT, responseMessage.getHeader().getResultCode()); }