import org.opendaylight.controller.sal.restconf.impl.StructuredData;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
import org.opendaylight.yangtools.yang.model.api.Module;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
*
- * Fill missing data (namespaces) and build correct data type in
- * {@code compositeNode} according to {@code dataSchemaNode}. The method
- * {@link RestconfImpl#createConfigurationData createConfigurationData} is
- * used because it contains calling of method {code normalizeNode}
+ * Fill missing data (namespaces) and build correct data type in {@code compositeNode} according to
+ * {@code dataSchemaNode}. The method {@link RestconfImpl#createConfigurationData createConfigurationData} is used
+ * because it contains calling of method {code normalizeNode}
*/
public static void normalizeCompositeNode(CompositeNode compositeNode, Set<Module> modules, String schemaNodePath) {
RestconfImpl restconf = RestconfImpl.getInstance();
}
/**
- * Searches module with name {@code searchedModuleName} in {@code modules}.
- * If module name isn't specified and module set has only one element then
- * this element is returned.
+ * Searches module with name {@code searchedModuleName} in {@code modules}. If module name isn't specified and
+ * module set has only one element then this element is returned.
*
*/
public static Module resolveModule(String searchedModuleName, Set<Module> modules) {
controllerContext.setSchemas(TestUtils.loadSchemaContext(modules));
- when(mockedBrokerFacade.commitConfigurationDataPut(any(InstanceIdentifier.class), any(CompositeNode.class)))
+ when(mockedBrokerFacade.commitConfigurationDataPut(any(YangInstanceIdentifier.class), any(CompositeNode.class)))
.thenReturn(
new DummyFuture.Builder().rpcResult(
new DummyRpcResult.Builder<TransactionStatus>().result(TransactionStatus.COMMITED)
ControllerContext.getInstance().setSchemas(loadSchemaContext(modules));
- messageBodyWriter.writeTo(new StructuredData(compositeNode, dataSchemaNode, null), null, null, null, null, null,
- byteArrayOS);
+ messageBodyWriter.writeTo(new StructuredData(compositeNode, dataSchemaNode, null), null, null, null, null,
+ null, byteArrayOS);
return byteArrayOS.toString();
}
return result.toString();
}
- private static Pattern patternForStringsSeparatedByWhiteChars(String ... substrings ) {
+ private static Pattern patternForStringsSeparatedByWhiteChars(String... substrings) {
StringBuilder pattern = new StringBuilder();
pattern.append(".*");
for (String substring : substrings) {
return Pattern.compile(pattern.toString(), Pattern.DOTALL);
}
- public static boolean containsStringData(String jsonOutput,String ...substrings ) {
+ public static boolean containsStringData(String jsonOutput, String... substrings) {
Pattern pattern = patternForStringsSeparatedByWhiteChars(substrings);
Matcher matcher = pattern.matcher(jsonOutput);
return matcher.matches();