@Test(dataProvider = "isFromInstructionWithThisImageAndOlderTagData") public void isFromInstructionWithThisImageAndOlderTag(String line, String imageName, String imageTag, boolean expectedResult) { assertEquals(FromInstruction.isFromInstructionWithThisImageAndOlderTag(line, imageName, imageTag), expectedResult); }
public static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag) { if (FromInstruction.isFromInstruction(lineInFile)) { FromInstruction fromInstruction = new FromInstruction(lineInFile); return fromInstruction.hasBaseImage(imageName) && fromInstruction.hasADifferentTag(imageTag); } return false; }
FromInstruction { public static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag) { if (FromInstruction.isFromInstruction(lineInFile)) { FromInstruction fromInstruction = new FromInstruction(lineInFile); return fromInstruction.hasBaseImage(imageName) && fromInstruction.hasADifferentTag(imageTag); } return false; } }
FromInstruction { public static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag) { if (FromInstruction.isFromInstruction(lineInFile)) { FromInstruction fromInstruction = new FromInstruction(lineInFile); return fromInstruction.hasBaseImage(imageName) && fromInstruction.hasADifferentTag(imageTag); } return false; } FromInstruction(String fromInstructionLine); private  FromInstruction(String baseImageName, String tag, List<String> additionalParts, String comments); }
FromInstruction { public static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag) { if (FromInstruction.isFromInstruction(lineInFile)) { FromInstruction fromInstruction = new FromInstruction(lineInFile); return fromInstruction.hasBaseImage(imageName) && fromInstruction.hasADifferentTag(imageTag); } return false; } FromInstruction(String fromInstructionLine); private  FromInstruction(String baseImageName, String tag, List<String> additionalParts, String comments); static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag); FromInstruction getFromInstructionWithNewTag(String newTag); static boolean isFromInstruction(String dockerFileLine); @Override String toString(); String getBaseImageName(); boolean hasBaseImage(String imageToFind); boolean hasTag(); boolean hasADifferentTag(String expectedTag); String getTag(); List<String> getAdditionalParts(); boolean hasComments(); String getComments(); }
FromInstruction { public static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag) { if (FromInstruction.isFromInstruction(lineInFile)) { FromInstruction fromInstruction = new FromInstruction(lineInFile); return fromInstruction.hasBaseImage(imageName) && fromInstruction.hasADifferentTag(imageTag); } return false; } FromInstruction(String fromInstructionLine); private  FromInstruction(String baseImageName, String tag, List<String> additionalParts, String comments); static boolean isFromInstructionWithThisImageAndOlderTag(String lineInFile, String imageName, String imageTag); FromInstruction getFromInstructionWithNewTag(String newTag); static boolean isFromInstruction(String dockerFileLine); @Override String toString(); String getBaseImageName(); boolean hasBaseImage(String imageToFind); boolean hasTag(); boolean hasADifferentTag(String expectedTag); String getTag(); List<String> getAdditionalParts(); boolean hasComments(); String getComments();  }