Reflect grouping in directory structure

This commit is contained in:
Andy Wilkinson
2022-10-28 14:36:50 +01:00
parent 393e1cb6bf
commit 7112a4b6a4
788 changed files with 9 additions and 100 deletions

View File

@@ -0,0 +1,28 @@
package com.example.cloud.function.web;
import org.junit.jupiter.api.Test;
import org.springframework.aot.smoketest.support.junit.ApplicationTest;
import org.springframework.http.MediaType;
import org.springframework.test.web.reactive.server.WebTestClient;
import static org.assertj.core.api.Assertions.assertThat;
@ApplicationTest
class CloudFunctionWebApplicationAotTests {
@Test
void uppercaseShouldBeInvokable(WebTestClient webTestClient) {
webTestClient.post().uri("/uppercase").header("Content-Type", MediaType.TEXT_PLAIN_VALUE).bodyValue("hello")
.exchange().expectStatus().isOk().expectBody()
.consumeWith((result) -> assertThat(new String(result.getResponseBodyContent())).isEqualTo("HELLO"));
}
@Test
void lowercaseShouldBeInvokable(WebTestClient webTestClient) {
webTestClient.post().uri("/lowercase").header("Content-Type", MediaType.TEXT_PLAIN_VALUE).bodyValue("HELLO")
.exchange().expectStatus().isOk().expectBody()
.consumeWith((result) -> assertThat(new String(result.getResponseBodyContent())).isEqualTo("hello"));
}
}

View File

@@ -0,0 +1,13 @@
package com.example.cloud.function.web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class CloudFunctionWebApplication {
public static void main(String[] args) {
SpringApplication.run(CloudFunctionWebApplication.class, args);
}
}

View File

@@ -0,0 +1,16 @@
package com.example.cloud.function.web;
import java.util.Locale;
import java.util.function.Function;
import org.springframework.stereotype.Component;
@Component
class Lowercase implements Function<String, String> {
@Override
public String apply(String input) {
return input.toLowerCase(Locale.ENGLISH);
}
}

View File

@@ -0,0 +1,16 @@
package com.example.cloud.function.web;
import java.util.Locale;
import java.util.function.Function;
import org.springframework.stereotype.Component;
@Component
class Uppercase implements Function<String, String> {
@Override
public String apply(String input) {
return input.toUpperCase(Locale.ENGLISH);
}
}