2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertThrows;
13 import org.junit.Test;
14 import org.opendaylight.mdsal.binding.dom.codec.api.IncorrectNestingException;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.md.sal.knock.knock.rev180723.KnockKnockInput;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18 public class Mdsal724Test extends AbstractBindingCodecTest {
20 public void testRpcInputInstanceIdentifier() {
21 // An InstanceIdentifier pointing at a notification, unsafe to create
22 @SuppressWarnings({ "rawtypes", "unchecked" })
23 final var iid = InstanceIdentifier.create((Class) KnockKnockInput.class);
24 final var ex = assertThrows(IncorrectNestingException.class, () -> codecContext.toYangInstanceIdentifier(iid));
25 assertEquals("interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.md.sal.knock.knock."
26 + "rev180723.KnockKnockInput is not top-level item.", ex.getMessage());