use of com.epam.ta.reportportal.database.dao.ProjectRepository in project commons-dao by reportportal.
the class PersonalProjectServiceTest method mockProjectRepo.
private ProjectRepository mockProjectRepo() {
ProjectRepository repo = Mockito.mock(ProjectRepository.class);
when(repo.exists(Mockito.anyString())).thenReturn(false);
return repo;
}
use of com.epam.ta.reportportal.database.dao.ProjectRepository in project commons-dao by reportportal.
the class PersonalProjectServiceTest method personalProjectNameExisting.
@Test
public void personalProjectNameExisting() throws Exception {
ProjectRepository repo = Mockito.mock(ProjectRepository.class);
String userName = "John";
when(repo.exists(Mockito.anyString())).then(invocation -> "john_personal".equals(invocation.getArguments()[0]));
Assert.assertThat("Generated personal space name is incorrect", new PersonalProjectService(repo).generatePersonalProjectName(userName), Matchers.is("john_personal_1".toLowerCase()));
}
Aggregations