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:
Oleg Zhurakousky
2019-12-12 15:03:48 +01:00
parent 12f4260271
commit 0f38ea47b8
6 changed files with 30 additions and 32 deletions

View File

@@ -15,12 +15,10 @@ Example:
```java
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,
ExecutionContext context) {
return handleRequest(foo, context);
public Bar execute(@HttpTrigger(name = "req", methods = {HttpMethod.GET,
HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<Foo>> request,
ExecutionContext context) {
return handleRequest(request.getBody().get(), context);
}
}
```
@@ -125,7 +123,7 @@ You can run the sample locally, just like the other Spring Cloud Function sample
./mvnw spring-boot:run
---
and `curl -H "Content-Type: text/plain" localhost:8080/function -d '{"value": "hello foobar"}'`.
and `curl -H "Content-Type: text/plain" localhost:8080/api/uppercase -d '{"value": "hello foobar"}'`.
You will need the `az` CLI app (see https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven for more detail). To deploy the function on Azure runtime: