private void printFileContent(Path rootPath, Path fileRelativePath) { File file = rootPath.resolve(fileRelativePath).toFile(); try (FileInputStream fileInputStream = new FileInputStream(file)) { LOGGER.error("===== Printing {} content =====", fileRelativePath.toString()); IOUtils.lineIterator(fileInputStream, "UTF-8").forEachRemaining(OUT::println); } catch (IOException e) { LOGGER.error("Couldn't find {}", file.getAbsolutePath()); } } }
public final void checkToastrSuccessMessage(String expectedMessage) { List<String> foundMessages = new ArrayList<>(); IOUtils.lineIterator(new StringReader(getLastResponse().getDocument())) .forEachRemaining( line -> { if (line.startsWith("toastr.success")) { String message = extractMessage(line); foundMessages.add(message); } } ); if (!foundMessages.contains(expectedMessage)) { throw new AssertionError(String.format("Não foi possível encontrar a mensagem '%s', mensagens encontradas: '%s'", expectedMessage, foundMessages)); } }
for (Resource locator : locators) { try (InputStream is = locator.getInputStream()) { IOUtils.lineIterator(is, "UTF-8").forEachRemaining(l -> patterns.add(l));
for (Resource locator : locators) { try (InputStream is = locator.getInputStream()) { IOUtils.lineIterator(is, "UTF-8").forEachRemaining(l -> patterns.add(l));