@Test public void testDecorateNameWhenNameContainsPostfix() { ReflectionTestUtils.setField(underTest, "maxResourceNameLength", 30); String actual = underTest.decorateName("smtg-name-cb-username", "username"); Assertions.assertEquals("smtg-name-cb-username", actual); }
public String decorateName(String name, String userName) { if (name.endsWith("-cb")) { name += "-" + userName; } if (!name.endsWith("-cb-" + userName)) { name = name + "-cb-" + userName; } return cutToMaxLength(name, userName); }
ApplicationNameUtil { public String decorateName(String name, String userName) { if (name.endsWith("-cb")) { name += "-" + userName; } if (!name.endsWith("-cb-" + userName)) { name = name + "-cb-" + userName; } return cutToMaxLength(name, userName); } }
ApplicationNameUtil { public String decorateName(String name, String userName) { if (name.endsWith("-cb")) { name += "-" + userName; } if (!name.endsWith("-cb-" + userName)) { name = name + "-cb-" + userName; } return cutToMaxLength(name, userName); }  }
ApplicationNameUtil { public String decorateName(String name, String userName) { if (name.endsWith("-cb")) { name += "-" + userName; } if (!name.endsWith("-cb-" + userName)) { name = name + "-cb-" + userName; } return cutToMaxLength(name, userName); }  String decorateName(String name, String userName); }
ApplicationNameUtil { public String decorateName(String name, String userName) { if (name.endsWith("-cb")) { name += "-" + userName; } if (!name.endsWith("-cb-" + userName)) { name = name + "-cb-" + userName; } return cutToMaxLength(name, userName); }  String decorateName(String name, String userName);  }