add e2e test case
This commit is contained in:
Родитель
8eba45843f
Коммит
31867a61f7
|
@ -65,6 +65,12 @@ namespace Azure.Functions.Java.Tests.E2E
|
|||
public async Task HttpTrigger_BindingName()
|
||||
{
|
||||
Assert.True(await Utilities.InvokeHttpTrigger("BindingName", "/testMessage", HttpStatusCode.OK, "testMessage"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task HttpTrigger_StaticBlockFailure()
|
||||
{
|
||||
Assert.True(await Utilities.InvokeHttpTrigger("StaticBlockFailure", "", HttpStatusCode.InternalServerError, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.microsoft.azure.functions.endtoend;
|
||||
|
||||
import com.microsoft.azure.functions.*;
|
||||
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;
|
||||
|
||||
public class StaticBlockFailure {
|
||||
static {
|
||||
Optional.empty().orElseThrow(() -> new RuntimeException("exception raised in static block"));
|
||||
}
|
||||
@FunctionName("StaticBlockFailure")
|
||||
public HttpResponseMessage run(
|
||||
@HttpTrigger(
|
||||
name = "req",
|
||||
methods = {HttpMethod.GET, HttpMethod.POST},
|
||||
authLevel = AuthorizationLevel.ANONYMOUS)
|
||||
HttpRequestMessage<Optional<String>> request,
|
||||
final ExecutionContext context) {
|
||||
context.getLogger().info("Java HTTP trigger processed a request of function StaticBlockFailure.");
|
||||
return request.createResponseBuilder(HttpStatus.OK).body("Hello, e2e test").build();
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче