@@ -332,8 +332,7 @@ void whenStatusUnchanged_statusStepDoesNotUpdateDomain() {
332
332
.withStateGoal (SHUTDOWN_STATE )
333
333
.withServerName ("server1" )
334
334
.withHealth (overallHealth ("health1" ))))
335
- .addCondition (new DomainCondition (AVAILABLE ).withStatus (false )
336
- .withMessage (LOGGER .formatMessage (NO_APPLICATION_SERVERS_READY )))
335
+ .addCondition (new DomainCondition (AVAILABLE ).withStatus (true ))
337
336
.addCondition (new DomainCondition (COMPLETED ).withStatus (true )));
338
337
339
338
testSupport .clearNumCalls ();
@@ -1041,15 +1040,15 @@ void whenNumServersStartedBelowMinReplicasForDynamicClusterAndAllowed_domainIsAv
1041
1040
}
1042
1041
1043
1042
@ Test
1044
- void whenReplicaCountIsZero_domainIsNotAvailable () {
1043
+ void whenReplicaCountIsZeroAndAdminServerRunning_domainIsAvailable () {
1045
1044
defineScenario ()
1046
1045
.withDynamicCluster ("cluster1" , 3 , 4 )
1047
1046
.notStarting ("ms1" , "ms2" , "ms3" , "ms4" )
1048
1047
.build ();
1049
1048
1050
1049
updateDomainStatus ();
1051
1050
1052
- assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (FALSE ));
1051
+ assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (TRUE ));
1053
1052
}
1054
1053
1055
1054
@ Test
@@ -1108,7 +1107,7 @@ void whenReplicaCountNotWithinMaxUnavailableOfReplicas_establishClusterAvailable
1108
1107
}
1109
1108
1110
1109
@ Test
1111
- void whenClusterIsIntentionallyShutdown_establishClusterAvailableConditionTrue () {
1110
+ void whenClusterIsIntentionallyShutdown_establishClusterAvailableConditionFalse () {
1112
1111
configureDomain ().configureCluster (info , "cluster1" ).withReplicas (0 ).withMaxUnavailable (1 );
1113
1112
defineScenario ().withDynamicCluster ("cluster1" , 0 , 0 ).build ();
1114
1113
info .getReferencedClusters ().forEach (testSupport ::defineResources );
@@ -1119,7 +1118,7 @@ void whenClusterIsIntentionallyShutdown_establishClusterAvailableConditionTrue()
1119
1118
assertThat (clusterStatus .getConditions ().size (), equalTo (2 ));
1120
1119
ClusterCondition condition = clusterStatus .getConditions ().get (0 );
1121
1120
assertThat (condition .getType (), equalTo (ClusterConditionType .AVAILABLE ));
1122
- assertThat (condition .getStatus (), equalTo (TRUE ));
1121
+ assertThat (condition .getStatus (), equalTo (FALSE ));
1123
1122
}
1124
1123
1125
1124
@ Test
@@ -1267,15 +1266,15 @@ void withAllServersShutdown_domainIsCompleted() { // !!!! can the admin server
1267
1266
}
1268
1267
1269
1268
@ Test
1270
- void withClusterIntentionallyShutdown_domainIsCompleted () {
1269
+ void withClusterIntentionallyShutdownAndAdminServerRunning_domainIsAvailableAndCompleted () {
1271
1270
defineScenario ()
1272
1271
.withCluster ("cluster1" , "ms1" , "ms2" )
1273
1272
.notStarting ("ms1" , "ms2" )
1274
1273
.build ();
1275
1274
1276
1275
updateDomainStatus ();
1277
1276
1278
- assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (FALSE ));
1277
+ assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (TRUE ));
1279
1278
assertThat (getRecordedDomain (), hasCondition (COMPLETED ).withStatus (TRUE ));
1280
1279
}
1281
1280
@@ -1621,6 +1620,16 @@ void whenAdminOnlyAndAdminServerIsReady_availableIsTrue() {
1621
1620
assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (TRUE ));
1622
1621
}
1623
1622
1623
+ @ Test
1624
+ void whenDomainHasNeverStartPolicy_completedIsTrue () {
1625
+ configureDomain ().withDefaultServerStartPolicy (ServerStartPolicy .NEVER );
1626
+ defineScenario ().build ();
1627
+
1628
+ updateDomainStatus ();
1629
+
1630
+ assertThat (getRecordedDomain (), hasCondition (COMPLETED ).withStatus (TRUE ));
1631
+ }
1632
+
1624
1633
@ Test
1625
1634
void whenAdminOnlyAndAdminServerIsNotReady_availableIsFalse () {
1626
1635
configureDomain ().withDefaultServerStartPolicy (ServerStartPolicy .ADMIN_ONLY );
@@ -1736,11 +1745,56 @@ void whenServerStartupInfoIsNull_availableIsFalse() {
1736
1745
hasItems (new ClusterCondition (ClusterConditionType .AVAILABLE ).withStatus (FALSE )));
1737
1746
}
1738
1747
1748
+ @ Test
1749
+ void whenDomainOnlyHasAdminServer_availableIsTrue () {
1750
+ configureDomain ().configureAdminServer ();
1751
+ defineScenario ().build ();
1752
+
1753
+ updateDomainStatus ();
1754
+
1755
+ assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (TRUE ));
1756
+ }
1757
+
1739
1758
private Collection <ClusterCondition > getClusterConditions () {
1740
1759
return testSupport .<ClusterResource >getResourceWithName (KubernetesTestSupport .CLUSTER , "cluster1" )
1741
1760
.getStatus ().getConditions ();
1742
1761
}
1743
1762
1763
+ @ Test
1764
+ void whenClusterIntentionallyShutdown_clusterAvailableIsFalseAndDomainAvailableIsTrue () {
1765
+ configureDomain ()
1766
+ .configureCluster (info , "cluster1" ).withReplicas (0 );
1767
+ info .getReferencedClusters ().forEach (testSupport ::defineResources );
1768
+ defineScenario ()
1769
+ .withCluster ("cluster1" , "server1" , "server2" )
1770
+ .notStarting ("server1" , "server2" )
1771
+ .build ();
1772
+
1773
+ updateDomainStatus ();
1774
+
1775
+ assertThat (getClusterConditions (),
1776
+ hasItems (new ClusterCondition (ClusterConditionType .AVAILABLE ).withStatus (FALSE )));
1777
+ assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (TRUE ));
1778
+ }
1779
+
1780
+ @ Test
1781
+ void whenClusterIntentionallyShutdownAndSSINotConstructed_clusterAndDomainAvailableIsFalse () {
1782
+ configureDomain ()
1783
+ .configureCluster (info , "cluster1" ).withReplicas (0 );
1784
+ info .getReferencedClusters ().forEach (testSupport ::defineResources );
1785
+ defineScenario ()
1786
+ .withCluster ("cluster1" , "server1" , "server2" )
1787
+ .notStarting ("server1" , "server2" )
1788
+ .build ();
1789
+ info .setServerStartupInfo (null );
1790
+
1791
+ updateDomainStatus ();
1792
+
1793
+ assertThat (getClusterConditions (),
1794
+ hasItems (new ClusterCondition (ClusterConditionType .AVAILABLE ).withStatus (FALSE )));
1795
+ assertThat (getRecordedDomain (), hasCondition (AVAILABLE ).withStatus (FALSE ));
1796
+ }
1797
+
1744
1798
@ SuppressWarnings ("SameParameterValue" )
1745
1799
private ScenarioBuilder defineScenario () {
1746
1800
return new ScenarioBuilder ();
0 commit comments