View Javadoc
1   /*
2    * SPDX-FileCopyrightText: Copyright (c) 2012-2025 Yegor Bugayenko
3    * SPDX-License-Identifier: MIT
4    */
5   package com.jcabi.xml;
6   
7   import org.hamcrest.MatcherAssert;
8   import org.hamcrest.Matchers;
9   import org.junit.jupiter.api.Test;
10  import org.w3c.dom.ls.LSInput;
11  
12  /**
13   * Test case for {@link ClasspathInput}.
14   * @since 0.17.3
15   */
16  final class ClasspathInputTest {
17      @Test
18      void readsStringFromResourceSuccessfully() {
19          final LSInput input = new ClasspathInput(
20              "Id", "com/jcabi/xml/simple.xml"
21          );
22          MatcherAssert.assertThat(
23              "Input XML does not contains expected string, but it should",
24              input.getStringData(),
25              Matchers.containsString("<root>")
26          );
27      }
28  }