Skip to content

Commit a36a264

Browse files
dlwldnjs1009vlsi
authored andcommitted
Replace stream().forEach() wrappers with plain for loops
Convert the stream().forEach() wrappers in TestDecompression and TestRedirects to enhanced for loops now that NestedForDepth is gone. Remove the unused Arrays import from TestDecompression.
1 parent 09d8744 commit a36a264

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/TestDecompression.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.net.MalformedURLException;
2525
import java.net.URL;
2626
import java.util.ArrayList;
27-
import java.util.Arrays;
2827
import java.util.List;
2928
import java.util.function.Consumer;
3029

@@ -53,13 +52,13 @@ enum ServerGzip {
5352

5453
public static List<Arguments> mockServerParams() {
5554
List<Arguments> res = new ArrayList<>();
56-
Arrays.stream(HTTPSamplerFactory.getImplementations()).forEach(httpImpl -> {
55+
for (String httpImpl : HTTPSamplerFactory.getImplementations()) {
5756
for (ClientGzip clientGzip : ClientGzip.values()) {
5857
for (ServerGzip serverGzip : ServerGzip.values()) {
5958
res.add(Arguments.of(httpImpl, clientGzip, serverGzip));
6059
}
6160
}
62-
});
61+
}
6362
return res;
6463
}
6564

src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/TestRedirects.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TestRedirects {
4444
public static List<Arguments> redirectionParams() {
4545
List<Arguments> res = new ArrayList<>();
4646
List<String> httpMethods = Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE");
47-
Arrays.stream(HTTPSamplerFactory.getImplementations()).forEach(httpImpl -> {
47+
for (String httpImpl : HTTPSamplerFactory.getImplementations()) {
4848
for (int statusCode : Arrays.asList(301, 302, 303, 307, 308)) {
4949
for (String method : httpMethods) {
5050
res.add(Arguments.of(httpImpl, statusCode, true, method));
@@ -55,7 +55,7 @@ public static List<Arguments> redirectionParams() {
5555
res.add(Arguments.of(httpImpl, statusCode, false, method));
5656
}
5757
}
58-
});
58+
}
5959
return res;
6060
}
6161

@@ -85,7 +85,7 @@ void testRedirect(String httpImpl, int redirectCode, boolean shouldRedirect, Str
8585
public static List<Arguments> methodPreservationParams() {
8686
List<Arguments> res = new ArrayList<>();
8787
List<String> httpMethods = Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE");
88-
Arrays.stream(HTTPSamplerFactory.getImplementations()).forEach(httpImpl -> {
88+
for (String httpImpl : HTTPSamplerFactory.getImplementations()) {
8989
for (int statusCode : Arrays.asList(301, 302, 303, 307, 308)) {
9090
for (String method : httpMethods) {
9191
String expectedMethod = switch (statusCode) {
@@ -95,7 +95,7 @@ public static List<Arguments> methodPreservationParams() {
9595
res.add(Arguments.of(httpImpl, statusCode, method, expectedMethod));
9696
}
9797
}
98-
});
98+
}
9999
return res;
100100
}
101101

0 commit comments

Comments
 (0)