@PostMapping(value = "/task", consumes = "application/json", produces = "application/json")
    @ResponseBody
    @Operation(summary = "start a perform scheduled task")
    public ResponseEntity<Map<String, Object>> performScheduleTask(final @RequestBody ScheduledTask task) {
       if (RESENT_TASK_NAME.equals(task.getIapi().get("name"))) {
            afnemersindicatieService.resendUnsentMessages();
        }

        return ResponseEntity.ok(Map.of("status", "OK"));
    }
@Test
    void testResendWithApv01(){
        when(afnemersbericht.getType()).thenReturn(Afnemersbericht.Type.Av01);
        List<Afnemersbericht> afnemersberichten = Arrays.asList(afnemersbericht);
        when(afnemersberichtRepository.findByStatus(Afnemersbericht.Status.SEND_FAILED)).thenReturn(afnemersberichten);

        classUnderTest.performScheduleTask(new ScheduledTask(RESENT_TASK_NAME));

        verify(dglSendServiceMock, times(1)).sendAfnemersBerichtAanDGL(any(), any());
        verify(afnemersberichtRepository, times(1)).delete(afnemersbericht);
    }