@Test
public void giveUserAccessUntilCreatesAccessWhenUserHasNoAccessInstance() {

    // given
    var expectedStartTime = LocalDateTime.now(clock);
    var expectedEndTime = LocalDateTime.now(clock).plus(10L , ChronoUnit.DAYS);
    given(userMock.getLatestAccessInterval()).willReturn(Optional.empty());
    given(userService.save(userMock)).willReturn(userMock);
    // when
    var actualUser = accessService.giveUserAccessUntil(userMock, expectedEndTime);
    // then
    assertThat(actualUser).isEqualTo(userMock);
    var accessInfoArgumentCaptor = ArgumentCaptor.forClass(AccessInterval.class);
    verify(userMock, times(2)).addAccessInterval(accessInfoArgumentCaptor.capture());
    var createdAccessInterval = accessInfoArgumentCaptor.getValue();
    var softly = new SoftAssertions();
    softly.assertThat(createdAccessInterval.getUser()).isEqualTo(userMock);
    softly.assertThat(createdAccessInterval.getStartTime()).isEqualTo(expectedStartTime);
    softly.assertThat(createdAccessInterval.getEndTime()).isEqualTo(expectedEndTime);
    softly.assertAll();
    verify(userService).save(userMock);
    verify(userAccessEventHandlerMock).onAccessCreated(userMock, createdAccessInterval);
}