diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java index b739f32513..78265769e5 100644 --- a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java +++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/src/test/java/org/openecomp/sdc/destinationprovider/impl/MulticastDestinationTest.java @@ -20,10 +20,10 @@ package org.openecomp.sdc.destinationprovider.impl; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.jupiter.MockitoExtension; import org.openecomp.sdc.notification.services.SubscriptionService; import java.util.Arrays; @@ -31,7 +31,10 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Mockito.doReturn; @@ -39,6 +42,7 @@ import static org.mockito.Mockito.doReturn; * @author avrahamg * @since July 13, 2017 */ +@ExtendWith(MockitoExtension.class) public class MulticastDestinationTest { @Mock private SubscriptionService subscriptionServiceMock; @@ -47,10 +51,6 @@ public class MulticastDestinationTest { private Set<String> subscribers = new HashSet<>(Arrays.asList("a", "b", excludedSubscriber)); private MulticastDestination multicastDestination; - @Before - public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - } @Test public void shouldReturnAllSubscribersIfNoExcludedProvided() throws Exception { @@ -72,13 +72,11 @@ public class MulticastDestinationTest { assertFalse(actualSubscribers.contains(excludedSubscriber)); } - @Test(expected = UnsupportedOperationException.class) - public void shouldThrowUnsupportedOperationExceptionWhenTryingToChangeSubscribersList() throws - Exception { - doReturn(subscribers).when(subscriptionServiceMock).getSubscribers(any()); + @Test + public void entityIdTest() { multicastDestination = - new MulticastDestination("aa", subscriptionServiceMock, excludedSubscriber); - List<String> actualSubscribers = multicastDestination.getSubscribers(); - actualSubscribers.add("sss"); + new MulticastDestination("aa", subscriptionServiceMock, excludedSubscriber); + multicastDestination.setEntityId("entityId"); + assertEquals("entityId", multicastDestination.getEntityId()); } } |