/** * Convinient conversion of testSomeTest -> someTest | SomeTest where testSomeTest is the name of * current test. * * @param lowercaseFirstLetter - whether first letter after test should be lowercased. */ protected String getTestName(boolean lowercaseFirstLetter) { String name = getName(); assertTrue("Test name should start with 'test'", name.startsWith("test")); name = name.substring("test".length()); if (lowercaseFirstLetter && !UsefulTestCase.isAllUppercaseName(name)) { name = Character.toLowerCase(name.charAt(0)) + name.substring(1); } return name; }
public static String lowercaseFirstLetter(String name, boolean lowercaseFirstLetter) { if (lowercaseFirstLetter && !isAllUppercaseName(name)) { name = Character.toLowerCase(name.charAt(0)) + name.substring(1); } return name; }