Search in sources :

Example 1 with UpdatePatternTemplateRQ

use of com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ in project service-api by reportportal.

the class ProjectSettingsControllerTest method updatePatternTemplateWithDuplicateName.

@Test
void updatePatternTemplateWithDuplicateName() throws Exception {
    UpdatePatternTemplateRQ updatePatternTemplateRQ = new UpdatePatternTemplateRQ();
    updatePatternTemplateRQ.setName("some_name");
    updatePatternTemplateRQ.setEnabled(true);
    mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/settings/pattern/2").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(updatePatternTemplateRQ))).andExpect(status().isConflict());
}
Also used : UpdatePatternTemplateRQ(com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 2 with UpdatePatternTemplateRQ

use of com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ in project service-api by reportportal.

the class ProjectSettingsControllerTest method updatePatternTemplateWithTheSameName.

@Test
void updatePatternTemplateWithTheSameName() throws Exception {
    UpdatePatternTemplateRQ updatePatternTemplateRQ = new UpdatePatternTemplateRQ();
    updatePatternTemplateRQ.setName("some_name");
    updatePatternTemplateRQ.setEnabled(true);
    mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/settings/pattern/1").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(updatePatternTemplateRQ))).andExpect(status().isOk());
}
Also used : UpdatePatternTemplateRQ(com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 3 with UpdatePatternTemplateRQ

use of com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ in project service-api by reportportal.

the class ProjectSettingsControllerTest method updatePatternTemplate.

@Test
void updatePatternTemplate() throws Exception {
    UpdatePatternTemplateRQ updatePatternTemplateRQ = new UpdatePatternTemplateRQ();
    updatePatternTemplateRQ.setName("another_name");
    updatePatternTemplateRQ.setEnabled(true);
    mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/settings/pattern/1").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(updatePatternTemplateRQ))).andExpect(status().isOk());
}
Also used : UpdatePatternTemplateRQ(com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)3 UpdatePatternTemplateRQ (com.epam.ta.reportportal.ws.model.project.config.pattern.UpdatePatternTemplateRQ)3 Test (org.junit.jupiter.api.Test)3