@Test public void testGetCountOfMessagesShouldReturnWithZeroWhenTheMessageFolderDoesNotExists() { given(propertyHolder.get("log.folder")).willReturn("src/test/resources/something"); int result = underTest.getCountOfMessages(); Assert.assertEquals(result, 0); }
public int getCountOfMessages() { int result; getMessagesFolderPath(); try { File folder = new File(messagesFolderPath); folder = folder.getAbsoluteFile(); result = folder.listFiles().length; } catch (NullPointerException e) { logger.debug(FOLDER_ERROR_MESSAGE, e); result = 0; } return result; }
MessageFileCounter { public int getCountOfMessages() { int result; getMessagesFolderPath(); try { File folder = new File(messagesFolderPath); folder = folder.getAbsoluteFile(); result = folder.listFiles().length; } catch (NullPointerException e) { logger.debug(FOLDER_ERROR_MESSAGE, e); result = 0; } return result; } }
MessageFileCounter { public int getCountOfMessages() { int result; getMessagesFolderPath(); try { File folder = new File(messagesFolderPath); folder = folder.getAbsoluteFile(); result = folder.listFiles().length; } catch (NullPointerException e) { logger.debug(FOLDER_ERROR_MESSAGE, e); result = 0; } return result; }  }
MessageFileCounter { public int getCountOfMessages() { int result; getMessagesFolderPath(); try { File folder = new File(messagesFolderPath); folder = folder.getAbsoluteFile(); result = folder.listFiles().length; } catch (NullPointerException e) { logger.debug(FOLDER_ERROR_MESSAGE, e); result = 0; } return result; }  int getCountOfMessages(); }
MessageFileCounter { public int getCountOfMessages() { int result; getMessagesFolderPath(); try { File folder = new File(messagesFolderPath); folder = folder.getAbsoluteFile(); result = folder.listFiles().length; } catch (NullPointerException e) { logger.debug(FOLDER_ERROR_MESSAGE, e); result = 0; } return result; }  int getCountOfMessages();  }