use of com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent in project titus-control-plane by Netflix.
the class AbstractKubeMembershipExecutorTest method expectClusterMembershipChangeEvent.
private void expectClusterMembershipChangeEvent(ClusterMembershipRevision<ClusterMember> revision, ClusterMembershipChangeEvent.ChangeType changeType) throws InterruptedException {
ClusterMembershipChangeEvent memberEvent = findNextMemberEvent(revision.getCurrent().getMemberId());
assertThat(memberEvent.getChangeType()).isEqualTo(changeType);
assertThat(memberEvent.getRevision()).isEqualTo(revision);
}
use of com.netflix.titus.api.clustermembership.model.event.ClusterMembershipChangeEvent in project titus-control-plane by Netflix.
the class KubeClusterMembershipConnectorTest method doRegistrationChange.
private ClusterMembershipRevision<ClusterMember> doRegistrationChange(Supplier<ClusterMembershipRevision<ClusterMember>> action) throws InterruptedException {
long now = titusRuntime.getClock().wallTime();
ClusterMembershipRevision<ClusterMember> newRevision = action.get();
assertThat(newRevision.getTimestamp()).isGreaterThanOrEqualTo(now);
assertThat(connector.getLocalClusterMemberRevision()).isEqualTo(newRevision);
ClusterMembershipEvent registrationEvent1 = connectorEvents.takeNext(TIMEOUT);
assertThat(registrationEvent1).isInstanceOf(ClusterMembershipChangeEvent.class);
assertThat(((ClusterMembershipChangeEvent) registrationEvent1).getChangeType()).isEqualTo(ClusterMembershipChangeEvent.ChangeType.Updated);
return newRevision;
}
Aggregations