GGH-431 Fixed discovery of a start class
- Ensured that FunctionClassUtils performs additional check to ensure that located star class is SpringBootApplication - Added additional lookup to look for Main-Class if nothing was found in Start-Class primarily to support Azure - Updated Azure samples - Updated documentation Resolves #431
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"functionTimeout": "00:10:00"
|
||||
"functionTimeout": "00:05:00",
|
||||
"version": "2.0"
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
// @checkstyle:off
|
||||
@SpringBootApplication
|
||||
public class Config {
|
||||
|
||||
@@ -36,7 +35,6 @@ public class Config {
|
||||
}
|
||||
|
||||
}
|
||||
// @checkstyle:on
|
||||
|
||||
class Foo {
|
||||
|
||||
|
||||
@@ -18,10 +18,13 @@ package example;
|
||||
|
||||
import com.microsoft.azure.functions.ExecutionContext;
|
||||
import com.microsoft.azure.functions.HttpMethod;
|
||||
import com.microsoft.azure.functions.HttpRequestMessage;
|
||||
import com.microsoft.azure.functions.annotation.AuthorizationLevel;
|
||||
import com.microsoft.azure.functions.annotation.FunctionName;
|
||||
import com.microsoft.azure.functions.annotation.HttpTrigger;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler;
|
||||
|
||||
/**
|
||||
@@ -30,11 +33,10 @@ import org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHa
|
||||
public class FooHandler extends AzureSpringBootRequestHandler<Foo, Bar> {
|
||||
|
||||
@FunctionName("uppercase")
|
||||
public Bar execute(
|
||||
@HttpTrigger(name = "req", methods = {HttpMethod.GET,
|
||||
HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) Foo foo,
|
||||
public Bar execute(@HttpTrigger(name = "req", methods = {HttpMethod.GET,
|
||||
HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<Foo>> request,
|
||||
ExecutionContext context) {
|
||||
return handleRequest(foo, context);
|
||||
return handleRequest(request.getBody().get(), context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user