Polished adapter initializers consolidation effort
- Added ability to retrieve input type from FunctionRegistration (if available) in AbstractSpringFunctionAdapterInitializer
- Removed azure/AzureSpringFunctionInitializer and aws/SpringFunctionInitializer
- Added additional tests in AWS and Azure modules
- See 0189c578ef for additional info
This commit is contained in:
@@ -32,9 +32,10 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
public class AzureSpringBootRequestHandlerTests {
|
||||
|
||||
@@ -111,6 +112,13 @@ public class AzureSpringBootRequestHandlerTests {
|
||||
assertThat(bar.getValue()).isEqualTo("BAR");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void functionNonFluxBean() {
|
||||
AzureSpringBootRequestHandler<Foo, Bar> handler = handler(NonFluxFunctionConfig.class);
|
||||
Bar bar = handler.handleRequest(new Foo("bar"), new TestExecutionContext("function"));
|
||||
assertThat(bar).isNotNull();
|
||||
}
|
||||
|
||||
@After
|
||||
public void close() throws IOException {
|
||||
if (this.handler != null) {
|
||||
@@ -118,6 +126,16 @@ public class AzureSpringBootRequestHandlerTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class NonFluxFunctionConfig {
|
||||
|
||||
@Bean
|
||||
public Function<Foo, Bar> function() {
|
||||
return foo -> new Bar();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class BareConfig {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user