From fadf9fae6cf7220cd5f50f03e7f588c9a9c8a64d Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:38:23 +0300 Subject: [PATCH] EPMRPP-90180 update dependencies (Instant time) (#30) --- build.gradle | 9 +++++---- .../gitlab/command/DescriptionBuilderService.java | 6 +++--- .../extension/gitlab/command/GetIssueCommand.java | 9 ++++++--- .../extension/gitlab/command/GetIssuesCommand.java | 8 +++++--- .../extension/gitlab/command/SearchEpicsCommand.java | 8 +++++--- .../extension/gitlab/command/SearchLabelsCommand.java | 9 +++++---- .../gitlab/command/SearchMilestonesCommand.java | 8 +++++--- .../extension/gitlab/command/SearchUsersCommand.java | 8 +++++--- .../event/handler/plugin/PluginLoadedEventHandler.java | 5 ++--- 9 files changed, 41 insertions(+), 29 deletions(-) diff --git a/build.gradle b/build.gradle index 3dc7aa9..47d4383 100644 --- a/build.gradle +++ b/build.gradle @@ -35,10 +35,11 @@ dependencies { implementation 'com.epam.reportportal:plugin-api' annotationProcessor 'com.epam.reportportal:plugin-api' } else { - implementation 'com.github.reportportal:commons-dao:fa04c1f' - implementation 'com.github.reportportal:plugin-api:20ab960' - annotationProcessor 'com.github.reportportal:plugin-api:20ab960' + implementation 'com.github.reportportal:commons-dao:0703b75' + implementation 'com.github.reportportal:plugin-api:3ecb915657' + annotationProcessor 'com.github.reportportal:plugin-api:3ecb915657' } + implementation 'org.hibernate:hibernate-core:5.6.15.Final' implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1' testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0' @@ -127,4 +128,4 @@ task assemblePlugins(type: Copy) { dependsOn subprojects.assemblePlugin } -compileJava.dependsOn npm_run_build \ No newline at end of file +compileJava.dependsOn npm_run_build diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/DescriptionBuilderService.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/DescriptionBuilderService.java index 679a23f..7865347 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/DescriptionBuilderService.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/DescriptionBuilderService.java @@ -16,7 +16,7 @@ package com.epam.reportportal.extension.gitlab.command; -import static com.epam.ta.reportportal.commons.EntityUtils.TO_DATE; +import static com.epam.ta.reportportal.commons.EntityUtils.INSTANT_TO_LDT; import static java.util.Optional.ofNullable; import com.epam.reportportal.extension.gitlab.client.GitlabClient; @@ -159,7 +159,7 @@ private String getFormattedMessage(Log log) { StringBuilder messageBuilder = new StringBuilder(); messageBuilder.append(CODE); ofNullable(log.getLogTime()).ifPresent(logTime -> messageBuilder.append(" Time: ") - .append(dateFormat.format(TO_DATE.apply(logTime))).append(", ")); + .append(dateFormat.format(INSTANT_TO_LDT.apply(logTime))).append(", ")); ofNullable(log.getLogLevel()).ifPresent( logLevel -> messageBuilder.append("Level: ").append(logLevel).append(", ")); messageBuilder.append("Log: ").append(log.getLogMessage()).append(CODE).append("\n\n"); @@ -180,4 +180,4 @@ private void addAttachment(StringBuilder descriptionBuilder, Attachment attachme } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssueCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssueCommand.java index 0e3e7d2..a8569c6 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssueCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssueCommand.java @@ -16,23 +16,26 @@ package com.epam.reportportal.extension.gitlab.command; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.CommonPluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.utils.TicketMapper; import com.epam.reportportal.model.externalsystem.Ticket; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.dao.IntegrationRepository; import com.epam.ta.reportportal.entity.integration.Integration; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.Map; import java.util.Optional; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Andrei Piankouski */ public class GetIssueCommand implements CommonPluginCommand { + private static final Logger LOGGER = LoggerFactory.getLogger(GetIssueCommand.class); + private final String PROJECT_ID = "projectId"; diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssuesCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssuesCommand.java index e764ede..562642d 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssuesCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/GetIssuesCommand.java @@ -17,23 +17,25 @@ package com.epam.reportportal.extension.gitlab.command; import static java.util.Optional.ofNullable; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.PluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClient; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.dto.IssueDto; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Zsolt Nagyaghy */ public class GetIssuesCommand implements PluginCommand> { + private static final Logger LOGGER = LoggerFactory.getLogger(GetIssuesCommand.class); private final GitlabClientProvider gitlabClientProvider; diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchEpicsCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchEpicsCommand.java index 02d3d41..1bd434a 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchEpicsCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchEpicsCommand.java @@ -17,22 +17,24 @@ package com.epam.reportportal.extension.gitlab.command; import static java.util.Optional.ofNullable; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.PluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.dto.EpicDto; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Pavel Bortnik */ public class SearchEpicsCommand implements PluginCommand> { + private static final Logger LOGGER = LoggerFactory.getLogger(SearchEpicsCommand.class); private final GitlabClientProvider gitlabClientProvider; diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchLabelsCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchLabelsCommand.java index 5c26ce3..0a51779 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchLabelsCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchLabelsCommand.java @@ -17,23 +17,24 @@ package com.epam.reportportal.extension.gitlab.command; import static java.util.Optional.ofNullable; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.PluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.dto.LabelDto; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Pavel Bortnik */ public class SearchLabelsCommand implements PluginCommand> { - + private static final Logger LOGGER = LoggerFactory.getLogger(SearchLabelsCommand.class); private final GitlabClientProvider gitlabClientProvider; public SearchLabelsCommand(GitlabClientProvider gitlabClientProvider) { diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchMilestonesCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchMilestonesCommand.java index dfc73ad..55c9d3c 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchMilestonesCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchMilestonesCommand.java @@ -17,22 +17,24 @@ package com.epam.reportportal.extension.gitlab.command; import static java.util.Optional.ofNullable; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.PluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.dto.MilestoneDto; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Pavel Bortnik */ public class SearchMilestonesCommand implements PluginCommand> { + private static final Logger LOGGER = LoggerFactory.getLogger(SearchMilestonesCommand.class); private final GitlabClientProvider gitlabClientProvider; diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchUsersCommand.java b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchUsersCommand.java index 615a220..a29dcef 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchUsersCommand.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/command/SearchUsersCommand.java @@ -17,23 +17,25 @@ package com.epam.reportportal.extension.gitlab.command; import static java.util.Optional.ofNullable; -import static org.hibernate.bytecode.BytecodeLogger.LOGGER; import com.epam.reportportal.extension.PluginCommand; import com.epam.reportportal.extension.gitlab.client.GitlabClientProvider; import com.epam.reportportal.extension.gitlab.dto.UserDto; +import com.epam.reportportal.rules.exception.ErrorType; +import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; -import com.epam.reportportal.rules.exception.ReportPortalException; -import com.epam.reportportal.rules.exception.ErrorType; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Pavel Bortnik */ public class SearchUsersCommand implements PluginCommand> { + private static final Logger LOGGER = LoggerFactory.getLogger(SearchUsersCommand.class); private final GitlabClientProvider gitlabClientProvider; public SearchUsersCommand(GitlabClientProvider gitlabClientProvider) { diff --git a/src/main/java/com/epam/reportportal/extension/gitlab/event/handler/plugin/PluginLoadedEventHandler.java b/src/main/java/com/epam/reportportal/extension/gitlab/event/handler/plugin/PluginLoadedEventHandler.java index ccbf531..9e30e9a 100644 --- a/src/main/java/com/epam/reportportal/extension/gitlab/event/handler/plugin/PluginLoadedEventHandler.java +++ b/src/main/java/com/epam/reportportal/extension/gitlab/event/handler/plugin/PluginLoadedEventHandler.java @@ -23,8 +23,7 @@ import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; import com.epam.ta.reportportal.entity.integration.IntegrationType; - -import java.time.LocalDateTime; +import java.time.Instant; import java.util.HashMap; import java.util.List; @@ -58,7 +57,7 @@ private void createIntegration(String name, IntegrationType integrationType) { Integration integration = new Integration(); integration.setName(name); integration.setType(integrationType); - integration.setCreationDate(LocalDateTime.now()); + integration.setCreationDate(Instant.now()); integration.setEnabled(true); integration.setCreator("SYSTEM"); integration.setParams(new IntegrationParams(new HashMap<>()));