Skip to content

Commit

Permalink
Cleanup codestarter tests
Browse files Browse the repository at this point in the history
- Remove unnecessary modifiers
- Unify line-breaks
- Unify indentation
  • Loading branch information
turing85 committed Oct 27, 2023
1 parent d110270 commit 4d6f278
Show file tree
Hide file tree
Showing 35 changed files with 59 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class LambdaHandlerTest {

class LambdaHandlerTest {
@Test
public void testSimpleLambdaSuccess() throws Exception {
void testSimpleLambdaSuccess() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testFunqyLambda() throws Exception {
void testFunqyLambda() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_CLOUD_EVENTS, functionName = "helloCloudEvent")
class GreetingFunctionsCloudEventsTest {
@Test
public void testHelloCloudEvent() {
void testHelloCloudEvent() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloPubSubWorld")
class GreetingFunctionsPubSubTest {
@Test
public void testHelloPubSubWorld() {
void testHelloPubSubWorld() {
given()
.body("{\"data\":{\"data\":\"world\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloGCSWorld")
class GreetingFunctionsStorageTest {
@Test
public void testHelloGCSWorld() {
void testHelloGCSWorld() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
import static org.hamcrest.Matchers.notNullValue;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testCloudEvent() {
void testCloudEvent() {
RestAssured.given().contentType("application/json")
.header("ce-specversion", "1.0")
.header("ce-id", UUID.randomUUID().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.BACKGROUND)
class HelloWorldBackgroundFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.CLOUD_EVENTS)
class HelloWorldCloudEventsFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@WithFunction(FunctionType.HTTP)
class HelloWorldHttpFunctionTest {
@Test
public void testService() {
void testService() {
when()
.get()
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* Unit test for Function class.
*/
@QuarkusTest
public class FunctionTest {
class FunctionTest {

@Inject
Function function;
Expand All @@ -36,7 +36,7 @@ public class FunctionTest {
* Unit test for HttpTriggerJava method.
*/
@Test
public void testHttpTriggerJava() throws Exception {
void testHttpTriggerJava() throws Exception {
// Setup
@SuppressWarnings("unchecked")
final HttpRequestMessage<Optional<String>> req = mock(HttpRequestMessage.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class GreetingTest {

class GreetingTest {
@Test
public void testHelloEndpoint() {
void testHelloEndpoint() {
given()
.when().get("/hello")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static org.hamcrest.Matchers.containsString;

@QuarkusTest
public class MyFunctionsTest {

class MyFunctionsTest {
@Test
public void testFun() {
void testFun() {
given()
.post("/fun")
.then()
Expand All @@ -20,7 +19,7 @@ public void testFun() {
}

@Test
public void testFunWithName() {
void testFunWithName() {
given()
.contentType(ContentType.JSON)
.body("{\"name\": \"Friend\"}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
import org.junit.jupiter.api.Test;

@QuarkusTest
public class HelloGrpcServiceTest {

class HelloGrpcServiceTest {
@GrpcClient
HelloGrpc helloGrpc;

@Test
public void testHello() {
void testHello() {
HelloReply reply = helloGrpc
.sayHello(HelloRequest.newBuilder().setName("Neo").build()).await().atMost(Duration.ofSeconds(5));
assertEquals("Hello Neo!", reply.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class {resource.class-name}IT extends {resource.class-name}Test {
class {resource.class-name}IT extends {resource.class-name}Test {
// Execute the same tests but in packaged mode.
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class {resource.class-name}Test {

class {resource.class-name}Test {
@Test
public void testHelloEndpoint() {
void testHelloEndpoint() {
given()
.when().get("{resource.path}")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class {resource.class-name}IT extends {resource.class-name}Test {
class {resource.class-name}IT extends {resource.class-name}Test {
// Execute the same tests but in packaged mode.
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class {resource.class-name}Test {

class {resource.class-name}Test {
@Test
public void testHelloEndpoint() {
void testHelloEndpoint() {
given()
.when().get("{resource.path}")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class {resource.class-name}IT extends {resource.class-name}Test {
class {resource.class-name}IT extends {resource.class-name}Test {
// Execute the same tests but in packaged mode.
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class {resource.class-name}Test {

class {resource.class-name}Test {
@Test
public void testHelloEndpoint() {
void testHelloEndpoint() {
given()
.when().get("{resource.path}")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class LambdaHandlerTest {

class LambdaHandlerTest {
@Test
public void testSimpleLambdaSuccess() throws Exception {
void testSimpleLambdaSuccess() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import static org.hamcrest.CoreMatchers.containsString;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testFunqyLambda() throws Exception {
void testFunqyLambda() throws Exception {
// you test your lambdas by invoking on http://localhost:8081
// this works in dev mode too

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_CLOUD_EVENTS, functionName = "helloCloudEvent")
class GreetingFunctionsCloudEventsTest {
@Test
public void testHelloCloudEvent() {
void testHelloCloudEvent() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloPubSubWorld")
class GreetingFunctionsPubSubTest {
@Test
public void testHelloPubSubWorld() {
void testHelloPubSubWorld() {
given()
.body("{\"data\":{\"data\":\"world\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(value = FunctionType.FUNQY_BACKGROUND, functionName = "helloGCSWorld")
class GreetingFunctionsStorageTest {
@Test
public void testHelloGCSWorld() {
void testHelloGCSWorld() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static org.hamcrest.Matchers.containsString;

@QuarkusTest
public class MyFunctionsTest {

class MyFunctionsTest {
@Test
public void testFun() {
void testFun() {
given()
.post("/fun")
.then()
Expand All @@ -20,7 +19,7 @@ public void testFun() {
}

@Test
public void testFunWithName() {
void testFunWithName() {
given()
.contentType(ContentType.JSON)
.body("{\"name\": \"Friend\"}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class FunqyIT extends FunqyTest {
class FunqyIT extends FunqyTest {

// Run the same tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
import static org.hamcrest.Matchers.notNullValue;

@QuarkusTest
public class FunqyTest {

class FunqyTest {
@Test
public void testCloudEvent() {
void testCloudEvent() {
RestAssured.given().contentType("application/json")
.header("ce-specversion", "1.0")
.header("ce-id", UUID.randomUUID().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.BACKGROUND)
class HelloWorldBackgroundFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\"data\":{\"name\":\"hello.txt\"}}")
.when()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@WithFunction(FunctionType.CLOUD_EVENTS)
class HelloWorldCloudEventsFunctionTest {
@Test
public void testAccept() {
void testAccept() {
given()
.body("{\n" +
" \"bucket\": \"MY_BUCKET\",\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@WithFunction(FunctionType.HTTP)
class HelloWorldHttpFunctionTest {
@Test
public void testService() {
void testService() {
when()
.get()
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import org.junit.jupiter.api.Test;

@QuarkusTest
public class HelloGrpcServiceTest {
class HelloGrpcServiceTest {

@GrpcClient
HelloGrpc helloGrpc;

@Test
public void testHello() {
void testHello() {
HelloReply reply = helloGrpc
.sayHello(HelloRequest.newBuilder().setName("Neo").build()).await().atMost(Duration.ofSeconds(5));
assertEquals("Hello Neo!", reply.getMessage());
Expand Down
Loading

0 comments on commit 4d6f278

Please sign in to comment.