Merge "Unit test for ovsdb.southbound.ovsdb.transact"
[netvirt.git] / utils / servicehelper / src / test / java / org / opendaylight / ovsdb / utils / servicehelper / ServiceHelperTest.java
index 45b05c6a935d3076b21d94d8200e26ceef06dd25..d04b15a970067771ac20cc2d613dc6f6f6786a59 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Red Hat, Inc.
+ *  Copyright (C) 2015 Red Hat, Inc. and others.  All rights reserved.
  *
  *  This program and the accompanying materials are made available under the
  *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -38,13 +38,14 @@ public class ServiceHelperTest {
         Bundle bundle = new MockBundle();
 
         PowerMockito.mockStatic(FrameworkUtil.class);
-        PowerMockito.when(FrameworkUtil.getBundle(any(Class.class)))
-                .thenReturn(null)
-                .thenReturn(bundle);
 
+        PowerMockito.when(FrameworkUtil.getBundle(any(Class.class)))
+                .thenReturn(null);
         Object object = ServiceHelper.getGlobalInstance(Test.class, this);
         assertNull("Service should be null", object);
 
+        PowerMockito.when(FrameworkUtil.getBundle(any(Class.class)))
+                .thenReturn(bundle);
         object = ServiceHelper.getGlobalInstance(Test.class, this);
         assertNotNull("Service should not be null", object);
     }