From 719b448ce91a786310285d1b272966f1c2897bf7 Mon Sep 17 00:00:00 2001 From: siarhei_hrabko Date: Wed, 3 Apr 2024 13:56:11 +0300 Subject: [PATCH 1/2] EPMRPP-90180 update dependencies (Instant time) --- build.gradle | 6 +++--- .../bugtracking/jira/JIRATicketDescriptionService.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index ae83b5f..662f088 100755 --- a/build.gradle +++ b/build.gradle @@ -42,8 +42,8 @@ dependencies { implementation 'com.epam.reportportal:plugin-api' annotationProcessor 'com.epam.reportportal:plugin-api' } else { - implementation 'com.github.reportportal:plugin-api:cc3c5c8e' - annotationProcessor 'com.github.reportportal:plugin-api:cc3c5c8e' + implementation 'com.github.reportportal:plugin-api:eec4267' + annotationProcessor 'com.github.reportportal:plugin-api:eec4267' } compile 'ch.qos.logback:logback-classic:1.2.3' @@ -131,4 +131,4 @@ task assemblePlugin(type: Copy) { task assemblePlugins(type: Copy) { dependsOn subprojects.assemblePlugin -} \ No newline at end of file +} diff --git a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java index e41db72..42abbf5 100755 --- a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java +++ b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java @@ -21,7 +21,7 @@ package com.epam.reportportal.extension.bugtracking.jira; -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.ta.reportportal.dao.LogRepository; @@ -157,7 +157,7 @@ private void updateWithLog(StringBuilder descriptionBuilder, Log log, boolean in private String getFormattedMessage(Log log) { StringBuilder messageBuilder = new StringBuilder(); 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("\n"); @@ -184,4 +184,4 @@ private void addAttachment(StringBuilder descriptionBuilder, Attachment attachme } } -} \ No newline at end of file +} From 52b2d55cc53832e307e1e7528520dc14d22d0015 Mon Sep 17 00:00:00 2001 From: siarhei_hrabko Date: Mon, 15 Apr 2024 14:44:27 +0300 Subject: [PATCH 2/2] EPMRPP-90180 update dependencies (Instant time) --- build.gradle | 9 +++++---- .../jira/JIRATicketDescriptionService.java | 14 ++++++++------ .../extension/bugtracking/jira/JiraStrategy.java | 1 - 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index c6fdda6..f7e3d61 100755 --- a/build.gradle +++ b/build.gradle @@ -43,16 +43,17 @@ dependencies { implementation 'com.epam.reportportal:plugin-api' annotationProcessor 'com.epam.reportportal:plugin-api' } else { - implementation 'com.github.reportportal:commons-dao:a0f2b0e' - implementation 'com.github.reportportal:plugin-api:4c94ca4' - annotationProcessor 'com.github.reportportal:plugin-api:4c94ca4' + 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' compile 'ch.qos.logback:logback-classic:1.2.3' compile 'org.slf4j:slf4j-api:1.7.25' compile 'io.atlassian.fugue:fugue:4.7.2' - compile('com.atlassian.jira:jira-rest-java-client-core:5.2.4') + compile 'com.atlassian.jira:jira-rest-java-client-core:5.2.4' compile 'net.oauth.core:oauth:20090617' compile 'net.oauth.core:oauth-httpclient4:20090913' diff --git a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java index 5924ea7..5d050f7 100755 --- a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java +++ b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JIRATicketDescriptionService.java @@ -32,8 +32,8 @@ import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.log.Log; -import java.text.DateFormat; -import java.text.SimpleDateFormat; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.List; import org.apache.commons.collections.CollectionUtils; @@ -64,12 +64,12 @@ public class JIRATicketDescriptionService { private final LogRepository logRepository; private final TestItemRepository itemRepository; - private final DateFormat dateFormat; + private static final DateTimeFormatter JIRA_DATETIME_FORMATTER = + DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss").withZone(ZoneId.of("UTC")); private final MimeTypes mimeRepository; public JIRATicketDescriptionService(LogRepository logRepository, TestItemRepository itemRepository) { - this.dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); this.logRepository = logRepository; this.itemRepository = itemRepository; this.mimeRepository = TikaConfig.getDefaultConfig().getMimeRepository(); @@ -156,8 +156,10 @@ private void updateWithLog(StringBuilder descriptionBuilder, Log log, boolean in private String getFormattedMessage(Log log) { StringBuilder messageBuilder = new StringBuilder(); - ofNullable(log.getLogTime()).ifPresent(logTime -> messageBuilder.append(" Time: ") - .append(dateFormat.format(INSTANT_TO_LDT.apply(logTime))).append(", ")); + ofNullable(log.getLogTime()) + .ifPresent(logTime -> messageBuilder.append(" Time: ") + .append(INSTANT_TO_LDT.apply(logTime).format(JIRA_DATETIME_FORMATTER)) + .append(", ")); ofNullable(log.getLogLevel()).ifPresent( logLevel -> messageBuilder.append("Level: ").append(logLevel).append(", ")); messageBuilder.append("Log: ").append(log.getLogMessage()).append("\n"); diff --git a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JiraStrategy.java b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JiraStrategy.java index 7dbe20c..36664dd 100755 --- a/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JiraStrategy.java +++ b/src/main/java/com/epam/reportportal/extension/bugtracking/jira/JiraStrategy.java @@ -63,7 +63,6 @@ import com.epam.reportportal.model.externalsystem.PostFormField; import com.epam.reportportal.model.externalsystem.PostTicketRQ; import com.epam.reportportal.model.externalsystem.Ticket; -import com.epam.reportportal.rules.commons.validation.BusinessRule; import com.epam.reportportal.rules.exception.ErrorType; import com.epam.reportportal.rules.exception.ReportPortalException; import com.epam.ta.reportportal.binary.DataStoreService;