use of org.mule.runtime.module.extension.internal.loader.java.property.InterceptorsModelProperty in project mule by mulesoft.
the class MuleExtensionUtils method getOrCreateInterceptorModelProperty.
private static InterceptorsModelProperty getOrCreateInterceptorModelProperty(BaseDeclaration declaration) {
InterceptorsModelProperty property = (InterceptorsModelProperty) declaration.getModelProperty(InterceptorsModelProperty.class).orElse(null);
if (property == null) {
property = new InterceptorsModelProperty(emptyList());
declaration.addModelProperty(property);
}
return property;
}
use of org.mule.runtime.module.extension.internal.loader.java.property.InterceptorsModelProperty in project mule by mulesoft.
the class ConnectionDeclarationEnricherTestCase method enrichConnectedOperation.
@Test
public void enrichConnectedOperation() throws Exception {
enricher.enrich(extensionLoadingContext);
verify(connectedOperation).addModelProperty(isA(InterceptorsModelProperty.class));
InterceptorsModelProperty interceptors = connectedOperation.getModelProperty(InterceptorsModelProperty.class).get();
assertThat(interceptors.getInterceptorFactories(), hasSize(2));
assertThat(interceptors.getInterceptorFactories().get(0).createInterceptor(), is(instanceOf(ConnectionInterceptor.class)));
assertThat(interceptors.getInterceptorFactories().get(1).createInterceptor(), is(instanceOf(CursorResetInterceptor.class)));
}
Aggregations