Update IdentityAttributeRefTest
[controller.git] / opendaylight / config / config-api / src / test / java / org / opendaylight / controller / config / api / IdentityAttributeRefTest.java
index 91e1f14849c03364f57f67b28eee5ff2d6017f8c..5daac19b76f0090ce5695062f10640ce8049129a 100644 (file)
@@ -1,9 +1,18 @@
+/*
+ * 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.opendaylight.yangtools.yang.binding.BaseIdentity;
@@ -20,7 +29,7 @@ public class IdentityAttributeRefTest {
 
     @Test(expected = NullPointerException.class)
     public void testConstructor2() throws Exception {
-        IdentityAttributeRef attr = new IdentityAttributeRef(null);
+        new IdentityAttributeRef(null);
     }
 
     @Test
@@ -46,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
@@ -61,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 {}
 }