implementInterface should automatically add imports
---------------------------------------------------
Key: ROASTER-114
URL:
https://issues.jboss.org/browse/ROASTER-114
Project: Roaster
Issue Type: Enhancement
Affects Versions: 2.19.2.Final
Reporter: Nicolas Challut
Assignee: Stephan Windmüller
Fix For: 2.19.3.Final
{code:java}
@Test
public void interfaceImportTest()
{
JavaInterfaceSource javaInterface = Roaster.create(JavaInterfaceSource.class);
javaInterface.setName("MyInterface");
MethodSource<JavaInterfaceSource> methodSource =
javaInterface.addMethod();
methodSource.setName("methodExample");
methodSource.addParameter("java.util.List<String>",
"listParameter");
JavaClassSource javaImplementation = Roaster.create(JavaClassSource.class);
javaImplementation.implementInterface(javaInterface.getClass());
assertTrue("The Interface imports java.util.List properly",
javaInterface.hasImport("java.util.List"));
assertTrue("The Implementation imports java.util.List properly",
javaImplementation.hasImport("java.util.List"));
}
{code}