コード例 #1
0
 @Test
 public void unmatchedPlaceholdersWithMultipleOccurences() throws FlywayException {
   thrown.expect(FlywayException.class);
   thrown.expectMessage(
       "No value provided for placeholder expressions: ${placeholder}, ${replace}.  Check your configuration!");
   Map<String, String> placeholders = new HashMap<String, String>();
   PlaceholderReplacer placeholderReplacer = new PlaceholderReplacer(placeholders, "${", "}");
   placeholderReplacer.replacePlaceholders(TEST_STR + TEST_STR);
 }
コード例 #2
0
  @Test
  public void exoticPlaceholders() {
    Map<String, String> placeholders = new HashMap<String, String>();
    placeholders.put("left", "right");
    PlaceholderReplacer placeholderReplacer = new PlaceholderReplacer(placeholders, "#[", "]");

    assertEquals(
        "No ${placeholder} right to ${replace}", placeholderReplacer.replacePlaceholders(TEST_STR));
  }
コード例 #3
0
 @Test
 public void unmatchedPlaceholders() throws FlywayException {
   thrown.expect(FlywayException.class);
   thrown.expectMessage(
       "No value provided for placeholder expressions: #[left].  Check your configuration!");
   Map<String, String> placeholders = new HashMap<String, String>();
   PlaceholderReplacer placeholderReplacer = new PlaceholderReplacer(placeholders, "#[", "]");
   placeholderReplacer.replacePlaceholders(TEST_STR);
 }
コード例 #4
0
  @Test
  public void antStylePlaceholders() {
    Map<String, String> placeholders = new HashMap<String, String>();
    placeholders.put("placeholder", "value");
    placeholders.put("replace", "be replaced");
    placeholders.put("dummy", "shouldNotAppear");
    PlaceholderReplacer placeholderReplacer = new PlaceholderReplacer(placeholders, "${", "}");

    assertEquals(
        "No value #[left] to be replaced", placeholderReplacer.replacePlaceholders(TEST_STR));
  }