@Test public void getTitleWithIntArray() { int[] firstArg = {1, 2, 3}; String title = getTitle(NAME_PATTERN_WITH_TWO_ARGS, METHOD_NAME, null, new Object[]{firstArg, true}); Object[] args = {METHOD_NAME, Arrays.toString(firstArg), true}; assertThat("Method with int[] and String arguments is processed incorrectly", title, equalTo(MessageFormat.format(TITLE_STRING_WITH_TWO_ARGS, args))); }
public static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters) { String finalPattern = namePattern .replaceAll("\\{method\\}", methodName) .replaceAll("\\{this\\}", String.valueOf(instance)); int paramsCount = parameters == null ? 0 : parameters.length; Object[] results = new Object[paramsCount]; for (int i = 0; i < paramsCount; i++) { results[i] = arrayToString(parameters[i]); } return cutEnd(MessageFormat.format(finalPattern, results), AllureConfig.newInstance().getMaxTitleLength()); }
AllureAspectUtils { public static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters) { String finalPattern = namePattern .replaceAll("\\{method\\}", methodName) .replaceAll("\\{this\\}", String.valueOf(instance)); int paramsCount = parameters == null ? 0 : parameters.length; Object[] results = new Object[paramsCount]; for (int i = 0; i < paramsCount; i++) { results[i] = arrayToString(parameters[i]); } return cutEnd(MessageFormat.format(finalPattern, results), AllureConfig.newInstance().getMaxTitleLength()); } }
AllureAspectUtils { public static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters) { String finalPattern = namePattern .replaceAll("\\{method\\}", methodName) .replaceAll("\\{this\\}", String.valueOf(instance)); int paramsCount = parameters == null ? 0 : parameters.length; Object[] results = new Object[paramsCount]; for (int i = 0; i < paramsCount; i++) { results[i] = arrayToString(parameters[i]); } return cutEnd(MessageFormat.format(finalPattern, results), AllureConfig.newInstance().getMaxTitleLength()); } private  AllureAspectUtils(); }
AllureAspectUtils { public static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters) { String finalPattern = namePattern .replaceAll("\\{method\\}", methodName) .replaceAll("\\{this\\}", String.valueOf(instance)); int paramsCount = parameters == null ? 0 : parameters.length; Object[] results = new Object[paramsCount]; for (int i = 0; i < paramsCount; i++) { results[i] = arrayToString(parameters[i]); } return cutEnd(MessageFormat.format(finalPattern, results), AllureConfig.newInstance().getMaxTitleLength()); } private  AllureAspectUtils(); static String getName(String methodName, Object[] parameters); static String getParametersAsString(Object[] parameters, int maxLength); static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters); static Object arrayToString(Object obj); static String cutEnd(String data, int maxLength); static String cutBegin(String data, int maxLength); }
AllureAspectUtils { public static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters) { String finalPattern = namePattern .replaceAll("\\{method\\}", methodName) .replaceAll("\\{this\\}", String.valueOf(instance)); int paramsCount = parameters == null ? 0 : parameters.length; Object[] results = new Object[paramsCount]; for (int i = 0; i < paramsCount; i++) { results[i] = arrayToString(parameters[i]); } return cutEnd(MessageFormat.format(finalPattern, results), AllureConfig.newInstance().getMaxTitleLength()); } private  AllureAspectUtils(); static String getName(String methodName, Object[] parameters); static String getParametersAsString(Object[] parameters, int maxLength); static String getTitle(String namePattern, String methodName, Object instance, Object[] parameters); static Object arrayToString(Object obj); static String cutEnd(String data, int maxLength); static String cutBegin(String data, int maxLength);  }