use of org.mule.runtime.core.internal.transformer.simple.InputStreamToByteArray in project mule by mulesoft.
the class TransformerCachingTestCase method testCacheUpdate.
@Test
public void testCacheUpdate() throws Exception {
DataType sourceType = DataType.fromType(FilterInputStream.class);
MuleRegistry registry = ((MuleContextWithRegistries) muleContext).getRegistry();
Transformer trans = registry.lookupTransformer(sourceType, BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof InputStreamToByteArray);
Transformer trans2 = new FilterInputStreamToByteArray();
registry.registerTransformer(trans2);
trans = registry.lookupTransformer(sourceType, BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof FilterInputStreamToByteArray);
trans = registry.lookupTransformer(INPUT_STREAM, BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof InputStreamToByteArray);
registry.unregisterTransformer(trans2.getName());
trans = registry.lookupTransformer(sourceType, BYTE_ARRAY);
assertNotNull(trans);
assertTrue(trans instanceof InputStreamToByteArray);
}
Aggregations