Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-90180 update dependencies (Instant time) #55

Merged
merged 3 commits into from
Apr 15, 2024
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
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ 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'

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'
Expand Down Expand Up @@ -133,4 +134,4 @@ task assemblePlugin(type: Copy) {

task assemblePlugins(type: Copy) {
dependsOn subprojects.assemblePlugin
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.reportportal.model.externalsystem.PostTicketRQ;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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(TO_DATE.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");
Expand All @@ -184,4 +186,4 @@ private void addAttachment(StringBuilder descriptionBuilder, Attachment attachme

}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading