我现在正在编写单元测试,我需要创建一个特定的字符串.
我现在定义了这样的东西:
private final String at = "@:";
private String error, effect, one, two, three, four;
Run Code Online (Sandbox Code Playgroud)
在setUp(@Before)中:
error = RandomStringUtils.randomAlphabetic (3);
one = RandomStringUtils.randomAlphabetic (6);
two = RandomStringUtils.randomAlphabetic (8);
three = RandomStringUtils.randomAlphabetic (2);
four = RandomStringUtils.randomAlphabetic (6);
effect = (error + at + one + at + two + at + three + at + four);
Run Code Online (Sandbox Code Playgroud)
弦乐与弦乐的结合看起来非常丑陋和业余.有可能以某种方式更有效地使用其他任何东西吗?比如模式?我不知道.感谢帮助 :)