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 penRequestAllowedWithValidPreviousRequests() 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(2018, 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);

        Map<String, String> result = service.penRequestAllowed(request);
        Map<String, String> expectedMap  = new HashMap<String, String>() {{
            put("status", "OK");
        }};
        assertEquals(expectedMap, result);
    }