use of io.sundr.adapter.testing.list.StringList in project sundrio by sundrio.
the class AbstractAdapterTest method testWithTypeParams.
//
// List
//
@Test
public void testWithTypeParams() throws Exception {
java.lang.reflect.Method method = ArrayList.class.getDeclaredMethod("get", int.class);
T input = getInput(StringList.class);
TypeDef typeDef = Adapters.adaptType(input, getContext());
RichTypeDef stringList = TypeArguments.apply(typeDef);
// methods
assertFalse(stringList.getMethods().stream().anyMatch(m -> m.getName().equals("get")));
assertTrue(stringList.getAllMethods().stream().anyMatch(m -> m.getName().equals("get") && m.getReturnType().equals(Types.STRING_REF)));
// properties
assertFalse(stringList.getProperties().stream().anyMatch(m -> m.getName().equals("elementData")));
assertTrue(stringList.getAllProperties().stream().anyMatch(m -> m.getName().equals("elementData")));
}
Aggregations