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);
}
Aggregations