Search in sources :

Example 1 with DataTypeConversionResolver

use of org.mule.runtime.core.api.transformer.DataTypeConversionResolver in project mule by mulesoft.

the class DefaultMuleContextTestCase method cachesDataTypeConversionResolver.

@Test
public void cachesDataTypeConversionResolver() throws Exception {
    createMuleContext();
    disposeIfNeeded(((MuleContextWithRegistries) context).getRegistry(), LOGGER);
    final MuleRegistryHelper muleRegistry = mock(MuleRegistryHelper.class);
    ((DefaultMuleContext) context).setMuleRegistry(muleRegistry);
    DataTypeConversionResolver dataTypeConverterResolver1 = context.getDataTypeConverterResolver();
    DataTypeConversionResolver dataTypeConverterResolver2 = context.getDataTypeConverterResolver();
    assertThat(dataTypeConverterResolver1, instanceOf(DynamicDataTypeConversionResolver.class));
    assertThat(dataTypeConverterResolver2, sameInstance(dataTypeConverterResolver1));
    verify(muleRegistry).lookupObject(OBJECT_CONVERTER_RESOLVER);
}
Also used : DynamicDataTypeConversionResolver(org.mule.runtime.core.internal.transformer.DynamicDataTypeConversionResolver) MuleRegistryHelper(org.mule.runtime.core.internal.registry.MuleRegistryHelper) DynamicDataTypeConversionResolver(org.mule.runtime.core.internal.transformer.DynamicDataTypeConversionResolver) DataTypeConversionResolver(org.mule.runtime.core.api.transformer.DataTypeConversionResolver) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DataTypeConversionResolver (org.mule.runtime.core.api.transformer.DataTypeConversionResolver)1 MuleRegistryHelper (org.mule.runtime.core.internal.registry.MuleRegistryHelper)1 DynamicDataTypeConversionResolver (org.mule.runtime.core.internal.transformer.DynamicDataTypeConversionResolver)1