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;
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
.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);
Set<Module> 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);
}
}