Search in sources :

Example 1 with PatternTemplateBuilder

use of com.epam.ta.reportportal.ws.converter.builders.PatternTemplateBuilder in project service-api by reportportal.

the class CreatePatternTemplateHandlerImpl method createPatternTemplate.

@Override
public PatternTemplate createPatternTemplate(Long projectId, CreatePatternTemplateRQ createPatternTemplateRQ) {
    final String name = StringUtils.trim(createPatternTemplateRQ.getName());
    BusinessRule.expect(patternTemplateRepository.existsByProjectIdAndNameIgnoreCase(projectId, name), equalTo(false)).verify(ErrorType.RESOURCE_ALREADY_EXISTS, name);
    PatternTemplate patternTemplate = new PatternTemplateBuilder().withCreateRequest(createPatternTemplateRQ).withName(name).withProjectId(projectId).get();
    return patternTemplateRepository.save(patternTemplate);
}
Also used : PatternTemplate(com.epam.ta.reportportal.entity.pattern.PatternTemplate) PatternTemplateBuilder(com.epam.ta.reportportal.ws.converter.builders.PatternTemplateBuilder)

Aggregations

PatternTemplate (com.epam.ta.reportportal.entity.pattern.PatternTemplate)1 PatternTemplateBuilder (com.epam.ta.reportportal.ws.converter.builders.PatternTemplateBuilder)1