@Test
public void testStringContainsVersionHardcode() throws Exception {

  Pattern pattern = HardcodedStackVersionPropertiesCheck.getHardcodeSearchPattern(currentVersion);
  // Check various cases
  String content = "";
  assertFalse(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
  content = "2.3.4.0-1234";
  assertTrue(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
  content = "dfsdfds fdsfds -Dhdp.version=2.3.4.0-1234 sfdfdsfds";
  assertFalse(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
  content = "dfsdfds fdsfds -Dhdp.version=2.3.4.0-1234 \n sfdfdsfds 2.3.4.0-1234 \n fdsfds";
  assertTrue(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
  content = "hdp.version=2.3.4.0-1234";
  assertTrue(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
  content = "kgflkfld fdf\nld;ls;f d hdp.version=2.3.4.0-1234 \n sfdfdsfds \n fdsfds";
  assertTrue(HardcodedStackVersionPropertiesCheck.stringContainsVersionHardcode(content, pattern));
}