test_class.declarator: mockedPath = Paths.get("\\tmp")
test_class.original_string: Path mockedPath = Paths.get("\\tmp");
test_class.type: Path
test_class.var_name: mockedPath
test_class.file: cloudraider-core/src/test/java/com/intuit/cloudraider/utils/CommandUtilityTest.java
test_class.identifier: CommandUtilityTest
test_case.body: @Test @Ignore
      public void testCommandUtilityIOException() throws Exception{
  
          PowerMockito.mockStatic(Paths.class);
          PowerMockito.mockStatic(Files.class);
          PowerMockito.mockStatic(ClassLoader.class);
  
          URL url = PowerMockito.mock(URL.class);
          PowerMockito.when(ClassLoader.getSystemResource(Mockito.anyString())).thenReturn(url);
  
          PowerMockito.when(Paths.get(Mockito.anyObject())).thenReturn(mockedPath);
          PowerMockito.when(Files.lines(Mockito.any(Path.class))).thenThrow(new IOException("IO Exception!!"));
  
          List<String> processedCommands = CommandUtility.getCommandsFromFile("test.txt", "nginx");
          Assert.assertNotNull(processedCommands);
          Assert.assertTrue(processedCommands.isEmpty());
      }
test_case.class_method_signature: CommandUtilityTest.testCommandUtilityIOException()
test_case.full_signature: @Test @Ignore public void testCommandUtilityIOException()
test_case.identifier: testCommandUtilityIOException
test_case.invocations: mockStatic mockStatic mockStatic mock thenReturn when getSystemResource anyString thenReturn when get anyObject thenThrow when lines any getCommandsFromFile assertNotNull assertTrue isEmpty
test_case.modifiers: @Test @Ignore public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCommandUtilityIOException()
focal_class.file: cloudraider-core/src/main/java/com/intuit/cloudraider/utils/CommandUtility.java
focal_class.identifier: CommandUtility
focal_class.class_method_signature: CommandUtility.getCommandsFromFile(String fileName, String... params)
focal_class.full_signature: public static List<String> getCommandsFromFile(String fileName, String... params)
focal_class.identifier: getCommandsFromFile
focal_class.modifiers: public static
focal_class.parameters: (String fileName, String... params)
focal_class.return: List<String>
focal_class.signature: List<String> getCommandsFromFile(String fileName, String... params)
focal_method.body: public static List<String> getCommandsFromFile(String fileName, String... params) {
          List<String> commands = new ArrayList<>();
  
          try (Stream<String> stream = Files.lines(Paths.get(ClassLoader.getSystemResource(fileName).toURI()))) {
  
              // stream to ignore comments and empty lines
              // replace parameters using MessageFormat
              commands = stream
                      .filter(line -> !line.startsWith("#") && (!line.isEmpty()))
                      .map(line-> MessageFormat.format(line, params))
                      .collect(Collectors.toList());
  
          } catch (URISyntaxException e) {
              e.printStackTrace();
          } catch (IOException ioe) {
              ioe.printStackTrace();
          }
  
          return commands;
      }
focal_method.class_method_signature: CommandUtility.getCommandsFromFile(String fileName, String... params)
focal_method.full_signature: public static List<String> getCommandsFromFile(String fileName, String... params)
focal_method.identifier: getCommandsFromFile
focal_method.invocations: lines get toURI getSystemResource collect map filter startsWith isEmpty format toList printStackTrace printStackTrace
focal_method.modifiers: public static
focal_method.parameters: (String fileName, String... params)
focal_method.return: List<String>
focal_method.signature: List<String> getCommandsFromFile(String fileName, String... params)