Introduced DomainSpecificRegistry service
[groupbasedpolicy.git] / groupbasedpolicy / src / test / java / org / opendaylight / groupbasedpolicy / base_endpoint / EndpointAugmentorRegistryImplTest.java
1 package org.opendaylight.groupbasedpolicy.base_endpoint;
2
3 import static org.mockito.Mockito.mock;
4
5 import org.junit.Assert;
6 import org.junit.Before;
7 import org.junit.Test;
8 import org.opendaylight.groupbasedpolicy.api.EndpointAugmentor;
9
10 public class EndpointAugmentorRegistryImplTest {
11
12     private EndpointAugmentorRegistryImpl epAugmentorRegistry;
13     private EndpointAugmentor epAugmentor;
14
15     @Before
16     public void init() {
17         epAugmentorRegistry = new EndpointAugmentorRegistryImpl();
18         epAugmentor = mock(EndpointAugmentor.class);
19     }
20
21     @Test
22     public void testRegisterUnregister() throws Exception {
23         epAugmentorRegistry.register(epAugmentor);
24         Assert.assertEquals(1, epAugmentorRegistry.getEndpointAugmentors().size());
25
26         epAugmentorRegistry.unregister(epAugmentor);
27         Assert.assertEquals(0, epAugmentorRegistry.getEndpointAugmentors().size());
28     }
29 }