@Test
public void createApplicationForUserThrowsExceptionWhenStatusForbidsApplications() {

    // given
    given(projectServiceMock.getProjectById(PROJECT_ID)).willReturn(projectMock);
    given(projectMock.getStatus()).willReturn(APPLICATION_FORBIDDEN_STATUS);
    // when
    assertThatThrownBy(() -> applicationService.createApplicationForUser(userMock, PROJECT_ID, ""))
            .isInstanceOf(ProjectStatusPreventsApplicationException.class);
}