Search in sources :

Example 1 with SubscriptionId

use of io.spine.client.SubscriptionId in project core-java by SpineEventEngine.

the class SubscriptionRecordShould method be_equal_if_has_same_subscription.

@Test
public void be_equal_if_has_same_subscription() {
    final Subscription oneSubscription = Given.subscription();
    final SubscriptionId breakingId = Subscriptions.newId("breaking-id");
    final Subscription otherSubscription = Subscription.newBuilder().setId(breakingId).build();
    @SuppressWarnings("QuestionableName") final SubscriptionRecord one = new SubscriptionRecord(oneSubscription, Given.target(), Given.TYPE);
    final SubscriptionRecord similar = new SubscriptionRecord(otherSubscription, Given.target(), Given.TYPE);
    final SubscriptionRecord same = new SubscriptionRecord(oneSubscription, Given.target(), Given.TYPE);
    assertFalse(one.equals(similar));
    assertTrue(one.equals(same));
}
Also used : SubscriptionId(io.spine.client.SubscriptionId) Subscription(io.spine.client.Subscription) Test(org.junit.Test)

Aggregations

Subscription (io.spine.client.Subscription)1 SubscriptionId (io.spine.client.SubscriptionId)1 Test (org.junit.Test)1