@Test(expected = CukesRuntimeException.class) public void byInvalidPattern() { generator.byPattern("b"); }
@Override public String byPattern(String pattern) { if (StringUtils.isEmpty(pattern)) throw new CukesRuntimeException("Invalid password pattern, should contain symbols like a,A,0"); return pattern .chars() .map(this::mapPatternCharacter) .collect( producer(), accumulator(), resultMerger() ) .toString(); }
RandomGeneratorFacadeImpl implements RandomGeneratorFacade { @Override public String byPattern(String pattern) { if (StringUtils.isEmpty(pattern)) throw new CukesRuntimeException("Invalid password pattern, should contain symbols like a,A,0"); return pattern .chars() .map(this::mapPatternCharacter) .collect( producer(), accumulator(), resultMerger() ) .toString(); } }
RandomGeneratorFacadeImpl implements RandomGeneratorFacade { @Override public String byPattern(String pattern) { if (StringUtils.isEmpty(pattern)) throw new CukesRuntimeException("Invalid password pattern, should contain symbols like a,A,0"); return pattern .chars() .map(this::mapPatternCharacter) .collect( producer(), accumulator(), resultMerger() ) .toString(); } RandomGeneratorFacadeImpl(); }
RandomGeneratorFacadeImpl implements RandomGeneratorFacade { @Override public String byPattern(String pattern) { if (StringUtils.isEmpty(pattern)) throw new CukesRuntimeException("Invalid password pattern, should contain symbols like a,A,0"); return pattern .chars() .map(this::mapPatternCharacter) .collect( producer(), accumulator(), resultMerger() ) .toString(); } RandomGeneratorFacadeImpl(); @Override String byPattern(String pattern); @Override String withLength(int length); }
RandomGeneratorFacadeImpl implements RandomGeneratorFacade { @Override public String byPattern(String pattern) { if (StringUtils.isEmpty(pattern)) throw new CukesRuntimeException("Invalid password pattern, should contain symbols like a,A,0"); return pattern .chars() .map(this::mapPatternCharacter) .collect( producer(), accumulator(), resultMerger() ) .toString(); } RandomGeneratorFacadeImpl(); @Override String byPattern(String pattern); @Override String withLength(int length);  }