@Test
public void createApplicationForUser() {

    // given
    var expectedComment = "A nice Comment!";
    var expectedDate = LocalDateTime.now(clock);
    var expectedApplication = new ProjectApplication(projectMock, expectedComment, userMock, expectedDate);
    given(applicationRepoMock.existsByUserAndProject(userMock, projectMock)).willReturn(false);
    given(projectServiceMock.getProjectById(PROJECT_ID)).willReturn(projectMock);
    given(applicationRepoMock.existsByUserAndProject(userMock, projectMock)).willReturn(false);
    given(applicationRepoMock.save(expectedApplication)).willReturn(expectedApplication);
    given(projectMock.getStatus()).willReturn(APPLICATION_ALOWED_STATUS);
    // when
    var actualApplication = applicationService.createApplicationForUser(userMock, PROJECT_ID, expectedComment);
    // then
    assertThat(actualApplication).isEqualTo(expectedApplication);
    verify(applicationRepoMock).save(actualApplication);
    verify(applicationEventHandlerMock).onApplicationReceived(expectedApplication);
}