use of com.epam.ta.reportportal.ws.model.project.config.pattern.CreatePatternTemplateRQ in project service-api by reportportal.
the class ProjectSettingsControllerTest method createPatternTemplateWithDuplicateName.
@Test
void createPatternTemplateWithDuplicateName() throws Exception {
CreatePatternTemplateRQ createPatternTemplateRQ = new CreatePatternTemplateRQ();
createPatternTemplateRQ.setEnabled(true);
createPatternTemplateRQ.setName("some_name");
createPatternTemplateRQ.setType("string");
createPatternTemplateRQ.setValue("qwe");
mockMvc.perform(post(DEFAULT_PROJECT_BASE_URL + "/settings/pattern").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(createPatternTemplateRQ))).andExpect(status().isConflict());
}
use of com.epam.ta.reportportal.ws.model.project.config.pattern.CreatePatternTemplateRQ in project service-api by reportportal.
the class ProjectSettingsControllerTest method createPatternTemplate.
@Test
void createPatternTemplate() throws Exception {
CreatePatternTemplateRQ createPatternTemplateRQ = new CreatePatternTemplateRQ();
createPatternTemplateRQ.setEnabled(true);
createPatternTemplateRQ.setName("another_name");
createPatternTemplateRQ.setType("string");
createPatternTemplateRQ.setValue("qwe");
mockMvc.perform(post(DEFAULT_PROJECT_BASE_URL + "/settings/pattern").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(createPatternTemplateRQ))).andExpect(status().isCreated());
}
use of com.epam.ta.reportportal.ws.model.project.config.pattern.CreatePatternTemplateRQ in project service-api by reportportal.
the class ProjectSettingsControllerTest method createPatternTemplateWithWrongType.
@Test
void createPatternTemplateWithWrongType() throws Exception {
CreatePatternTemplateRQ createPatternTemplateRQ = new CreatePatternTemplateRQ();
createPatternTemplateRQ.setEnabled(true);
createPatternTemplateRQ.setName("name");
createPatternTemplateRQ.setType("dd");
createPatternTemplateRQ.setValue("qwe");
mockMvc.perform(post(DEFAULT_PROJECT_BASE_URL + "/settings/pattern").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(createPatternTemplateRQ))).andExpect(status().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.project.config.pattern.CreatePatternTemplateRQ in project service-api by reportportal.
the class PatternTemplateBuilderTest method patternTemplateBuilder.
@Test
void patternTemplateBuilder() {
CreatePatternTemplateRQ createPatternTemplateRQ = new CreatePatternTemplateRQ();
String name = "name";
String type = "STRING";
boolean enabled = true;
String value = "qwe";
createPatternTemplateRQ.setName(name);
createPatternTemplateRQ.setType(type);
createPatternTemplateRQ.setEnabled(enabled);
createPatternTemplateRQ.setValue(value);
PatternTemplate patternTemplate = new PatternTemplateBuilder().withCreateRequest(createPatternTemplateRQ).get();
assertEquals(name, patternTemplate.getName());
assertEquals(type, patternTemplate.getTemplateType().name());
assertEquals(enabled, patternTemplate.isEnabled());
assertEquals(value, patternTemplate.getValue());
}
Aggregations