import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import com.google.common.collect.ImmutableMap;
import java.io.IOException;
import java.io.InputStream;
import java.text.ParseException;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.common.errors.RestconfError;
import org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy;
-import org.opendaylight.restconf.server.api.DataPutPath;
+import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy.StrategyAndPath;
import org.opendaylight.restconf.server.api.DatabindContext;
+import org.opendaylight.restconf.server.api.ResourceBody;
+import org.opendaylight.restconf.server.api.ServerException;
import org.opendaylight.yangtools.yang.common.ErrorTag;
import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.QName;
throw new AssertionError(e);
}
- final var strategy = new MdsalRestconfStrategy(DATABIND, dataBroker, null, null, null, mountPointService);
- final var stratAndPath = strategy.resolveStrategyPath(apiPath);
+ final var strategy = new MdsalRestconfStrategy(DATABIND, dataBroker, ImmutableMap.of(), null, null, null,
+ mountPointService);
+ final StrategyAndPath stratAndPath;
+ try {
+ stratAndPath = strategy.resolveStrategyPath(apiPath);
+ } catch (ServerException e) {
+ throw new AssertionError(e);
+ }
try (var body = bodyConstructor.apply(stringInputStream(patchBody))) {
- return body.toNormalizedNode(new DataPutPath(stratAndPath.strategy().databind(),
- stratAndPath.path().inference(), stratAndPath.path().instance()));
+ return body.toNormalizedNode(stratAndPath.path());
}
}