X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FURITest.java;h=655aba267fb5574a94e352fcedd3e4727c923a73;hb=c46e223995956f1f759c551163c212947c1e2fb7;hp=33d4b325bef2c6abc6424c044e8a572acb619ac2;hpb=0552aa7d15d9482a9c24062786a743adca4ab74a;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java index 33d4b325be..655aba267f 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/URITest.java @@ -14,9 +14,9 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import com.google.common.collect.Iterables; import java.io.FileNotFoundException; import java.util.Set; - import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; @@ -28,7 +28,7 @@ import org.opendaylight.controller.sal.restconf.impl.ControllerContext; import org.opendaylight.controller.sal.restconf.impl.InstanceIdWithSchemaNode; import org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.controller.sal.restconf.impl.RestconfImpl; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -131,7 +131,7 @@ public class URITest { initMountService(true); InstanceIdWithSchemaNode instanceIdentifier = controllerContext .toInstanceIdentifier("simple-nodes:users/yang-ext:mount/"); - assertEquals(true, instanceIdentifier.getInstanceIdentifier().getPath().isEmpty()); + assertTrue(Iterables.isEmpty(instanceIdentifier.getInstanceIdentifier().getPathArguments())); } @Test @@ -152,7 +152,7 @@ public class URITest { .toInstanceIdentifier("simple-nodes:users/yang-ext:mount/test-interface2:class"); } - public void initMountService(boolean withSchema) { + public void initMountService(final boolean withSchema) { MountService mountService = mock(MountService.class); controllerContext.setMountService(mountService); BrokerFacade brokerFacade = mock(BrokerFacade.class); @@ -163,10 +163,11 @@ public class URITest { Set modules2 = TestUtils.loadModulesFrom("/test-config-data/yang2"); SchemaContext schemaContext2 = TestUtils.loadSchemaContext(modules2); MountInstance mountInstance = mock(MountInstance.class); - if (withSchema) + if (withSchema) { when(mountInstance.getSchemaContext()).thenReturn(schemaContext2); - else + } else { when(mountInstance.getSchemaContext()).thenReturn(null); - when(mountService.getMountPoint(any(InstanceIdentifier.class))).thenReturn(mountInstance); + } + when(mountService.getMountPoint(any(YangInstanceIdentifier.class))).thenReturn(mountInstance); } }