Skip to content

Commit 999cef6

Browse files
committed
refactor: simplify if statement
1 parent 04b40cf commit 999cef6

File tree

1 file changed

+4
-8
lines changed
  • tools/test-spring-boot-starter/src/main/java/com/microsoft/playwright/springboottest

1 file changed

+4
-8
lines changed

tools/test-spring-boot-starter/src/main/java/com/microsoft/playwright/springboottest/TestApp.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.springframework.boot.SpringApplication;
66
import org.springframework.boot.autoconfigure.SpringBootApplication;
77

8+
import java.util.Arrays;
89
import java.util.concurrent.CompletableFuture;
910

1011
@SpringBootApplication
@@ -16,15 +17,10 @@ public static void main(String[] args) {
1617

1718
@Override
1819
public void run(String... args) {
19-
if (args.length == 0) {
20-
runSync();
20+
if (Arrays.asList(args).contains("--async")) {
21+
runAsync();
2122
} else {
22-
if ("--async".equals(args[0])) {
23-
runAsync();
24-
}
25-
else {
26-
runSync();
27-
}
23+
runSync();
2824
}
2925
}
3026

0 commit comments

Comments
 (0)