SubscriptionsDescriptor { @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof SubscriptionsDescriptor)) return false; final SubscriptionsDescriptor that = (SubscriptionsDescriptor) o; return Objects.equals(specVersion, that.specVersion) && Objects.equals(service, that.service) && Objects.equals(serviceComponent, that.serviceComponent) && Objects.equals(prioritisation, that.prioritisation) && Objects.equals(subscriptions, that.subscriptions); } SubscriptionsDescriptor(final String specVersion,
                                   final String service,
                                   final String serviceComponent,
                                   final int prioritisation,
                                   final List<Subscription> subscriptions); String getSpecVersion(); String getService(); String getServiceComponent(); int getPrioritisation(); List<Subscription> getSubscriptions(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldReturnFalseForDifferentSubscriptionNameQualifiers() { final String specVersion1 = "1.0"; final String service1 = "service1"; final String serviceComponent1 = "EVENT_LISTENER"; final List<Subscription> subscriptions1 = new ArrayList<>(); final String specVersion2 = "2.0"; final String service2 = "service2"; final String serviceComponent2 = "EVENT_PROCESSOR"; final List<Subscription> subscriptions2 = new ArrayList<>(); final SubscriptionsDescriptor subscriptionsDescriptor1 = new SubscriptionsDescriptor(specVersion1, service1, serviceComponent1, 1, subscriptions1); final SubscriptionsDescriptor subscriptionsDescriptor2 = new SubscriptionsDescriptor(specVersion2, service2, serviceComponent2, 1, subscriptions2); assertFalse(subscriptionsDescriptor1.equals(subscriptionsDescriptor2)); }
@Test public void shouldReturnTrueForSameSubscriptionNameQualifiers() { final String specVersion = "1.0"; final String service = "service"; final String serviceComponent = "EVENT_LISTENER"; final int prioritisation = 1; final List<Subscription> subscriptions = new ArrayList<>(); final SubscriptionsDescriptor subscriptionsDescriptor1 = new SubscriptionsDescriptor(specVersion, service, serviceComponent, prioritisation, subscriptions); final SubscriptionsDescriptor subscriptionsDescriptor2 = new SubscriptionsDescriptor(specVersion, service, serviceComponent, prioritisation, subscriptions); assertTrue(subscriptionsDescriptor1.equals(subscriptionsDescriptor2)); }