Add Kotlin suspend function support

Use suspendCoroutineUninterceptedOrReturn to avoid using not fully implemented Function2.reflect()

Mapping of Function, Consumer and Supplier to kotlin suspend flow lambda

Fix MR review

Resolves #655
This commit is contained in:
Adrien Poupard
2021-02-20 19:21:48 +01:00
committed by Oleg Zhurakousky
parent 3c16efc6a4
commit e30a091f82
10 changed files with 649 additions and 9 deletions

View File

@@ -25,9 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.cloud.function.web.RestApplication;
import org.springframework.cloud.function.web.flux.HeadersToMessageTests.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
@@ -41,12 +41,13 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Dave Syer
* @author Oleg Zhurakousky
* @author Adrien Poupard
*
*/
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
"spring.cloud.function.web.path=/functions",
"spring.main.web-application-type=reactive" })
@ContextConfiguration(classes = { RestApplication.class, TestConfiguration.class })
@ContextConfiguration(classes = { RestApplication.class, HeadersToMessageTests.TestConfiguration.class })
public class HeadersToMessageTests {
@Autowired