|
6 | 6 | import java.time.OffsetDateTime;
|
7 | 7 | import java.util.ArrayList;
|
8 | 8 | import java.util.Arrays;
|
| 9 | +import java.util.Collection; |
9 | 10 | import java.util.Collections;
|
10 | 11 | import java.util.HashMap;
|
11 | 12 | import java.util.List;
|
|
101 | 102 | import static org.hamcrest.CoreMatchers.not;
|
102 | 103 | import static org.hamcrest.Matchers.containsInRelativeOrder;
|
103 | 104 | import static org.hamcrest.Matchers.equalTo;
|
| 105 | +import static org.hamcrest.Matchers.hasItems; |
104 | 106 | import static org.hamcrest.Matchers.is;
|
105 | 107 | import static org.hamcrest.Matchers.nullValue;
|
106 | 108 | import static org.hamcrest.junit.MatcherAssert.assertThat;
|
@@ -1718,6 +1720,27 @@ void whenDomainRecheckOrScheduleStatusUpdateAndAdminOnlyAndAdminServerIsNotReady
|
1718 | 1720 | assertThat(getRecordedDomain(), hasCondition(AVAILABLE).withStatus(FALSE));
|
1719 | 1721 | }
|
1720 | 1722 |
|
| 1723 | + @Test |
| 1724 | + void whenServerStartupInfoIsNull_availableIsFalse() { |
| 1725 | + configureDomain().configureCluster(info, "cluster1").withReplicas(2); |
| 1726 | + info.getReferencedClusters().forEach(testSupport::defineResources); |
| 1727 | + |
| 1728 | + defineScenario() |
| 1729 | + .withCluster("cluster1", "server1", "server2") |
| 1730 | + .build(); |
| 1731 | + info.setServerStartupInfo(null); |
| 1732 | + |
| 1733 | + updateDomainStatus(); |
| 1734 | + |
| 1735 | + assertThat(getClusterConditions(), |
| 1736 | + hasItems(new ClusterCondition(ClusterConditionType.AVAILABLE).withStatus(FALSE))); |
| 1737 | + } |
| 1738 | + |
| 1739 | + private Collection<ClusterCondition> getClusterConditions() { |
| 1740 | + return testSupport.<ClusterResource>getResourceWithName(KubernetesTestSupport.CLUSTER, "cluster1") |
| 1741 | + .getStatus().getConditions(); |
| 1742 | + } |
| 1743 | + |
1721 | 1744 | @SuppressWarnings("SameParameterValue")
|
1722 | 1745 | private ScenarioBuilder defineScenario() {
|
1723 | 1746 | return new ScenarioBuilder();
|
|
0 commit comments