Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,15 @@ repositories {
}
}

dependencyManagement {
imports {
mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.epam.reportportal:commons-bom:5.13.2')
}
}

ext['spring-boot.version'] = "${springBootVersion}"

dependencies {
if (releaseMode) {
implementation 'com.epam.reportportal:commons-dao'
implementation 'com.epam.reportportal:plugin-api'
annotationProcessor 'com.epam.reportportal:plugin-api'
implementation 'com.epam.reportportal:service-api'
annotationProcessor 'com.epam.reportportal:service-api'
} else {
implementation 'com.github.reportportal:commons-dao:196d4ac'
implementation 'com.github.reportportal:plugin-api:9bd040f'
annotationProcessor 'com.github.reportportal:plugin-api:9bd040f'
implementation 'com.github.reportportal:service-api:3e34a90'
annotationProcessor 'com.github.reportportal:service-api:3e34a90'
}

compileOnly "org.projectlombok:lombok:${lombokVersion}"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version=1.1.0
description=EPAM Report Portal. Telegram plugin.
pluginId=telegram
lombokVersion=1.18.36
springBootVersion=3.4.2
lombokVersion=1.18.42
springBootVersion=3.4.11
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* @author Andrei Piankouski
*/
public class TelegramPlugin extends Plugin {
/**
* Constructor to be used by plugin manager for plugin instantiation.
* Your plugins have to provide constructor with this exact signature to
* be successfully loaded by manager.
*
* @param wrapper - A wrapper over plugin instance.
*/
public TelegramPlugin(PluginWrapper wrapper) {
super(wrapper);
}

/**
* Constructor to be used by plugin manager for plugin instantiation. Your plugins have to provide constructor with
* this exact signature to be successfully loaded by manager.
*
* @param wrapper - A wrapper over plugin instance.
*/
public TelegramPlugin(PluginWrapper wrapper) {
super(wrapper);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@
import com.epam.reportportal.extension.telegram.factory.PropertyCollectorFactory;
import com.epam.reportportal.extension.telegram.info.impl.PluginInfoProviderImpl;
import com.epam.reportportal.extension.telegram.utils.MemoizingSupplier;
import com.epam.ta.reportportal.dao.IntegrationRepository;
import com.epam.ta.reportportal.dao.IntegrationTypeRepository;
import com.epam.ta.reportportal.dao.LaunchRepository;
import com.epam.ta.reportportal.dao.ProjectRepository;
import com.epam.ta.reportportal.dao.TestItemRepository;
import com.epam.reportportal.infrastructure.persistence.dao.IntegrationRepository;
import com.epam.reportportal.infrastructure.persistence.dao.IntegrationTypeRepository;
import com.epam.reportportal.infrastructure.persistence.dao.LaunchRepository;
import com.epam.reportportal.infrastructure.persistence.dao.ProjectRepository;
import com.epam.reportportal.infrastructure.persistence.dao.TestItemRepository;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import jakarta.annotation.PostConstruct;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -51,18 +52,15 @@
import java.util.Map;
import java.util.function.Supplier;
import java.util.stream.Stream;
import jakarta.annotation.PostConstruct;
import javax.sql.DataSource;
import org.pf4j.Extension;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.web.client.RestTemplate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import com.epam.reportportal.extension.telegram.collector.PropertyCollector;
import com.epam.reportportal.extension.telegram.model.enums.template.DefaultTemplateProperty;
import com.epam.ta.reportportal.entity.ItemAttribute;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.ItemAttribute;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;

public class AttributesCollector implements PropertyCollector<Launch, DefaultTemplateProperty> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import com.epam.reportportal.extension.telegram.collector.PropertyCollector;
import com.epam.reportportal.extension.telegram.model.enums.template.DefaultTemplateProperty;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import com.google.common.collect.ImmutableMap;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/
package com.epam.reportportal.extension.telegram.collector.laucnh;

import static com.epam.ta.reportportal.entity.enums.StatusEnum.FAILED;
import static com.epam.ta.reportportal.entity.enums.StatusEnum.INTERRUPTED;
import static com.epam.ta.reportportal.entity.enums.StatusEnum.PASSED;
import static com.epam.reportportal.infrastructure.persistence.entity.enums.StatusEnum.FAILED;
import static com.epam.reportportal.infrastructure.persistence.entity.enums.StatusEnum.INTERRUPTED;
import static com.epam.reportportal.infrastructure.persistence.entity.enums.StatusEnum.PASSED;

import com.epam.reportportal.extension.telegram.collector.PropertyCollector;
import com.epam.reportportal.extension.telegram.model.enums.template.Color;
import com.epam.reportportal.extension.telegram.model.template.TextProperty;
import com.epam.ta.reportportal.entity.enums.StatusEnum;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.enums.StatusEnum;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import com.epam.reportportal.extension.telegram.collector.PropertyCollector;
import com.epam.reportportal.extension.telegram.model.enums.template.StatisticTemplateProperty;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;

public class StatisticsPropertiesCollector implements PropertyCollector<Launch, StatisticTemplateProperty> {

Expand All @@ -22,8 +22,10 @@ public Map<StatisticTemplateProperty, String> collect(Launch launch) {

ofNullable(launch.getStatistics()).filter(CollectionUtils::isNotEmpty)
.ifPresent(statistics -> statistics.stream()
.filter(s -> properties.containsKey(StatisticTemplateProperty.valueOfByName(s.getStatisticsField().getName())))
.forEach(s -> properties.put(StatisticTemplateProperty.valueOfByName(s.getStatisticsField().getName()), String.valueOf(s.getCounter()))));
.filter(
s -> properties.containsKey(StatisticTemplateProperty.valueOfByName(s.getStatisticsField().getName())))
.forEach(s -> properties.put(StatisticTemplateProperty.valueOfByName(s.getStatisticsField().getName()),
String.valueOf(s.getCounter()))));

return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
*/
public interface EventHandler<T> {

void handle(T event);
void handle(T event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.epam.reportportal.extension.event.PluginEvent;
import com.epam.reportportal.extension.telegram.event.handler.EventHandler;
import com.epam.reportportal.extension.telegram.info.PluginInfoProvider;
import com.epam.ta.reportportal.dao.IntegrationTypeRepository;
import com.epam.reportportal.infrastructure.persistence.dao.IntegrationTypeRepository;

/**
* @author Andrei Piankouski
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import com.epam.reportportal.extension.event.LaunchFinishedPluginEvent;
import com.epam.reportportal.extension.telegram.event.launch.resolver.AttachmentResolver;
import com.epam.reportportal.extension.telegram.event.launch.resolver.SenderCaseMatcher;
import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.dao.LaunchRepository;
import com.epam.ta.reportportal.dao.ProjectRepository;
import com.epam.ta.reportportal.entity.enums.ProjectAttributeEnum;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.ta.reportportal.entity.project.Project;
import com.epam.ta.reportportal.entity.project.ProjectUtils;
import com.epam.ta.reportportal.entity.project.email.SenderCase;
import com.epam.reportportal.infrastructure.persistence.dao.LaunchRepository;
import com.epam.reportportal.infrastructure.persistence.dao.ProjectRepository;
import com.epam.reportportal.infrastructure.persistence.entity.enums.ProjectAttributeEnum;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.project.Project;
import com.epam.reportportal.infrastructure.persistence.entity.project.ProjectUtils;
import com.epam.reportportal.infrastructure.persistence.entity.project.email.SenderCase;
import com.epam.reportportal.infrastructure.rules.exception.ErrorType;
import com.epam.reportportal.infrastructure.rules.exception.ReportPortalException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.epam.reportportal.extension.telegram.model.enums.SlackEventType;
import com.epam.reportportal.extension.telegram.model.template.TemplateProperty;
import com.epam.reportportal.extension.telegram.model.template.TextProperty;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
import static com.epam.reportportal.extension.telegram.model.enums.template.StatisticTemplateProperty.STATISTIC_EXECUTION_TOTAL;

import com.epam.reportportal.extension.telegram.utils.NotificationConfigConverter;
import com.epam.ta.reportportal.dao.TestItemRepository;
import com.epam.ta.reportportal.entity.enums.LogicalOperator;
import com.epam.ta.reportportal.entity.enums.SendCase;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.ta.reportportal.entity.project.email.LaunchAttributeRule;
import com.epam.ta.reportportal.entity.project.email.SenderCase;
import com.epam.ta.reportportal.entity.statistics.Statistics;
import com.epam.ta.reportportal.ws.reporting.ItemAttributeResource;
import com.epam.reportportal.infrastructure.persistence.dao.TestItemRepository;
import com.epam.reportportal.infrastructure.persistence.entity.enums.LogicalOperator;
import com.epam.reportportal.infrastructure.persistence.entity.enums.SendCase;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.project.email.LaunchAttributeRule;
import com.epam.reportportal.infrastructure.persistence.entity.project.email.SenderCase;
import com.epam.reportportal.infrastructure.persistence.entity.statistics.Statistics;
import com.epam.reportportal.reporting.ItemAttributeResource;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;

/**
* @author <a href="mailto:andrei_piankouski@epam.com">Andrei Piankouski</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import com.epam.reportportal.extension.telegram.event.handler.EventHandler;
import com.epam.reportportal.extension.telegram.event.handler.plugin.PluginLoadedEventHandler;
import com.epam.reportportal.extension.telegram.info.PluginInfoProvider;
import com.epam.ta.reportportal.dao.IntegrationTypeRepository;

import com.epam.reportportal.infrastructure.persistence.dao.IntegrationTypeRepository;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -20,7 +19,7 @@ public class PluginEventHandlerFactory implements EventHandlerFactory<PluginEven
private final Map<String, EventHandler<PluginEvent>> eventHandlerMapping;

public PluginEventHandlerFactory(IntegrationTypeRepository integrationTypeRepository,
PluginInfoProvider pluginInfoProvider) {
PluginInfoProvider pluginInfoProvider) {
this.eventHandlerMapping = new HashMap<>();
this.eventHandlerMapping.put(LOAD_KEY,
new PluginLoadedEventHandler(integrationTypeRepository, pluginInfoProvider)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.epam.reportportal.extension.telegram.event.plugin;

import static java.util.Optional.ofNullable;

import com.epam.reportportal.extension.event.PluginEvent;
import com.epam.reportportal.extension.telegram.event.EventHandlerFactory;
import org.springframework.context.ApplicationListener;

import static java.util.Optional.ofNullable;

/**
* @author Andrei Piankouski
*/
Expand All @@ -22,12 +22,13 @@ public PluginEventListener(String pluginId, EventHandlerFactory<PluginEvent> plu
@Override
public void onApplicationEvent(PluginEvent event) {
if (supports(event)) {
ofNullable(pluginEventEventHandlerFactory.getEventHandler(event.getType())).ifPresent(pluginEventEventHandler -> pluginEventEventHandler
.handle(event));
ofNullable(pluginEventEventHandlerFactory.getEventHandler(event.getType())).ifPresent(
pluginEventEventHandler -> pluginEventEventHandler
.handle(event));
}
}

private boolean supports(PluginEvent event) {
return pluginId.equals(event.getPluginId());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.epam.reportportal.extension.telegram.collector.laucnh.ResultColorCollector;
import com.epam.reportportal.extension.telegram.collector.laucnh.StatisticsPropertiesCollector;
import com.epam.reportportal.extension.telegram.model.template.TemplateProperty;
import com.epam.ta.reportportal.entity.launch.Launch;
import com.epam.reportportal.infrastructure.persistence.entity.launch.Launch;
import java.util.List;

public class PropertyCollectorFactory {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.epam.reportportal.extension.telegram.info;

import com.epam.ta.reportportal.entity.integration.IntegrationType;
import com.epam.reportportal.infrastructure.persistence.entity.integration.IntegrationType;

/**
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import static java.util.Optional.ofNullable;

import com.epam.reportportal.extension.telegram.info.PluginInfoProvider;
import com.epam.reportportal.rules.exception.ErrorType;
import com.epam.reportportal.rules.exception.ReportPortalException;
import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum;
import com.epam.ta.reportportal.entity.integration.IntegrationType;
import com.epam.reportportal.infrastructure.persistence.entity.enums.IntegrationGroupEnum;
import com.epam.reportportal.infrastructure.persistence.entity.integration.IntegrationType;
import com.epam.reportportal.infrastructure.rules.exception.ErrorType;
import com.epam.reportportal.infrastructure.rules.exception.ReportPortalException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static java.util.Optional.ofNullable;

import com.epam.ta.reportportal.entity.integration.Integration;
import com.epam.reportportal.infrastructure.persistence.entity.integration.Integration;
import java.util.Optional;

public enum SlackEventType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static java.util.Optional.ofNullable;

import com.epam.ta.reportportal.entity.integration.Integration;
import com.epam.reportportal.infrastructure.persistence.entity.integration.Integration;
import java.util.Optional;

public enum SlackIntegrationProperties {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum StatisticTemplateProperty implements TemplateProperty {
STATISTIC_EXECUTION_FAILED("statistics$executions$failed"),
STATISTIC_EXECUTION_SKIPPED("statistics$executions$skipped"),
STATISTIC_DEFECTS_PRODUCT_BUG("statistics$defects$product_bug$total"),
STATISTIC_DEFECTS_SYSTEM_ISSUE ("statistics$defects$system_issue$total"),
STATISTIC_DEFECTS_SYSTEM_ISSUE("statistics$defects$system_issue$total"),
STATISTIC_DEFECTS_AUTOMATION_BUG("statistics$defects$automation_bug$total"),
STATISTIC_DEFECTS_NO_DEFECT("statistics$defects$no_defect$total"),
STATISTIC_DEFECTS_TO_INVESTIGATE("statistics$defects$to_investigate$total"),
Expand Down
Loading