generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure HTTP Functions compliant with TCK (#509)
- Loading branch information
Showing
57 changed files
with
1,822 additions
and
1,384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...roovy/io/micronaut/azure/function/http/test/ContextAzureFunctionEmbeddedServerSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.micronaut.azure.function.http.test | ||
|
||
import io.micronaut.context.annotation.Property | ||
import io.micronaut.context.annotation.Requires | ||
import io.micronaut.http.HttpRequest | ||
import io.micronaut.http.MediaType | ||
import io.micronaut.http.annotation.Body | ||
import io.micronaut.http.annotation.Controller | ||
import io.micronaut.http.annotation.Get | ||
import io.micronaut.http.annotation.Post | ||
import io.micronaut.http.client.HttpClient | ||
import io.micronaut.http.client.annotation.Client | ||
import io.micronaut.test.extensions.spock.annotation.MicronautTest | ||
import jakarta.inject.Inject | ||
import spock.lang.Specification | ||
|
||
@MicronautTest | ||
@Property(name = "spec.name", value = "ContextAzureFunctionEmbeddedServerSpec") | ||
@Property(name = "micronaut.server.context-path", value = "/woo") | ||
class ContextAzureFunctionEmbeddedServerSpec extends Specification { | ||
@Inject | ||
@Client('/') | ||
HttpClient client | ||
|
||
void 'test invoke function via server'() { | ||
when: | ||
def result = client.toBlocking().retrieve('/woo/test') | ||
|
||
then: | ||
result == 'good' | ||
} | ||
|
||
void 'test invoke post via server'() { | ||
when: | ||
def result = client.toBlocking().retrieve(HttpRequest.POST('/woo/test', "body") | ||
.contentType(MediaType.TEXT_PLAIN), String) | ||
|
||
then: | ||
result == 'goodbody' | ||
} | ||
|
||
@Requires(property = 'spec.name', value = 'ContextAzureFunctionEmbeddedServerSpec') | ||
@Controller('/test') | ||
static class TestController { | ||
@Get(value = '/', produces = MediaType.TEXT_PLAIN) | ||
String test() { | ||
return 'good' | ||
} | ||
|
||
@Post(value = '/', processes = MediaType.TEXT_PLAIN) | ||
String test(@Body String body) { | ||
return 'good' + body | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 0 additions & 68 deletions
68
...http/src/main/java/io/micronaut/azure/function/http/AzureAnnotatedMethodRouteBuilder.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.