*/
package org.opendaylight.yangtools.yang.stmt;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import com.google.common.collect.ImmutableSet;
import java.util.Optional;
-import org.junit.Test;
+import java.util.Set;
+import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.stmt.FeatureEffectiveStatement;
-public class Bug8922Test extends AbstractYangTest {
+class Bug8922Test extends AbstractYangTest {
private static final QName MY_CON = QName.create("foo", "my-con");
private static final QName TARGET = QName.create("foo", "target");
@Test
- public void testAllFeaturesSupported() {
+ void testAllFeaturesSupported() {
final var context = assertEffectiveModel("/bugs/bug8922/foo.yang");
- final var findNode = context.findDataTreeChild(TARGET, MY_CON).get();
- assertThat(findNode, instanceOf(ContainerSchemaNode.class));
+ final var findNode = assertInstanceOf(ContainerSchemaNode.class,
+ context.findDataTreeChild(TARGET, MY_CON).orElseThrow());
assertEquals(Optional.of("New description"), findNode.getDescription());
assertEquals(1, context.findModuleStatements("foo").iterator().next()
}
@Test
- public void testNoFeatureSupported() throws Exception {
- final var context = StmtTestUtils.parseYangSource("/bugs/bug8922/foo.yang", ImmutableSet.of());
+ void testNoFeatureSupported() throws Exception {
+ final var context = StmtTestUtils.parseYangSource("/bugs/bug8922/foo.yang", Set.of());
assertNotNull(context);
assertEquals(Optional.empty(), context.findDataTreeChild(TARGET, MY_CON));
- assertTrue(context.getAvailableAugmentations().isEmpty());
+ assertEquals(Set.of(), context.getAvailableAugmentations());
assertEquals(0, context.findModuleStatements("foo").iterator().next()
.streamEffectiveSubstatements(FeatureEffectiveStatement.class).count());