@Test public void returnNameWithArgumentPlaceholdersTest() { when(step.getName()).thenReturn("This is a name with an argument inside."); Result result = mock(Result.class); List<Argument> arguments = new ArrayList<>(); Argument argument = new Argument(); argument.setVal("argument"); arguments.add(argument); when(step.getArguments()).thenReturn(arguments); step.setResult(result); assertThat(step.returnNameWithArgumentPlaceholders(), is("This is a name with an {} inside.")); }
public String returnNameWithArgumentPlaceholders() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("{}")); } } return tmpName; }
Step extends ResultMatch { public String returnNameWithArgumentPlaceholders() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("{}")); } } return tmpName; } }
Step extends ResultMatch { public String returnNameWithArgumentPlaceholders() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("{}")); } } return tmpName; }  }
Step extends ResultMatch { public String returnNameWithArgumentPlaceholders() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("{}")); } } return tmpName; }  List<ResultMatch> getBefore(); void setBefore(final List<ResultMatch> before); int getLine(); void setLine(final int line); String getName(); void setName(final String name); String returnNameWithArguments(); String returnNameWithArgumentPlaceholders(); String getKeyword(); void setKeyword(final String keyword); List<Row> getRows(); void setRows(final List<Row> rows); List<ResultMatch> getAfter(); void setAfter(final List<ResultMatch> after); DocString getDocString(); void setDocString(final DocString docString); long getTotalDuration(); String returnTotalDurationString(); String getUrlFriendlyName(); @Override boolean equals(final Object o); @Override int hashCode(); }
Step extends ResultMatch { public String returnNameWithArgumentPlaceholders() { String tmpName = getName(); List<Argument> arguments = getArguments(); for (int i = arguments.size() - 1; i >= 0; i--) { String argument = arguments.get(i).getVal(); if (argument != null) { tmpName = tmpName.replaceFirst(Pattern.quote(argument), Matcher.quoteReplacement("{}")); } } return tmpName; }  List<ResultMatch> getBefore(); void setBefore(final List<ResultMatch> before); int getLine(); void setLine(final int line); String getName(); void setName(final String name); String returnNameWithArguments(); String returnNameWithArgumentPlaceholders(); String getKeyword(); void setKeyword(final String keyword); List<Row> getRows(); void setRows(final List<Row> rows); List<ResultMatch> getAfter(); void setAfter(final List<ResultMatch> after); DocString getDocString(); void setDocString(final DocString docString); long getTotalDuration(); String returnTotalDurationString(); String getUrlFriendlyName(); @Override boolean equals(final Object o); @Override int hashCode();  }