Update IdentityAttributeRefTest
[controller.git] / opendaylight / config / config-api / src / test / java / org / opendaylight / controller / config / api / IdentityAttributeRefTest.java
index 6e8ece343f7ca6b0b0bdd126cb5b013fddc5d342..5daac19b76f0090ce5695062f10640ce8049129a 100644 (file)
@@ -1,17 +1,22 @@
+/*
+ * Copyright (c) 2014, 2017 Cisco Systems, 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,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
 package org.opendaylight.controller.config.api;
 
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
 import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 
-import javax.management.*;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.*;
-
 public class IdentityAttributeRefTest {
 
     IdentityAttributeRef attr = new IdentityAttributeRef("attr");
@@ -24,7 +29,7 @@ public class IdentityAttributeRefTest {
 
     @Test(expected = NullPointerException.class)
     public void testConstructor2() throws Exception {
-        IdentityAttributeRef attr = new IdentityAttributeRef(null);
+        new IdentityAttributeRef(null);
     }
 
     @Test
@@ -50,10 +55,10 @@ public class IdentityAttributeRefTest {
     @Test
     public void testResolveIdentity() throws Exception {
         DependencyResolver res = mock(DependencyResolver.class);
-        IdentityAttributeRef a = new IdentityAttributeRef("abcd");
-        doReturn(SubIdentity.class).when(res).resolveIdentity(a, Identity.class);
-        a.resolveIdentity(res, Identity.class);
-        verify(res).resolveIdentity(a, Identity.class);
+        IdentityAttributeRef identityAttributeRef = new IdentityAttributeRef("abcd");
+        doReturn(SubIdentity.class).when(res).resolveIdentity(identityAttributeRef, Identity.class);
+        identityAttributeRef.resolveIdentity(res, Identity.class);
+        verify(res).resolveIdentity(identityAttributeRef, Identity.class);
     }
 
     @Test
@@ -65,7 +70,7 @@ public class IdentityAttributeRefTest {
         verify(res).validateIdentity(attr, Identity.class, jmxAttr);
     }
 
-    static class Identity extends BaseIdentity {}
+    interface Identity extends BaseIdentity {}
 
-    static class SubIdentity extends Identity {}
+    interface SubIdentity extends Identity {}
 }