@Test
public void testProcessScheduledMessageSuccess() {

    final ProtocolResponseMessage message = new ProtocolResponseMessage.Builder()
            .deviceMessageMetadata(DEVICE_MESSAGE_DATA)
            .domain(DOMAIN)
            .domainVersion(DOMAIN_VERSION)
            .result(ResponseMessageResultType.OK)
            .dataObject(DATA_OBJECT)
            .scheduled(true)
            .build();
    final ScheduledTask scheduledTask = new ScheduledTask(DEVICE_MESSAGE_DATA, DOMAIN, DOMAIN, DATA_OBJECT,
            SCHEDULED_TIME);
    scheduledTask.setPending();
    when(this.scheduledTaskService.findByCorrelationUid(anyString())).thenReturn(scheduledTask);
    this.deviceResponseMessageService.processMessage(message);
    // check if message is send and task is deleted
    verify(this.domainResponseMessageSender).send(message);
    verify(this.scheduledTaskService).deleteScheduledTask(scheduledTask);
}