Fixed docs home page
fixed some formatting issues
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<properties>
|
||||
<docs.main>index</docs.main>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<spring-doc-resources.version>0.1.0.RELEASE</spring-doc-resources.version>
|
||||
<spring-doc-resources.version>0.1.1.RELEASE</spring-doc-resources.version>
|
||||
<spring-asciidoctor-extensions.version>0.1.0.RELEASE
|
||||
</spring-asciidoctor-extensions.version>
|
||||
<asciidoctorj-pdf.version>1.5.0-alpha.16</asciidoctorj-pdf.version>
|
||||
@@ -124,6 +124,8 @@
|
||||
<sourceDirectory>${project.build.directory}/refdocs/</sourceDirectory>
|
||||
<attributes>
|
||||
<spring-cloud-function-version>${project.version}</spring-cloud-function-version>
|
||||
<docs-url>http://cloud.spring.io/</docs-url>
|
||||
<docs-version></docs-version>
|
||||
</attributes>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
@@ -4,6 +4,9 @@ Mark Fisher, Dave Syer, Oleg Zhurakousky
|
||||
|
||||
*{spring-cloud-function-version}*
|
||||
|
||||
[#index-link]
|
||||
{docs-url}spring-cloud-function/{docs-version}home.html
|
||||
|
||||
---
|
||||
|
||||
:github: https://github.com/spring-cloud/spring-cloud-function
|
||||
|
||||
@@ -34,7 +34,8 @@ public final class FunctionWebUtils {
|
||||
|
||||
}
|
||||
|
||||
public static Object findFunction(HttpMethod method, FunctionCatalog functionCatalog, Map<String, Object> attributes, String path) {
|
||||
public static Object findFunction(HttpMethod method, FunctionCatalog functionCatalog,
|
||||
Map<String, Object> attributes, String path) {
|
||||
if (method.equals(HttpMethod.GET)) {
|
||||
return findFunctionForGet(functionCatalog, attributes, path);
|
||||
}
|
||||
@@ -46,7 +47,8 @@ public final class FunctionWebUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static Object findFunctionForGet(FunctionCatalog functionCatalog, Map<String, Object> attributes, String path) {
|
||||
private static Object findFunctionForGet(FunctionCatalog functionCatalog,
|
||||
Map<String, Object> attributes, String path) {
|
||||
path = path.startsWith("/") ? path.substring(1) : path;
|
||||
|
||||
Object functionForGet = null;
|
||||
@@ -82,7 +84,8 @@ public final class FunctionWebUtils {
|
||||
return functionForGet;
|
||||
}
|
||||
|
||||
private static Object findFunctionForPost(FunctionCatalog functionCatalog, Map<String, Object> attributes, String path) {
|
||||
private static Object findFunctionForPost(FunctionCatalog functionCatalog,
|
||||
Map<String, Object> attributes, String path) {
|
||||
path = path.startsWith("/") ? path.substring(1) : path;
|
||||
Consumer<Publisher<?>> consumer = functionCatalog.lookup(Consumer.class, path);
|
||||
if (consumer != null) {
|
||||
|
||||
@@ -32,7 +32,12 @@ import org.springframework.util.SocketUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
public class FunctionEndpointInitializerMVCTests {
|
||||
|
||||
@Before
|
||||
@@ -51,7 +56,8 @@ public class FunctionEndpointInitializerMVCTests {
|
||||
SpringApplication.run(ApplicationConfiguration.class);
|
||||
TestRestTemplate testRestTemplate = new TestRestTemplate();
|
||||
String port = System.getProperty("server.port");
|
||||
ResponseEntity<String> response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/uppercase"), "stressed", String.class);
|
||||
ResponseEntity<String> response = testRestTemplate
|
||||
.postForEntity(new URI("http://localhost:" + port + "/uppercase"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("STRESSED");
|
||||
response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/reverse"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("desserts");
|
||||
@@ -62,7 +68,8 @@ public class FunctionEndpointInitializerMVCTests {
|
||||
SpringApplication.run(ApplicationConfiguration.class);
|
||||
TestRestTemplate testRestTemplate = new TestRestTemplate();
|
||||
String port = System.getProperty("server.port");
|
||||
ResponseEntity<String> response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/uppercase,lowercase,reverse"), "stressed", String.class);
|
||||
ResponseEntity<String> response = testRestTemplate
|
||||
.postForEntity(new URI("http://localhost:" + port + "/uppercase,lowercase,reverse"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("desserts");
|
||||
}
|
||||
|
||||
@@ -84,20 +91,6 @@ public class FunctionEndpointInitializerMVCTests {
|
||||
public Function<String, String> reverse() {
|
||||
return s -> new StringBuilder(s).reverse().toString();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void initialize(GenericApplicationContext applicationContext) {
|
||||
// applicationContext.registerBean("uppercase", FunctionRegistration.class,
|
||||
// () -> new FunctionRegistration<>(uppercase())
|
||||
// .type(FunctionType.from(String.class).to(String.class)));
|
||||
// applicationContext.registerBean("reverse", FunctionRegistration.class,
|
||||
// () -> new FunctionRegistration<>(reverse())
|
||||
// .type(FunctionType.from(String.class).to(String.class)));
|
||||
// applicationContext.registerBean("lowercase", FunctionRegistration.class,
|
||||
// () -> new FunctionRegistration<>(lowercase())
|
||||
// .type(FunctionType.from(String.class).to(String.class)));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,12 @@ import org.springframework.util.SocketUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
public class FunctionEndpointInitializerTests {
|
||||
|
||||
@Before
|
||||
@@ -55,7 +60,8 @@ public class FunctionEndpointInitializerTests {
|
||||
TestRestTemplate testRestTemplate = new TestRestTemplate();
|
||||
String port = System.getProperty("server.port");
|
||||
Thread.sleep(200);
|
||||
ResponseEntity<String> response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/uppercase"), "stressed", String.class);
|
||||
ResponseEntity<String> response = testRestTemplate
|
||||
.postForEntity(new URI("http://localhost:" + port + "/uppercase"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("STRESSED");
|
||||
response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/reverse"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("desserts");
|
||||
@@ -67,7 +73,8 @@ public class FunctionEndpointInitializerTests {
|
||||
TestRestTemplate testRestTemplate = new TestRestTemplate();
|
||||
String port = System.getProperty("server.port");
|
||||
Thread.sleep(200);
|
||||
ResponseEntity<String> response = testRestTemplate.postForEntity(new URI("http://localhost:" + port + "/uppercase,lowercase,reverse"), "stressed", String.class);
|
||||
ResponseEntity<String> response = testRestTemplate
|
||||
.postForEntity(new URI("http://localhost:" + port + "/uppercase,lowercase,reverse"), "stressed", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("desserts");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user