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) #61

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
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,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'

compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
Expand All @@ -51,7 +52,7 @@ dependencies {
implementation group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
implementation group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
implementation group: 'org.jooq', name: 'jooq', version: '3.14.4'
jooqRuntime 'org.postgresql:postgresql:42.2.13'
jooqRuntime 'org.postgresql:postgresql:42.7.3'

testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0'
testImplementation 'org.mockito:mockito-junit-jupiter:3.12.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -751,7 +752,8 @@ private List<AttachmentInfo> uploadAttachmentToAzure(PostTicketRQ ticketRQ) {
private String getFormattedMessage(Log log) {
StringBuilder messageBuilder = new StringBuilder();
ofNullable(log.getLogTime()).ifPresent(logTime -> messageBuilder.append("Time: ")
.append(logTime.format(DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss"))).append(", "));
.append(logTime.atOffset(ZoneOffset.UTC).toLocalDateTime()
.format(DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss"))).append(", "));
ofNullable(log.getLogLevel()).ifPresent(
logLevel -> messageBuilder.append("Level: ").append(logLevel).append(", "));
messageBuilder.append("<br>").append("Log: ").append(log.getLogMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.epam.ta.reportportal.entity.integration.IntegrationParams;
import com.epam.ta.reportportal.entity.integration.IntegrationType;

import java.time.Instant;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -43,7 +44,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<>()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
package com.epam.reportportal.extension.azure;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;

import com.epam.reportportal.extension.IntegrationGroupEnum;
import com.epam.reportportal.extension.PluginCommand;
import com.epam.reportportal.extension.azure.command.connection.TestConnectionCommand;
import com.epam.reportportal.extension.azure.rest.client.ApiException;
import com.epam.reportportal.extension.azure.rest.client.api.*;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.*;
import com.epam.reportportal.extension.azure.rest.client.api.ClassificationNodesApi;
import com.epam.reportportal.extension.azure.rest.client.api.FieldsApi;
import com.epam.reportportal.extension.azure.rest.client.api.WorkItemTypesApi;
import com.epam.reportportal.extension.azure.rest.client.api.WorkItemTypesFieldApi;
import com.epam.reportportal.extension.azure.rest.client.api.WorkItemsApi;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.WorkItem;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.WorkItemClassificationNode;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.WorkItemField;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.WorkItemType;
import com.epam.reportportal.extension.azure.rest.client.model.workitem.WorkItemTypeFieldWithReferences;
import com.epam.reportportal.model.externalsystem.AllowedValue;
import com.epam.reportportal.model.externalsystem.PostFormField;
import com.epam.reportportal.model.externalsystem.PostTicketRQ;
import com.epam.reportportal.model.externalsystem.Ticket;
import com.epam.ta.reportportal.binary.impl.AttachmentDataStoreService;
import com.epam.ta.reportportal.dao.*;
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.LogRepository;
import com.epam.ta.reportportal.dao.TestItemRepository;
import com.epam.ta.reportportal.entity.integration.Integration;
import com.epam.ta.reportportal.entity.integration.IntegrationParams;
import com.epam.ta.reportportal.entity.integration.IntegrationType;
Expand All @@ -20,6 +38,14 @@
import com.epam.ta.reportportal.entity.item.issue.IssueEntity;
import com.epam.ta.reportportal.entity.project.Project;
import com.epam.ta.reportportal.filesystem.DataEncoder;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.sql.DataSource;
import org.jasypt.util.text.BasicTextEncryptor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -29,14 +55,6 @@
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.context.ApplicationContext;

import javax.sql.DataSource;
import java.time.LocalDateTime;
import java.util.*;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;

@ExtendWith(MockitoExtension.class)
class AzureExtensionTest {

Expand Down Expand Up @@ -99,7 +117,7 @@ public void init(){
params.put("oauthAccessKey", "token");
IntegrationParams integrationParams = new IntegrationParams(params);
integration = new Integration(1L, new Project(1L, "ProjectName"), new IntegrationType(),
integrationParams, LocalDateTime.now());
integrationParams, Instant.now());
workItem = new WorkItem();
workItem.setId(23);
workItem.setUrl("https://dev.azure.com/some/some/_workitems/edit/23");
Expand Down
Loading