File tree Expand file tree Collapse file tree
liberty/src/main/java/org/testcontainers/containers/liberty
payara-micro/src/main/java/org/testcontainers/containers/payara
payara-server/src/main/java/org/testcontainers/containers/payara
testcontainers/src/main/java/org/microshed/testing/testcontainers/spi Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import java .util .ArrayList ;
2727import java .util .List ;
2828import java .util .Map ;
29- import java .util .Optional ;
3029
3130import org .microshed .testing .testcontainers .spi .ServerAdapter ;
3231import org .testcontainers .images .builder .ImageFromDockerfile ;
@@ -46,7 +45,7 @@ public static void setBaseDockerImage(String imageName) {
4645
4746 @ Override
4847 public int getPriority () {
49- return - 50 ;
48+ return PRIORITY_RUNTIME_MODULE ;
5049 }
5150
5251 @ Override
@@ -113,8 +112,4 @@ public ImageFromDockerfile getDefaultImage(File appFile) {
113112 return image ;
114113 }
115114
116- @ Override
117- public Optional <String > getReadinessPath () {
118- return Optional .empty ();
119- }
120115}
Original file line number Diff line number Diff line change 2525import java .util .Optional ;
2626
2727public class PayaraMicroAdapter implements ServerAdapter {
28+
29+ @ Override
30+ public int getPriority () {
31+ return PRIORITY_RUNTIME_MODULE ;
32+ }
33+
2834 @ Override
2935 public int getDefaultHttpPort () {
3036 return 8080 ;
Original file line number Diff line number Diff line change 2525import java .util .Optional ;
2626
2727public class PayaraServerAdapter implements ServerAdapter {
28+
29+ @ Override
30+ public int getPriority () {
31+ return PRIORITY_RUNTIME_MODULE ;
32+ }
33+
2834 @ Override
2935 public int getDefaultHttpPort () {
3036 return 8080 ;
Original file line number Diff line number Diff line change 3838 */
3939public interface ServerAdapter {
4040
41+ static final int PRIORITY_USER_DEFAULT = 50 ;
42+ static final int PRIORITY_DEFAULT = 0 ;
43+ static final int PRIORITY_RUNTIME_MODULE = -50 ;
44+
4145 default int getPriority () {
42- return 0 ;
46+ return PRIORITY_DEFAULT ;
4347 }
4448
4549 /**
@@ -91,8 +95,10 @@ default ImageFromDockerfile getDefaultImage(File appFile) {
9195
9296 /**
9397 * Defines the readiness path for the Server which will be used by default when the developer did not specify such value.
94- * The implementation can choose to return null and then no value is defined by default.
95- * @return the readiness path to be used by default.
98+ *
99+ * @return the readiness path to be used by default, or an empty Optional if no default value is provided .
96100 */
97- Optional <String > getReadinessPath ();
101+ default Optional <String > getReadinessPath () {
102+ return Optional .empty ();
103+ }
98104}
You can’t perform that action at this time.
0 commit comments