@Test(dataProvider = "hasADifferentTagData") public void testHasADifferentTag(String fromInstruction, String tagToCheck, boolean expectedResult) { assertEquals(new FromInstruction(fromInstruction).hasADifferentTag(tagToCheck), expectedResult); }
public boolean hasADifferentTag(String expectedTag) { if (tag == null && expectedTag == null) { return false; } if (tag == null || expectedTag == null) { return true; } return !tag.trim().equals(expectedTag.trim()); }
FromInstruction { public boolean hasADifferentTag(String expectedTag) { if (tag == null && expectedTag == null) { return false; } if (tag == null || expectedTag == null) { return true; } return !tag.trim().equals(expectedTag.trim()); } }
FromInstruction { public boolean hasADifferentTag(String expectedTag) { if (tag == null && expectedTag == null) { return false; } if (tag == null || expectedTag == null) { return true; } return !tag.trim().equals(expectedTag.trim()); } FromInstruction(String fromInstructionLine); private  FromInstruction(String baseImageName, String tag, List<String> additionalParts, String comments); }
FromInstruction { public boolean hasADifferentTag(String expectedTag) { if (tag == null && expectedTag == null) { return false; } if (tag == null || expectedTag == null) { return true; } return !tag.trim().equals(expectedTag.trim()); } 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 boolean hasADifferentTag(String expectedTag) { if (tag == null && expectedTag == null) { return false; } if (tag == null || expectedTag == null) { return true; } return !tag.trim().equals(expectedTag.trim()); } 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();  }