-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setting readiness status for the first time (#1839)
- Loading branch information
1 parent
d861cf9
commit 82996cf
Showing
5 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...Test/java/pl/allegro/tech/hermes/integrationtests/management/ReadinessManagementTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pl.allegro.tech.hermes.integrationtests.management; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
import pl.allegro.tech.hermes.api.DatacenterReadiness; | ||
import pl.allegro.tech.hermes.integrationtests.setup.HermesExtension; | ||
|
||
import static pl.allegro.tech.hermes.api.DatacenterReadiness.ReadinessStatus.READY; | ||
import static pl.allegro.tech.hermes.infrastructure.dc.DefaultDatacenterNameProvider.DEFAULT_DC_NAME; | ||
|
||
public class ReadinessManagementTest { | ||
|
||
@RegisterExtension | ||
public static final HermesExtension hermes = new HermesExtension(); | ||
|
||
@Test | ||
public void shouldNotFailWhileSettingReadinessStatusForTheFirstTime() { | ||
//when | ||
hermes.api().setReadiness("unhealthy-dc", false); | ||
|
||
//then | ||
hermes.api().getReadiness() | ||
.expectStatus() | ||
.isOk() | ||
.expectBodyList(DatacenterReadiness.class) | ||
// 'unhealthy-dc' should not be returned here, since it doesn't exist in management configuration | ||
// In this test, we are just verifying if setting readiness status for the first time doesn't break anything. | ||
.hasSize(1) | ||
.contains(new DatacenterReadiness(DEFAULT_DC_NAME, READY)); | ||
} | ||
} |