X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FTestUtils.java;h=67d98f6b558db0a0915928ff869d2a0f123a5b45;hp=449b79923edd40e0c21f922ba3ff6c271e45d3c5;hb=de3e413b633b7555ae8f3fe2ec163dbb7dda5da8;hpb=05565ac29ed2e05fef72379c2d84ca43c01799b2 diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java index 449b79923e..67d98f6b55 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java @@ -51,7 +51,7 @@ import org.opendaylight.controller.sal.restconf.impl.RestconfImpl; 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; @@ -147,10 +147,9 @@ public final class TestUtils { /** * - * 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 modules, String schemaNodePath) { RestconfImpl restconf = RestconfImpl.getInstance(); @@ -161,9 +160,8 @@ public final class TestUtils { } /** - * 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 modules) { @@ -231,7 +229,7 @@ public final class TestUtils { 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().result(TransactionStatus.COMMITED) @@ -279,8 +277,8 @@ public final class TestUtils { 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(); } @@ -298,7 +296,7 @@ public final class TestUtils { 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) { @@ -309,7 +307,7 @@ public final class TestUtils { 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();