forked from micronaut-projects/micronaut-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add @NotYetImplemented test with explanation
- Loading branch information
1 parent
2bcf3f3
commit a7f0a38
Showing
3 changed files
with
43 additions
and
1 deletion.
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
27 changes: 27 additions & 0 deletions
27
function-web/src/test/groovy/io/micronaut/function/web/JavaLambdaFunctionSpec.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,27 @@ | ||
package io.micronaut.function.web | ||
|
||
import io.micronaut.context.ApplicationContext | ||
import io.micronaut.http.HttpResponse | ||
import io.micronaut.http.HttpStatus | ||
import io.micronaut.http.client.RxHttpClient | ||
import io.micronaut.runtime.server.EmbeddedServer | ||
import spock.lang.Specification | ||
|
||
class JavaLambdaFunctionSpec extends Specification { | ||
|
||
void "test string supplier"() { | ||
given: | ||
EmbeddedServer embeddedServer = ApplicationContext.run(EmbeddedServer) | ||
RxHttpClient client = embeddedServer.applicationContext.createBean(RxHttpClient, embeddedServer.getURL()) | ||
|
||
when: | ||
HttpResponse<String> response = client.toBlocking().exchange('/java/supplier/string', String) | ||
|
||
then: | ||
response.code() == HttpStatus.OK.code | ||
response.body() == 'value' | ||
|
||
cleanup: | ||
embeddedServer.stop() | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
function-web/src/test/groovy/io/micronaut/function/web/TestFunctionFactory.java
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,15 @@ | ||
package io.micronaut.function.web; | ||
|
||
import io.micronaut.context.annotation.Factory; | ||
import io.micronaut.function.FunctionBean; | ||
|
||
import java.util.function.Supplier; | ||
|
||
@Factory | ||
public class TestFunctionFactory { | ||
|
||
@FunctionBean("java/supplier/string") | ||
Supplier<String> get() { | ||
return () -> "myvalue"; | ||
} | ||
} |