X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-api%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fapi%2FIdentityAttributeRefTest.java;h=5daac19b76f0090ce5695062f10640ce8049129a;hp=6e8ece343f7ca6b0b0bdd126cb5b013fddc5d342;hb=16f30de4a7abe5d2bff35389f74b14990720471b;hpb=9cd4e7995210f8381892004373acc71c8b3ae7af diff --git a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java index 6e8ece343f..5daac19b76 100644 --- a/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java +++ b/opendaylight/config/config-api/src/test/java/org/opendaylight/controller/config/api/IdentityAttributeRefTest.java @@ -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 {} }