StringFormat extends TransformationUtility<StringFormat> { public StringFormat setAttributeNames(String... attributeNames) { if(attributeNames == null || attributeNames.length == 0) { throw new TransformationDefinitionException("Attribute names cannot be null or empty"); } this.attributeNames = attributeNames; return this; } StringFormat();  StringFormat(String format); StringFormat setFormat(String format); StringFormat setAttributeNames(String... attributeNames); String getFormat(); String[] getAttributeNames(); @Override String getDescription();  }
@Test(expectedExceptions = TransformationDefinitionException.class, expectedExceptionsMessageRegExp = "Attribute names cannot be null or empty") public void invalidArguments1() { new StringFormat("This %s is %s").setAttributeNames(new String[]{}); }
@Test(expectedExceptions = TransformationDefinitionException.class, expectedExceptionsMessageRegExp = "Attribute names cannot be null or empty") public void invalidArguments2() { new StringFormat("This %s is %s").setAttributeNames((String[]) null); }