Add 'features/protocol-framework/' from commit 'cb42405784db97d0ce2c5991d12a89b46d185949'
[netconf.git] / netconf / yanglib / src / test / java / org / opendaylight / yanglib / impl / YangLibRestAppTest.java
index bba2c2913799bdc72573294b950844be80252c68..62b81599db10ba7911872e0aeedb4e953cfd5f47 100644 (file)
@@ -9,17 +9,16 @@
 package org.opendaylight.yanglib.impl;
 
 import static junit.framework.TestCase.assertTrue;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.then;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
 
 import java.util.Set;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.mockito.BDDMockito;
 import org.opendaylight.yanglib.api.YangLibRestAppService;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -39,14 +38,15 @@ public class YangLibRestAppTest {
         final BundleContext bundleContext = mock(BundleContext.class);
         final Bundle bundle = mock(Bundle.class);
 
-        BDDMockito.given(FrameworkUtil.getBundle(any())).willReturn(bundle);
-        when(bundle.getBundleContext()).thenReturn(bundleContext);
+        given(FrameworkUtil.getBundle(any())).willReturn(bundle);
+        given(bundle.getBundleContext()).willReturn(bundleContext);
 
         final YangLibRestApp yangLibRestApp = new YangLibRestApp();
         final Set singleton = yangLibRestApp.getSingletons();
 
         assertTrue(singleton.contains(yangLibRestApp.getYangLibService()));
 
-        verify(bundleContext, times(1)).registerService(eq(YangLibRestAppService.class.getName()), eq(yangLibRestApp), eq(null));
+        then(bundleContext).should(times(1))
+                .registerService(eq(YangLibRestAppService.class.getName()), eq(yangLibRestApp), eq(null));
     }
 }