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=18703040ee89ef6c7fff33bb57d9ced739aa6d0f;hb=refs%2Fchanges%2F27%2F8927%2F3;hp=33d4b325bef2c6abc6424c044e8a572acb619ac2;hpb=b80124e3f7b11cf2f5e5bd4a6b033d855ff4d0d4;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..18703040ee 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; @@ -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); } }