Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 0b2616d

Browse files
committed
chore: revert generated tests to junit4 and fix static imports
1 parent c4d3b6e commit 0b2616d

8 files changed

Lines changed: 755 additions & 744 deletions

File tree

google-cloud-logging/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@
123123
<artifactId>junit-jupiter-params</artifactId>
124124
<scope>test</scope>
125125
</dependency>
126+
<dependency>
127+
<groupId>org.junit.vintage</groupId>
128+
<artifactId>junit-vintage-engine</artifactId>
129+
<scope>test</scope>
130+
</dependency>
126131
<dependency>
127132
<groupId>org.easymock</groupId>
128133
<artifactId>easymock</artifactId>

google-cloud-logging/src/test/java/com/google/cloud/logging/AutoPopulateMetadataTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
import static org.easymock.EasyMock.expect;
2323
import static org.easymock.EasyMock.newCapture;
2424
import static org.easymock.EasyMock.replay;
25-
import static org.junit.jupiter.api.Assertions.*;
25+
import static org.junit.jupiter.api.Assertions.assertEquals;
26+
import static org.junit.jupiter.api.Assertions.assertFalse;
27+
import static org.junit.jupiter.api.Assertions.assertNull;
2628

2729
import com.google.api.core.ApiFutures;
2830
import com.google.cloud.MonitoredResource;

google-cloud-logging/src/test/java/com/google/cloud/logging/InstrumentationTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
package com.google.cloud.logging;
1818

19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertFalse;
1921
import static org.junit.jupiter.api.Assertions.assertSame;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
2023

2124
import com.google.api.client.util.Lists;
2225
import com.google.cloud.Tuple;
@@ -30,7 +33,6 @@
3033
import java.util.HashMap;
3134
import java.util.HashSet;
3235
import java.util.Map;
33-
import org.junit.jupiter.api.Assertions;
3436
import org.junit.jupiter.api.Test;
3537

3638
class InstrumentationTest {
@@ -60,8 +62,8 @@ void testNoInstrumentationGenerated() {
6062
Tuple<Boolean, Iterable<LogEntry>> pair =
6163
Instrumentation.populateInstrumentationInfo(ImmutableList.of(STRING_ENTRY));
6264
ArrayList<LogEntry> entries = Lists.newArrayList(pair.y());
63-
Assertions.assertFalse(pair.x());
64-
Assertions.assertEquals(1, entries.size());
65+
assertFalse(pair.x());
66+
assertEquals(1, entries.size());
6567
assertSame(Payload.Type.STRING, entries.get(0).getPayload().getType());
6668
}
6769

@@ -120,8 +122,8 @@ private static void verifyEntries(
120122
HashSet<String> names,
121123
HashSet<String> versions) {
122124
ArrayList<LogEntry> entries = Lists.newArrayList(pair.y());
123-
Assertions.assertTrue(pair.x());
124-
Assertions.assertEquals(expected, entries.size());
125+
assertTrue(pair.x());
126+
assertEquals(expected, entries.size());
125127
assertSame(Payload.Type.JSON, entries.get(index).getPayload().getType());
126128
ListValue infoList =
127129
entries
@@ -133,18 +135,18 @@ private static void verifyEntries(
133135
.getFieldsOrThrow(Instrumentation.INSTRUMENTATION_SOURCE_KEY)
134136
.getListValue();
135137
for (Value val : infoList.getValuesList()) {
136-
Assertions.assertTrue(
138+
assertTrue(
137139
names.remove(
138140
val.getStructValue()
139141
.getFieldsOrThrow(Instrumentation.INSTRUMENTATION_NAME_KEY)
140142
.getStringValue()));
141-
Assertions.assertTrue(
143+
assertTrue(
142144
versions.remove(
143145
val.getStructValue()
144146
.getFieldsOrThrow(Instrumentation.INSTRUMENTATION_VERSION_KEY)
145147
.getStringValue()));
146148
}
147-
Assertions.assertEquals(0, names.size());
148-
Assertions.assertEquals(0, versions.size());
149+
assertEquals(0, names.size());
150+
assertEquals(0, versions.size());
149151
}
150-
}
152+
}

google-cloud-logging/src/test/java/com/google/cloud/logging/OptionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
import static org.junit.jupiter.api.Assertions.assertEquals;
2020
import static org.junit.jupiter.api.Assertions.assertNull;
21+
import static org.junit.jupiter.api.Assertions.fail;
2122

2223
import com.google.cloud.logging.Logging.ListOption;
2324
import com.google.cloud.logging.Option.OptionType;
2425
import com.google.common.testing.EqualsTester;
25-
import org.junit.jupiter.api.Assertions;
2626
import org.junit.jupiter.api.Test;
2727

2828
class OptionTest {
@@ -54,7 +54,7 @@ void testConstructor() {
5454
assertNull(option.getValue());
5555
try {
5656
new Option(null, VALUE) {};
57-
Assertions.fail();
57+
fail();
5858
} catch (NullPointerException expected) {
5959

6060
}

google-cloud-logging/src/test/java/com/google/cloud/logging/it/ITTracingLogsTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
import static com.google.cloud.logging.testing.RemoteLoggingHelper.formatForTest;
2020
import static com.google.common.truth.Truth.assertThat;
21-
import static org.junit.jupiter.api.Assertions.*;
21+
import static org.junit.jupiter.api.Assertions.assertEquals;
22+
import static org.junit.jupiter.api.Assertions.assertNull;
23+
import static org.junit.jupiter.api.Assertions.assertTrue;
2224

2325
import com.google.cloud.MonitoredResource;
2426
import com.google.cloud.logging.*;

0 commit comments

Comments
 (0)