File tree Expand file tree Collapse file tree 9 files changed +27
-18
lines changed
bolt-aws-lambda/src/test/java/util
bolt-helidon/src/test/java/util
bolt-http4k/src/test/java/util
bolt-ktor/src/test/kotlin/util
bolt-micronaut/src/test/java/util
bolt-socket-mode/src/test/java/util
slack-api-client/src/test/java/util
slack-app-backend/src/test/java/util Expand file tree Collapse file tree 9 files changed +27
-18
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class PortProvider {
1111 private PortProvider () {
1212 }
1313
14+ private static final int MINIMUM = 1024 ;
1415 private static final SecureRandom RANDOM = new SecureRandom ();
1516 private static final ConcurrentMap <String , Integer > PORTS = new ConcurrentHashMap <>();
1617
@@ -21,8 +22,8 @@ public static int getPort(String name) {
2122 private static int randomPort () {
2223 while (true ) {
2324 int randomPort = RANDOM .nextInt (9999 );
24- if (randomPort < 1000 ) {
25- randomPort += 1000 ;
25+ if (randomPort < MINIMUM ) {
26+ randomPort += MINIMUM ;
2627 }
2728 if (isAvailable (randomPort )) {
2829 return randomPort ;
You can’t perform that action at this time.
0 commit comments