public Map<String, String> penRequestAllowed(PenRequest request) throws PenRequestException, SharedServiceClientException {
        final List<PenRequestStatus> result = repository.findByBsnAndDocTypeAndSequenceNo(request.getBsn(), request.getDocType(), request.getSequenceNo());
        checkIfTooSoonOrTooOften(result);
        return statusOK;
    }
@Test
    public void penRequestTooOftenThrowsDWS2Exception() throws PenRequestException, SharedServiceClientException {
        // create three penRequests with a RequestDateTime, 24 hours apart
        PenRequestStatus firstStatus = new PenRequestStatus();
        firstStatus.setRequestDatetime(LocalDateTime.of(2019, 1, 1, 00, 01));
        mockStatusList.add(firstStatus);

        PenRequestStatus secondStatus= new PenRequestStatus();
        secondStatus.setRequestDatetime(LocalDateTime.of(2019, 1, 2, 00, 01));
        mockStatusList.add(secondStatus);

        PenRequestStatus thirdStatus= new PenRequestStatus();
        thirdStatus.setRequestDatetime(LocalDateTime.of(2019, 1, 3, 00, 01));
        mockStatusList.add(thirdStatus);

        // return arraylist with one dummy penrequest
        Mockito.when(mockRepository.findByBsnAndDocTypeAndSequenceNo(request.getBsn(), request.getDocType(), request.getSequenceNo())).thenReturn(mockStatusList);

        Exception exception = assertThrows(PenRequestException.class, () -> {
            service.penRequestAllowed(request);
        });
        assertEquals("DWS2", exception.getMessage());
    }