@Test public void getNameLongMethodNameAndParametersTest() throws Exception { String name = getName(METHOD_NAME, new Object[]{TOO_LONG_NAME}); assertThat("Invalid method name short cut", name, equalTo("getSomethingNew[this name pattern is too long, over 150 symbols! Guys, what are you " + "thinking for when you made so long t...]")); }
public static String getName(String methodName, Object[] parameters) { int maxLength = AllureConfig.newInstance().getMaxTitleLength(); if (methodName.length() > maxLength) { return cutBegin(methodName, maxLength); } else { return methodName + getParametersAsString(parameters, maxLength - methodName.length()); } }
AllureAspectUtils { public static String getName(String methodName, Object[] parameters) { int maxLength = AllureConfig.newInstance().getMaxTitleLength(); if (methodName.length() > maxLength) { return cutBegin(methodName, maxLength); } else { return methodName + getParametersAsString(parameters, maxLength - methodName.length()); } } }
AllureAspectUtils { public static String getName(String methodName, Object[] parameters) { int maxLength = AllureConfig.newInstance().getMaxTitleLength(); if (methodName.length() > maxLength) { return cutBegin(methodName, maxLength); } else { return methodName + getParametersAsString(parameters, maxLength - methodName.length()); } } private  AllureAspectUtils(); }
AllureAspectUtils { public static String getName(String methodName, Object[] parameters) { int maxLength = AllureConfig.newInstance().getMaxTitleLength(); if (methodName.length() > maxLength) { return cutBegin(methodName, maxLength); } else { return methodName + getParametersAsString(parameters, maxLength - methodName.length()); } } 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 getName(String methodName, Object[] parameters) { int maxLength = AllureConfig.newInstance().getMaxTitleLength(); if (methodName.length() > maxLength) { return cutBegin(methodName, maxLength); } else { return methodName + getParametersAsString(parameters, maxLength - methodName.length()); } } 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);  }