More tests for auto detect of start class

This commit is contained in:
Dave Syer
2018-05-18 12:48:36 +01:00
parent e1bb5259a9
commit a64579dbdb
3 changed files with 44 additions and 6 deletions

View File

@@ -59,6 +59,21 @@ public abstract class FunctionCreatorConfigurationTests {
}
}
@EnableAutoConfiguration
@TestPropertySource(properties = {
"function.location=app:classpath,file:target/test-classes,file:target/test-classes/app",
"function.bean=myDoubler" })
public static class SingleFunctionWithAutoMainTests
extends FunctionCreatorConfigurationTests {
@Test
public void testDouble() {
Function<Flux<Integer>, Flux<Integer>> function = catalog
.lookup(Function.class, "function0");
assertThat(function.apply(Flux.just(2)).blockFirst()).isEqualTo(4);
}
}
@EnableAutoConfiguration
@TestPropertySource(properties = { "function.location=app:classpath",
"function.bean=org.springframework.cloud.function.test.SpringDoubler" })

View File

@@ -0,0 +1,14 @@
Manifest-Version: 1.0
Implementation-Title: function-file-sample
Implementation-Version: 1.0.0.M1
Archiver-Version: Plexus Archiver
Built-By: dsyer
Implementation-Vendor-Id: com.example
Spring-Boot-Version: 1.5.12.RELEASE
Implementation-Vendor: Pivotal Software, Inc.
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: org.springframework.cloud.function.test.FunctionApp
Created-By: Apache Maven 3.5.0
Build-Jdk: 1.8.0_131
Implementation-URL: http://projects.spring.io/spring-boot/function-sam
ple/