Make @IntegrationConverter Native compatible (#3551)
* Make `@IntegrationConverter` Native compatible * Add `BASE_PACKAGE` into an `IntegrationContextUtils`; deprecate similar in the `IntegrationConfigUtils`. This fixes a package tangle between `config` and `context` * Move `ConverterRegistrar` and `CustomConversionServiceFactoryBean` into a `config` package since they are package protected and created their instances in the `IntegrationConverterInitializer` functional way instead of reflection * Use new `IntegrationContextUtils.BASE_PACKAGE` constant instead of deprecated one * Make `DefaultConfiguringBeanFactoryPostProcessor` `public` to make it available for Spring Native `trigger` option in the `@NativeHint` declaration * Simplify logic around `JsonPath` to just a `ClassUtils.isPresent()` * Move the `@IntegrationConverter` processing logic into the `ConverterRegistrar` to avoid reflection via `BeanDefinition` ctor arg manipulation * Move the reflection logic into a `ConverterParser` which, being a part of XML configuration, is not going to be compatible with native any way * Mark `JsonNodeWrapperToJsonNodeConverter` with an `@IntegrationConverter` since it is not registered via reflection any more * Expose `MicrometerMetricsCaptorRegistrar.METER_REGISTRY_PRESENT` and use it in the `IntegrationGraphServer` * Extract `UnmarshallingTransformer.MIME_MESSAGE_PRESENT` for less reflection at runtime * Use `null` for a `ClassLoader` arg in the `ClassUtils.isPresent()` relying on the default one internally * * Fix Checkstyle violations
This commit is contained in:
@@ -48,9 +48,7 @@ public class WebSocketIntegrationConfigurationInitializer implements Integration
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(WebSocketIntegrationConfigurationInitializer.class);
|
||||
|
||||
private static final boolean SERVLET_PRESENT =
|
||||
ClassUtils.isPresent("javax.servlet.Servlet",
|
||||
WebSocketIntegrationConfigurationInitializer.class.getClassLoader());
|
||||
private static final boolean SERVLET_PRESENT = ClassUtils.isPresent("javax.servlet.Servlet", null);
|
||||
|
||||
private static final String WEB_SOCKET_HANDLER_MAPPING_BEAN_NAME = "integrationWebSocketHandlerMapping";
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.integration.websocket.dsl;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
|
||||
import javax.websocket.DeploymentException;
|
||||
|
||||
@@ -108,10 +109,13 @@ public class WebSocketDslTests {
|
||||
|
||||
dynamicServerFlow.destroy();
|
||||
|
||||
assertThatExceptionOfType(MessageHandlingException.class)
|
||||
.isThrownBy(() -> dynamicClientFlow.getInputChannel().send(new GenericMessage<>("another test")))
|
||||
.withCauseInstanceOf(DeploymentException.class)
|
||||
.withMessageContaining("The HTTP response from the server [404]");
|
||||
await() // Looks like endpoint is removed on the server side somewhat async
|
||||
.untilAsserted(() ->
|
||||
assertThatExceptionOfType(MessageHandlingException.class)
|
||||
.isThrownBy(() ->
|
||||
dynamicClientFlow.getInputChannel().send(new GenericMessage<>("another test")))
|
||||
.withCauseInstanceOf(DeploymentException.class)
|
||||
.withMessageContaining("The HTTP response from the server [404]"));
|
||||
|
||||
dynamicClientFlow.destroy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user