Skip to content

Commit

Permalink
test camel cased function bean
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffscottbrown committed Jul 18, 2018
1 parent ba560a1 commit 1329bb6
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ class WebFunctionSpec extends Specification {
embeddedServer.stop()
}

void 'test camel cased function bean'() {
given:
EmbeddedServer embeddedServer = ApplicationContext.run(EmbeddedServer)
RxHttpClient client = embeddedServer.applicationContext.createBean(RxHttpClient, embeddedServer.getURL())

when:
HttpResponse<String> response = client.toBlocking().exchange('/helloWorld', String)

then:
response.code() == HttpStatus.OK.code
response.body() == 'hello there world'

cleanup:
embeddedServer.stop()
}

void "test string consumer with text plain"() {
given:
EmbeddedServer embeddedServer = ApplicationContext.run(EmbeddedServer)
Expand Down Expand Up @@ -151,6 +167,17 @@ class WebFunctionSpec extends Specification {
}
}

@FunctionBean("helloWorld")
static class CamelCaseSupplier implements Supplier<String> {
String getValue() {
return "hello there world"
}
@Override
String get() {
return getValue()
}
}

@FunctionBean("supplier/pojo")
static class PojoSupplier implements Supplier<Book> {

Expand Down

0 comments on commit 1329bb6

Please sign in to comment.