@Test public void testWrongValueType() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> RandomValueGenerator.generate("alphanum:aa")) .withMessage("Unexpected string after the alphanum scheme: expected length"); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1)); }
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1)); } }
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1)); } private  RandomValueGenerator(); }
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1)); } private  RandomValueGenerator(); static String generate(final String generator); }
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1)); } private  RandomValueGenerator(); static String generate(final String generator);  }