Skip to content

Commit e8a487e

Browse files
committed
Merge branch 'xc-111113' into 'release/4.1'
backport fix NumberFormatException to release/4.1 See merge request weblogic-cloud/weblogic-kubernetes-operator!4365
2 parents fc8e839 + b391bf7 commit e8a487e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIstioSessionMigration.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -184,7 +184,12 @@ void testSessionMigrationIstioEnabled() {
184184
String primaryServerName = httpDataInfo.get(primaryServerAttr);
185185
String sessionCreateTime = httpDataInfo.get(sessionCreateTimeAttr);
186186
String countStr = httpDataInfo.get(countAttr);
187-
int count = Optional.ofNullable(countStr).map(Integer::valueOf).orElse(managedServerPort);
187+
int count;
188+
if (countStr.equalsIgnoreCase("null")) {
189+
count = managedServerPort;
190+
} else {
191+
count = Optional.ofNullable(countStr).map(Integer::valueOf).orElse(managedServerPort);
192+
}
188193
logger.info("After patching the domain, the primary server changes to {0} "
189194
+ ", session create time {1} and session state {2}",
190195
primaryServerName, sessionCreateTime, countStr);

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSessionMigration.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -197,7 +197,12 @@ void testSessionMigration() {
197197
String primaryServerName = httpDataInfo.get(primaryServerAttr);
198198
String sessionCreateTime = httpDataInfo.get(sessionCreateTimeAttr);
199199
String countStr = httpDataInfo.get(countAttr);
200-
int count = Optional.ofNullable(countStr).map(Integer::valueOf).orElse(0);
200+
int count;
201+
if (countStr.equalsIgnoreCase("null")) {
202+
count = 0;
203+
} else {
204+
count = Optional.ofNullable(countStr).map(Integer::valueOf).orElse(0);
205+
}
201206
logger.info("After patching the domain, the primary server changes to {0} "
202207
+ ", session create time {1} and session state {2}",
203208
primaryServerName, sessionCreateTime, countStr);

0 commit comments

Comments
 (0)