use of com.epam.ta.reportportal.ws.model.project.config.ProjectConfigurationUpdate in project service-api by reportportal.
the class ProjectControllerTest method updateProjectConfigKeepScreenshotsNegativeTest.
@Test
void updateProjectConfigKeepScreenshotsNegativeTest() throws Exception {
UpdateProjectRQ rq = new UpdateProjectRQ();
ProjectConfigurationUpdate configuration = new ProjectConfigurationUpdate();
HashMap<String, String> projectAttributes = new HashMap<>();
projectAttributes.put("notifications.enabled", "false");
projectAttributes.put("job.keepScreenshots", "123123.2");
configuration.setProjectAttributes(projectAttributes);
rq.setConfiguration(configuration);
HashMap<String, String> userRoles = new HashMap<>();
userRoles.put("test_user", "PROJECT_MANAGER");
rq.setUserRoles(userRoles);
mockMvc.perform(put("/v1/project/test_project").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.project.config.ProjectConfigurationUpdate in project service-api by reportportal.
the class ProjectControllerTest method updateProjectConfigKeepLogsNegativeTest.
@Test
void updateProjectConfigKeepLogsNegativeTest() throws Exception {
UpdateProjectRQ rq = new UpdateProjectRQ();
ProjectConfigurationUpdate configuration = new ProjectConfigurationUpdate();
HashMap<String, String> projectAttributes = new HashMap<>();
projectAttributes.put("notifications.enabled", "false");
projectAttributes.put("job.keepLogs", "110000d");
configuration.setProjectAttributes(projectAttributes);
rq.setConfiguration(configuration);
HashMap<String, String> userRoles = new HashMap<>();
userRoles.put("test_user", "PROJECT_MANAGER");
rq.setUserRoles(userRoles);
mockMvc.perform(put("/v1/project/test_project").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.project.config.ProjectConfigurationUpdate in project service-api by reportportal.
the class ProjectControllerTest method updateProjectNegativeWithWrongBounds.
@Test
void updateProjectNegativeWithWrongBounds() throws Exception {
final UpdateProjectRQ rq = new UpdateProjectRQ();
ProjectConfigurationUpdate configuration = new ProjectConfigurationUpdate();
HashMap<String, String> projectAttributes = new HashMap<>();
projectAttributes.put("notifications.enabled", "false");
// 2 weeks in seconds
projectAttributes.put("job.keepLaunches", String.valueOf(3600 * 24 * 14));
// 2 weeks in seconds
projectAttributes.put("job.keepLogs", String.valueOf(3600 * 24 * 14));
// 1 week in seconds
projectAttributes.put("job.interruptJobTime", String.valueOf(3600 * 24 * 7));
// 3 weeks in seconds
projectAttributes.put("job.keepScreenshots", String.valueOf(3600 * 24 * 21));
projectAttributes.put("analyzer.autoAnalyzerMode", "CURRENT_LAUNCH");
projectAttributes.put("analyzer.minShouldMatch", "5");
projectAttributes.put("analyzer.numberOfLogLines", "5");
projectAttributes.put("analyzer.isAutoAnalyzerEnabled", "false");
configuration.setProjectAttributes(projectAttributes);
rq.setConfiguration(configuration);
HashMap<String, String> userRoles = new HashMap<>();
userRoles.put("test_user", "PROJECT_MANAGER");
rq.setUserRoles(userRoles);
mockMvc.perform(put("/v1/project/test_project").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isBadRequest());
}
Aggregations