/** * Blue/Green deployments enabled, or not. * * @return boolean */ @JsonIgnore public boolean isEnabled() { return !getColor().isEmpty() || !getColorState().isEmpty(); } }
@Test public void shouldGetClusterInfo() { final ClusterInfo clusterInfo = clusterInfo( () -> "Foo", () -> "Bar" ); assertThat(clusterInfo.getColor(), is("Foo")); assertThat(clusterInfo.getColorState(), is("Bar")); } }
@Test public void shouldCreateStatusRepresentationWithClusterInfo() { // given final ClusterInfo cluster = clusterInfo("BLU", "active"); final StatusRepresentation json = statusRepresentationOf( applicationStatus(mock(ApplicationInfo.class), cluster, mock(SystemInfo.class), mock(VersionInfo.class), mock(TeamInfo.class), emptyList()) ); // then assertThat(json.cluster.getColor(), is("BLU")); assertThat(json.cluster.getColorState(), is("active")); }