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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ build/
target/
out/
*.iml
bin/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Changelog

## [Unreleased]
### Changed
- Client version updated on [5.4.4](https://github.com/reportportal/client-java/releases/tag/5.4.4), by @HardNorth

## [5.5.0]
### Changed
- Client version updated on [5.4.3](https://github.com/reportportal/client-java/releases/tag/5.4.3), by @HardNorth
- Replace "jsr305" annotations with "jakarta.annotation-api", by @HardNorth
- Switch on use of `Instant` class instead of `Date` to get more timestamp precision, by @HardNorth
### Removed
- Java 8-10 support, by @HardNorth

## [5.4.2]
### Changed
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repositories {
}

dependencies {
api 'com.epam.reportportal:client-java:5.4.3'
api 'com.epam.reportportal:client-java:5.4.4'
compileOnly ("org.jbehave:jbehave-core:${project.jbehave_version}") {
exclude group: 'junit'
exclude group: 'org.junit.vintage'
Expand All @@ -55,7 +55,7 @@ dependencies {
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation "org.mockito:mockito-core:${project.mockito_version}"
testImplementation "org.mockito:mockito-junit-jupiter:${project.mockito_version}"
testImplementation 'ch.qos.logback:logback-classic:1.5.18'
testImplementation 'ch.qos.logback:logback-classic:1.5.19'
testImplementation 'com.epam.reportportal:logger-java-logback:5.4.0'
testImplementation "org.junit.jupiter:junit-jupiter-api:${project.junit5_version}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${project.junit5_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.slf4j.LoggerFactory;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -196,7 +197,7 @@ protected StartTestItemRQ buildStartStoryRq(@Nonnull Story story, @Nonnull Strin
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(getStoryName(story));
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(ItemType.STORY.name());
rq.setAttributes(getAttributes(story));
rq.setDescription(story.getDescription().asString());
Expand Down Expand Up @@ -238,7 +239,7 @@ protected StartTestItemRQ buildStartScenarioRq(@Nonnull Scenario scenario, @Nonn
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(getScenarioName(scenario));
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(ItemType.SCENARIO.name());
rq.setAttributes(getAttributes(scenario));
return rq;
Expand Down Expand Up @@ -280,7 +281,7 @@ protected StartTestItemRQ buildStartExampleRq(@Nonnull Scenario scenario, @Nonnu
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(getScenarioName(scenario));
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(ItemType.TEST.name());
rq.setParameters(getStepParameters(example));
rq.setDescription(String.format(PARAMETERS_PATTERN, MarkdownUtils.formatDataTable(example)));
Expand Down Expand Up @@ -349,7 +350,7 @@ protected StartTestItemRQ buildStartStepRq(@Nonnull final String step, @Nonnull
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(formatExampleStep(step, params));
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(ItemType.STEP.name());
Optional<List<ParameterResource>> usedParams = ofNullable(params).map(p -> getUsedParameters(step).stream()
.filter(params::containsKey)
Expand Down Expand Up @@ -377,7 +378,7 @@ protected StartTestItemRQ buildLifecycleSuiteStartRq(@Nonnull final String name,
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(name);
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(ItemType.TEST.name());
return rq;
}
Expand All @@ -397,7 +398,7 @@ protected StartTestItemRQ buildLifecycleMethodStartRq(@Nonnull final ItemType ty
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(name);
rq.setCodeRef(codeRef);
rq.setStartTime(ofNullable(startTime).orElseGet(Instant::now));
rq.setStartTime(ofNullable(startTime).orElseGet(() -> Instant.now().truncatedTo(ChronoUnit.MICROS)));
rq.setType(type.name());
return rq;
}
Expand Down Expand Up @@ -449,7 +450,7 @@ protected TestItemTree.TestItemLeaf createLeaf(@Nonnull final ItemType type, @No
@Nonnull
protected Instant getItemDate(@Nullable final TestItemTree.TestItemLeaf parent) {
final Instant previousDate = ofNullable(parent).map(p -> p.<Instant>getAttribute(START_TIME)).orElseGet(Instant::now);
Instant currentDate = Instant.now();
Instant currentDate = Instant.now().truncatedTo(ChronoUnit.MICROS);
Instant itemDate;
if (previousDate.compareTo(currentDate) <= 0) {
itemDate = currentDate;
Expand Down Expand Up @@ -525,14 +526,12 @@ protected TestItemTree.TestItemLeaf retrieveLeaf() {
exampleKey, k -> {
String parentScenarioCodeRef = getCodeRef(parentCodeRef, parentScenarioKey, ItemType.SCENARIO);
TestItemTree.TestItemLeaf leaf = createLeaf(
ItemType.SUITE,
buildStartExampleRq(
ItemType.SUITE, buildStartExampleRq(
parentScenario,
example,
getCodeRef(parentScenarioCodeRef, k, ItemType.SUITE),
itemDate
),
parentLeaf
), parentLeaf
);
leaf.setAttribute(PARAMETERS, example);
return leaf;
Expand Down