### Question:
SMSMessagingServiceImpl implements MobileMessagingService { @Transactional public void scheduleMessage(GatewayRequest gatewayRequest) { cache.saveMessage(gatewayRequest.getGatewayRequestDetails()); }  @Transactional void scheduleMessage(GatewayRequest gatewayRequest); @Transactional void scheduleMessage(GatewayRequestDetails gatewayRequestDetails); @Transactional void scheduleTransactionalMessage(GatewayRequest gatewayRequest); @Transactional(readOnly = true) void sendScheduledMessages(); Map<Boolean, Set<GatewayResponse>> sendTransactionalMessage(GatewayRequest gatewayRequest); @Transactional Map<Boolean, Set<GatewayResponse>> sendMessage(GatewayRequest gatewayRequest); @Transactional(readOnly = true) void updateMessageStatuses(); CacheService getCache(); void setCache(CacheService cache); GatewayManager getGatewayManager(); void setGatewayManager(GatewayManager gatewayManager); CoreManager getCoreManager(); void setCoreManager(CoreManager coreManager); SMSMessagingServiceWorker getWorker(); void setWorker(SMSMessagingServiceWorker worker);  }### Answer:
@Test public void testScheduleMessage() { System.out.println("scheduleMessage"); GatewayRequest messageDetails = new GatewayRequestImpl(); messageDetails.setDateFrom(new Date()); messageDetails.setMessage("a message for testing"); messageDetails.setDateTo(new Date()); messageDetails.setRecipientsNumber("000000000000"); messageDetails.setGatewayRequestDetails(mockGatewayRequestDetails); mockCache.saveMessage((GatewayRequestDetails) anyObject()); expectLastCall(); replay(mockCache); instance.scheduleMessage(messageDetails); verify(mockCache); }