|
6 | 6 | import java.util.ArrayList; |
7 | 7 | import java.util.Arrays; |
8 | 8 | import java.util.List; |
| 9 | +import java.util.Objects; |
9 | 10 |
|
10 | 11 | import com.meterware.simplestub.Memento; |
11 | 12 | import oracle.kubernetes.utils.SystemClockTestSupport; |
@@ -292,12 +293,12 @@ public void whenMatchingServersExist_setServersUpdatesState() { |
292 | 293 | domainStatus.setServers(Arrays.asList( |
293 | 294 | new ServerStatus().withClusterName("1").withServerName("1").withState("state1"), |
294 | 295 | new ServerStatus().withClusterName("1").withServerName("2").withState("state1"), |
295 | | - new ServerStatus().withClusterName("1").withServerName("3").withState("state2") |
| 296 | + new ServerStatus().withServerName("admin").withIsAdminServer(true).withState("state2") |
296 | 297 | )); |
297 | 298 |
|
298 | 299 | assertThat(getServer("1", "1").getState(), equalTo("state1")); |
299 | 300 | assertThat(getServer("1", "2").getState(), equalTo("state1")); |
300 | | - assertThat(getServer("1", "3").getState(), equalTo("state2")); |
| 301 | + assertThat(getServer(null, "admin").getState(), equalTo("state2")); |
301 | 302 | } |
302 | 303 |
|
303 | 304 | @Test |
@@ -334,8 +335,8 @@ public void whenSetServerIncludesServerWithoutStateAndHasExistingState_preserveI |
334 | 335 | private ServerStatus getServer(String clusterName, String serverName) { |
335 | 336 | return domainStatus.getServers() |
336 | 337 | .stream() |
337 | | - .filter(s -> s.getClusterName().equals(clusterName)) |
338 | | - .filter(s -> s.getServerName().equals(serverName)) |
| 338 | + .filter(s -> Objects.equals(clusterName, s.getClusterName())) |
| 339 | + .filter(s -> Objects.equals(serverName, s.getServerName())) |
339 | 340 | .findFirst() |
340 | 341 | .orElse(null); |
341 | 342 | } |
|
0 commit comments