use of com.epam.ta.reportportal.database.entity.Project in project commons-dao by reportportal.
the class ProjectRepositoryTest method testAddNewMetadataPostfix.
@Test
public void testAddNewMetadataPostfix() {
String projectName = "metadata_test";
Project p = new Project();
p.setName(projectName);
projectRepository.save(p);
projectRepository.addDemoDataPostfix(projectName, "metadataPostfix");
List<String> postfixes = projectRepository.findOne(projectName).getMetadata().getDemoDataPostfix();
Assert.assertThat("Exception during saving demo data postfix", postfixes, CoreMatchers.hasItem("metadataPostfix"));
}
use of com.epam.ta.reportportal.database.entity.Project in project commons-dao by reportportal.
the class ProjectUtilsTest method project.
private Project project() {
final Project project = new Project();
final Project.Configuration configuration = new Project.Configuration();
final ProjectEmailConfig emailConfig = new ProjectEmailConfig();
emailConfig.setEmailCases(singletonList(new EmailSenderCase(asList("user1", "user1@fake.com", "user2@fake.com", aliveUser), "ALWAYS", asList("launch"), asList("tag"))));
configuration.setEmailConfig(emailConfig);
project.setConfiguration(configuration);
return project;
}
use of com.epam.ta.reportportal.database.entity.Project in project commons-dao by reportportal.
the class PersonalProjectServiceTest method generatePersonalProject.
@Test
public void generatePersonalProject() throws Exception {
User user = new User();
String login = "johnny";
user.setLogin(login);
user.setFullName("John");
Project project = new PersonalProjectService(mockProjectRepo()).generatePersonalProject(user);
Project.UserConfig userConfig = project.getUsers().stream().filter(it -> login.equals(it.getLogin())).findFirst().get();
Assert.assertThat("Project doesn't have user", userConfig.getLogin(), Matchers.equalTo(login));
Assert.assertThat("Incorrect role", userConfig.getProjectRole(), Matchers.is(ProjectRole.PROJECT_MANAGER));
Assert.assertThat("Incorrect role", userConfig.getProposedRole(), Matchers.is(ProjectRole.PROJECT_MANAGER));
Assert.assertThat("Incorrect date", project.getCreationDate(), Matchers.notNullValue());
Assert.assertThat("Incorrect configuration", project.getConfiguration(), Matchers.notNullValue());
Assert.assertThat("Incorrect additional info", project.getAddInfo(), Matchers.notNullValue());
}
Aggregations