{
final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
final Properties parameters = new Properties();
parameters.setProperty( "type", "Foo" );
parameters.setProperty( "optional", "true" );
final Attribute attribute = new Attribute( "dna.dependency", parameters );
final JavaMethod method = new JavaMethod();
method.setParentClass( new MockJavaClass() );
final Attribute result =
interceptor.processMethodAttribute( method, attribute );
assertNotNull( "attribute", result );
assertEquals( "attribute.name", "dna.dependency", result.getName() );
assertEquals( "attribute.value", null, result.getValue() );
assertEquals( "attribute.parameterCount", 3, result.getParameterCount() );
assertEquals( "attribute.parameter(type)",
MockJavaSource.PREFIX + "Foo",
result.getParameter( "type" ) );
assertEquals( "attribute.parameter(key)",
MockJavaSource.PREFIX + "Foo",
result.getParameter( "key" ) );
assertEquals( "attribute.parameter(optional)",
"true",
result.getParameter( "optional" ) );
}