0

How would I go about writing a unit test to check if It logged the info.

 public void loadWheels() throws IOException {
        // Connect to Partner process file (if exists)
        SftpSession session = null;
        try {
            session = partnerServerClient.getSession();
            InputStream is = partnerServerClient.getWheelFile(session);
            log.info("File " + partnerServerClient.getConfig().getWheelFilename() + " was found");
            partnerServerClient.backupWheelFile(session);
        }
        catch(IOException e) {
            log.info("" + partnerServerClient.getConfig().getWheelFilename() + "was not found");
        }
        finally {
            // Close the session
            partnerServerClient.closeSession(session);
        }
    }
}

I have tried using private void setLogger but I am confused on how to use it.

Raider44
  • 1
  • 1
  • 2
    Does this answer your question? [How to do a JUnit assert on a message in a logger](https://stackoverflow.com/questions/1827677/how-to-do-a-junit-assert-on-a-message-in-a-logger) – ViaTech Nov 02 '22 at 20:56

0 Answers0