Search in sources :

Example 1 with JavaTypeLoader

use of org.mule.metadata.java.api.JavaTypeLoader in project mule by mulesoft.

the class GroupValueSetterTestCase method before.

@Before
public void before() throws Exception {
    final String personalInfo = "personalInfo";
    ParameterGroupDescriptor group = new ParameterGroupDescriptor("group", new TypeWrapper(PersonalInfo.class, new JavaTypeLoader(Thread.currentThread().getContextClassLoader())), ExtensionsTypeLoaderFactory.getDefault().createTypeLoader().load(PersonalInfo.class), getField(HeisenbergExtension.class, personalInfo, reflectionCache).get(), null);
    Map<String, Object> resultMap = new HashMap<>();
    resultMap.put("name", NAME);
    resultMap.put("age", AGE);
    resultMap.put("dateOfBirth", DATE);
    when(result.asMap()).thenReturn(resultMap);
    valueSetter = new GroupValueSetter(group, () -> reflectionCache);
}
Also used : TypeWrapper(org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper) PersonalInfo(org.mule.test.heisenberg.extension.model.PersonalInfo) HashMap(java.util.HashMap) ParameterGroupDescriptor(org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor) JavaTypeLoader(org.mule.metadata.java.api.JavaTypeLoader) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)1 Before (org.junit.Before)1 JavaTypeLoader (org.mule.metadata.java.api.JavaTypeLoader)1 ParameterGroupDescriptor (org.mule.runtime.module.extension.internal.loader.ParameterGroupDescriptor)1 TypeWrapper (org.mule.runtime.module.extension.internal.loader.java.type.runtime.TypeWrapper)1 PersonalInfo (org.mule.test.heisenberg.extension.model.PersonalInfo)1