Search in sources :

Example 1 with ProjectNotificationConfigDTO

use of com.epam.ta.reportportal.ws.model.project.email.ProjectNotificationConfigDTO in project service-api by reportportal.

the class ProjectControllerTest method updateProjectNotificationConfig.

@Test
void updateProjectNotificationConfig() throws Exception {
    ProjectNotificationConfigDTO request = new ProjectNotificationConfigDTO();
    SenderCaseDTO senderCaseDTO = new SenderCaseDTO();
    senderCaseDTO.setSendCase("always");
    senderCaseDTO.setRecipients(Collections.singletonList("default"));
    senderCaseDTO.setLaunchNames(Collections.singletonList("test launch"));
    senderCaseDTO.setEnabled(true);
    ItemAttributeResource launchAttribute = new ItemAttributeResource();
    launchAttribute.setKey("key");
    launchAttribute.setValue("val");
    senderCaseDTO.setAttributes(Sets.newHashSet(launchAttribute));
    request.setSenderCases(singletonList(senderCaseDTO));
    mockMvc.perform(put("/v1/project/default_personal/notification").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(request))).andExpect(status().isOk());
}
Also used : ItemAttributeResource(com.epam.ta.reportportal.ws.model.attribute.ItemAttributeResource) ProjectNotificationConfigDTO(com.epam.ta.reportportal.ws.model.project.email.ProjectNotificationConfigDTO) SenderCaseDTO(com.epam.ta.reportportal.ws.model.project.email.SenderCaseDTO) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)1 ItemAttributeResource (com.epam.ta.reportportal.ws.model.attribute.ItemAttributeResource)1 ProjectNotificationConfigDTO (com.epam.ta.reportportal.ws.model.project.email.ProjectNotificationConfigDTO)1 SenderCaseDTO (com.epam.ta.reportportal.ws.model.project.email.SenderCaseDTO)1 Test (org.junit.jupiter.api.Test)1