Skip to content

Commit 5b9746a

Browse files
authored
Add Integration Test to allow customization of successThreshold and failureThreshold in weblogic server liveness and readiness probe (#2527)
* Add Integration Test to allow customization of successThreshold and failureThreshold in weblogic server liveness and readiness probe
1 parent 2da56fe commit 5b9746a

File tree

4 files changed

+417
-11
lines changed

4 files changed

+417
-11
lines changed

integration-tests/src/test/java/oracle/weblogic/domain/ProbeTuning.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ public class ProbeTuning {
1919
@ApiModelProperty("The number of seconds with no response that indicates a failure.")
2020
private Integer timeoutSeconds;
2121

22+
@ApiModelProperty("Number of times the check is performed before giving up.")
23+
private Integer failureThreshold = 1;
24+
25+
@ApiModelProperty("Minimum number of times the check needs to pass for the probe to be considered successful")
26+
private Integer successThreshold = 1;
27+
2228
public ProbeTuning initialDelaySeconds(Integer initialDelaySeconds) {
2329
this.initialDelaySeconds = initialDelaySeconds;
2430
return this;
@@ -70,12 +76,32 @@ public void setTimeoutSeconds(Integer timeoutSeconds) {
7076
this.timeoutSeconds = timeoutSeconds;
7177
}
7278

79+
public Integer getFailureThreshold() {
80+
return failureThreshold;
81+
}
82+
83+
public ProbeTuning failureThreshold(Integer failureThreshold) {
84+
this.failureThreshold = failureThreshold;
85+
return this;
86+
}
87+
88+
public Integer getSuccessThreshold() {
89+
return successThreshold;
90+
}
91+
92+
public ProbeTuning successThreshold(Integer successThreshold) {
93+
this.successThreshold = successThreshold;
94+
return this;
95+
}
96+
7397
@Override
7498
public String toString() {
7599
return new ToStringBuilder(this)
76100
.append("initialDelaySeconds", initialDelaySeconds)
77101
.append("periodSeconds", periodSeconds)
78102
.append("timeoutSeconds", timeoutSeconds)
103+
.append("failureThreshold", failureThreshold)
104+
.append("successThreshold", successThreshold)
79105
.toString();
80106
}
81107

@@ -93,6 +119,8 @@ public boolean equals(Object other) {
93119
.append(initialDelaySeconds, rhs.initialDelaySeconds)
94120
.append(periodSeconds, rhs.periodSeconds)
95121
.append(timeoutSeconds, rhs.timeoutSeconds)
122+
.append(failureThreshold, rhs.failureThreshold)
123+
.append(successThreshold, rhs.successThreshold)
96124
.isEquals();
97125
}
98126

@@ -102,6 +130,8 @@ public int hashCode() {
102130
.append(initialDelaySeconds)
103131
.append(periodSeconds)
104132
.append(timeoutSeconds)
133+
.append(failureThreshold)
134+
.append(successThreshold)
105135
.toHashCode();
106136
}
107137
}

integration-tests/src/test/java/oracle/weblogic/domain/ServerPod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public void setAnnotations(Map<String, String> annotations) {
225225
this.annotations = annotations;
226226
}
227227

228-
public ServerPod livenessProve(ProbeTuning livenessProbe) {
228+
public ServerPod livenessProbe(ProbeTuning livenessProbe) {
229229
this.livenessProbe = livenessProbe;
230230
return this;
231231
}

0 commit comments

Comments
 (0)