- try {
- try (InputStream stream1 = new FileInputStream(yang1); InputStream stream2 = new FileInputStream(yang2)) {
- TestUtils.loadModules(Arrays.asList(stream1, stream2));
- fail("IllegalArgumentException should be thrown");
- }
- } catch (IllegalArgumentException e) {
- String expected = "An augment cannot add node 'linkleaf' because it is mandatory and in module different from target";
- assertEquals(expected, e.getMessage());
+ try (InputStream stream1 = new NamedFileInputStream(yang1, yang1.getPath());
+ InputStream stream2 = new NamedFileInputStream(yang2, yang2.getPath())) {
+ TestUtils.loadModules(Arrays.asList(stream1, stream2));
+ testLog = output.toString();
+ assertTrue(testLog.contains(
+ "An augment cannot add node 'linkleaf' because it is mandatory and in module different from target"));