All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.eureka2.testkit.junit.EurekaMatchers Maven / Gradle / Ivy

The newest version!
package com.netflix.eureka2.testkit.junit;

import com.netflix.eureka2.interests.ChangeNotification;
import com.netflix.eureka2.interests.ChangeNotification.Kind;
import com.netflix.eureka2.registry.InstanceInfo;
import com.netflix.eureka2.testkit.junit.matchers.ChangeNotificationMatcher;
import com.netflix.eureka2.testkit.junit.matchers.InstanceInfoMatcher;
import org.hamcrest.Matcher;

/**
 * @author Tomasz Bak
 */
public final class EurekaMatchers {

    private EurekaMatchers() {
    }

    public static Matcher sameInstanceInfoAs(InstanceInfo expectedValue) {
        return new InstanceInfoMatcher(expectedValue, false);
    }

    public static Matcher identicalInstanceInfoAs(InstanceInfo expectedValue) {
        return new InstanceInfoMatcher(expectedValue, true);
    }

    public static Matcher> addChangeNotificationOf(InstanceInfo expectedValue) {
        return new ChangeNotificationMatcher(Kind.Add, expectedValue);
    }

    public static Matcher> modifyChangeNotificationOf(InstanceInfo expectedValue) {
        return new ChangeNotificationMatcher(Kind.Modify, expectedValue);
    }

    public static Matcher> deleteChangeNotificationOf(InstanceInfo expectedValue) {
        return new ChangeNotificationMatcher(Kind.Delete, expectedValue);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy