Skip to content

Commit 994e518

Browse files
authored
Merge pull request #113 from reportportal/develop
Release
2 parents 1c18158 + 9366844 commit 994e518

File tree

8 files changed

+32
-12
lines changed

8 files changed

+32
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Changed
5+
- Client version updated on [5.3.14](https://github.com/reportportal/client-java/releases/tag/5.3.14), by @HardNorth
6+
- JUnit-Foundation updated on [17.2.4](https://github.com/sbabcoc/JUnit-Foundation/releases/tag/junit-foundation-17.2.4), by @HardNorth
47

58
## [5.2.4]
69
### Changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ repositories {
3939
}
4040

4141
dependencies {
42-
api 'com.epam.reportportal:client-java:5.2.25'
43-
api 'com.nordstrom.tools:junit-foundation:17.1.1'
42+
api 'com.epam.reportportal:client-java:5.3.14'
43+
api 'com.nordstrom.tools:junit-foundation:17.2.4'
4444

4545
implementation 'org.slf4j:slf4j-api:2.0.7'
4646

47-
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.7'
47+
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.12'
4848

4949
testImplementation 'org.aspectj:aspectjweaver:1.9.19'
5050
testImplementation 'org.hamcrest:hamcrest-core:2.2'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=5.2.5-SNAPSHOT
1+
version=5.3.0-SNAPSHOT
22
description=ReportPortal JUnit 4 client
33
junit5_version=5.6.3
44
junit5_runner_version=1.6.3
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/test/java/com/epam/reportportal/junit/CodeReferenceTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.mockito.ArgumentCaptor;
2929
import org.mockito.ArgumentMatchers;
3030

31+
import java.util.Arrays;
3132
import java.util.List;
3233

3334
import static com.epam.reportportal.junit.utils.TestUtils.PROCESSING_TIMEOUT;
@@ -52,6 +53,11 @@ public void setupMock() {
5253
@Test
5354
public void verify_static_test_code_reference_generation() {
5455
TestUtils.runClasses(CodeRefTest.class);
56+
String methodName = Arrays.stream(CodeRefTest.class.getDeclaredMethods())
57+
.filter(m -> m.getAnnotation(org.junit.Test.class) != null)
58+
.findAny()
59+
.orElseThrow(() -> new IllegalArgumentException("No test method in test class"))
60+
.getName();
5561

5662
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
5763
verify(client, timeout(PROCESSING_TIMEOUT)).startTestItem(ArgumentMatchers.startsWith("root_"), captor.capture());
@@ -65,9 +71,7 @@ public void verify_static_test_code_reference_generation() {
6571

6672
assertThat(classRq.getCodeRef(), allOf(notNullValue(), equalTo(CodeRefTest.class.getCanonicalName())));
6773
assertThat(classRq.getType(), allOf(notNullValue(), equalTo(ItemType.TEST.name())));
68-
assertThat(testRq.getCodeRef(), allOf(notNullValue(),
69-
equalTo(CodeRefTest.class.getCanonicalName() + "." + CodeRefTest.class.getDeclaredMethods()[0].getName())
70-
));
74+
assertThat(testRq.getCodeRef(), allOf(notNullValue(), equalTo(CodeRefTest.class.getCanonicalName() + "." + methodName)));
7175
}
7276

7377
}

src/test/java/com/epam/reportportal/junit/features/attribute/MultiValueAttributeTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323

2424
import java.util.Arrays;
2525
import java.util.Collection;
26+
import java.util.Collections;
2627

2728
public class MultiValueAttributeTest {
2829
private static final String VALUE_1 = "v1";
2930
private static final String VALUE_2 = "v2";
3031

31-
public static final Collection<Pair<String, String>> ATTRIBUTES = Arrays.asList(Pair.of(null, VALUE_1), Pair.of(null, VALUE_2));
32+
public static final Collection<Pair<String, String>> ATTRIBUTES = Collections.unmodifiableList(Arrays.asList(
33+
Pair.of(null, VALUE_1),
34+
Pair.of(null, VALUE_2)
35+
));
3236

3337
@Test
3438
@Attributes(multiValueAttributes = { @MultiValueAttribute(isNullKey = true, values = { VALUE_1, VALUE_2 }) })

src/test/java/com/epam/reportportal/junit/features/attribute/MultipleAttributeTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import java.util.Arrays;
2626
import java.util.Collection;
27+
import java.util.Collections;
2728

2829
public class MultipleAttributeTest {
2930
private static final String KEY_1 = "key1";
@@ -36,11 +37,12 @@ public class MultipleAttributeTest {
3637
private static final String VALUE_3 = "v";
3738
private static final String VALUE_4 = VALUE_3;
3839

39-
public static final Collection<Pair<String, String>> ATTRIBUTES = Arrays.asList(Pair.of(KEY_1, VALUE_1),
40+
public static final Collection<Pair<String, String>> ATTRIBUTES = Collections.unmodifiableList(Arrays.asList(
41+
Pair.of(KEY_1, VALUE_1),
4042
Pair.of(KEY_2, VALUE_2),
4143
Pair.of(KEY_3, VALUE_3),
4244
Pair.of(KEY_4, VALUE_4)
43-
);
45+
));
4446

4547
@Test
4648
@Attributes(attributes = { @Attribute(key = KEY_1, value = VALUE_1), @Attribute(key = KEY_2, value = VALUE_2) }, multiKeyAttributes = {

src/test/java/com/epam/reportportal/junit/testcaseid/TestCaseIdStaticTest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import org.junit.jupiter.api.Test;
2828
import org.mockito.ArgumentCaptor;
2929

30+
import java.util.Arrays;
31+
3032
import static com.epam.reportportal.junit.utils.TestUtils.PROCESSING_TIMEOUT;
3133
import static org.hamcrest.MatcherAssert.assertThat;
3234
import static org.hamcrest.Matchers.*;
@@ -51,12 +53,17 @@ public void setupMock() {
5153
@Test
5254
public void verify_static_test_case_id_generation() {
5355
TestUtils.runClasses(CodeRefTest.class);
56+
String methodName = Arrays.stream(CodeRefTest.class.getDeclaredMethods())
57+
.filter(m -> m.getAnnotation(org.junit.Test.class) != null)
58+
.findAny()
59+
.orElseThrow(() -> new IllegalArgumentException("No test method in test class"))
60+
.getName();
5461

5562
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
5663
verify(client, timeout(PROCESSING_TIMEOUT)).startTestItem(same(classId), captor.capture());
5764

5865
assertThat(captor.getValue().getTestCaseId(), allOf(notNullValue(),
59-
equalTo(CodeRefTest.class.getCanonicalName() + "." + CodeRefTest.class.getDeclaredMethods()[0].getName())
66+
equalTo(CodeRefTest.class.getCanonicalName() + "." + methodName)
6067
));
6168
}
6269
}

0 commit comments

Comments
 (0)