Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
<configuration>
<inputSpec>${project.basedir}/../belgif-rest-problem-it-common/src/main/resources/openapi.yaml</inputSpec>
<generatorName>spring</generatorName>
<apiPackage>io.github.belgif.rest.problem.openapi.validation.sb3.api</apiPackage>
<modelPackage>io.github.belgif.rest.problem.openapi.validation.sb3.model</modelPackage>
<apiPackage>io.github.belgif.rest.problem.it.openapi.validation.sb3.api</apiPackage>
<modelPackage>io.github.belgif.rest.problem.it.openapi.validation.sb3.model</modelPackage>
<openapiNormalizer>REF_AS_PARENT_IN_ALLOF=true</openapiNormalizer>
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.net.URI;

Expand All @@ -9,6 +9,7 @@

import com.acme.custom.CustomProblem;

import io.github.belgif.rest.problem.BadRequestProblem;
import io.github.belgif.rest.problem.api.Problem;
import io.github.belgif.rest.problem.it.model.JacksonModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

public enum Client {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.net.URI;

Expand Down Expand Up @@ -26,6 +26,9 @@

import com.acme.custom.CustomProblem;

import io.github.belgif.rest.problem.BadRequestProblem;
import io.github.belgif.rest.problem.DefaultProblem;
import io.github.belgif.rest.problem.ServiceUnavailableProblem;
import io.github.belgif.rest.problem.api.Input;
import io.github.belgif.rest.problem.api.Problem;
import io.github.belgif.rest.problem.i18n.I18N;
Expand Down Expand Up @@ -66,7 +69,7 @@
@EventListener
public void onApplicationEvent(ServletWebServerInitializedEvent event) {
this.restTemplate = restTemplateBuilder
.rootUri("http://localhost:" + event.getWebServer().getPort() + "/spring/backend")

Check failure on line 72 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "http://localhost:" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBR&open=AZz268WV1Bw9PZgzVkBR&pullRequest=313

Check failure on line 72 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/spring/backend" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBN&open=AZz268WV1Bw9PZgzVkBN&pullRequest=313
.build();
this.webClient = webClientBuilder
.baseUrl("http://localhost:" + event.getWebServer().getPort() + "/spring/backend")
Expand Down Expand Up @@ -95,7 +98,7 @@

@GetMapping("/runtime")
public void runtime() {
throw new RuntimeException("oops");

Check warning on line 101 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBM&open=AZz268WV1Bw9PZgzVkBM&pullRequest=313
}

@GetMapping("/unmapped")
Expand Down Expand Up @@ -130,7 +133,7 @@
public void badRequestFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/badRequest", String.class);

Check failure on line 136 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/badRequest" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBV&open=AZz268WV1Bw9PZgzVkBV&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/badRequest").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -147,7 +150,7 @@
public void customFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/custom", String.class);

Check failure on line 153 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/custom" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBU&open=AZz268WV1Bw9PZgzVkBU&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/custom").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -164,7 +167,7 @@
public void unmappedFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/unmapped", String.class);

Check failure on line 170 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/unmapped" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBP&open=AZz268WV1Bw9PZgzVkBP&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/unmapped").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -181,7 +184,7 @@
public void applicationJsonProblemFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/applicationJsonProblem", String.class);

Check failure on line 187 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/applicationJsonProblem" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBS&open=AZz268WV1Bw9PZgzVkBS&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/applicationJsonProblem").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -197,7 +200,7 @@
@GetMapping("/jacksonMismatchedInputFromBackend")
public void jacksonMismatchedInputFromBackend(@RequestParam("client") Client client) {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/jacksonMismatchedInput", JacksonModel.class);

Check failure on line 203 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/jacksonMismatchedInput" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBT&open=AZz268WV1Bw9PZgzVkBT&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/jacksonMismatchedInput").retrieve().toEntity(JacksonModel.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -210,7 +213,7 @@
public ResponseEntity<String> beanValidationQueryParameter(
@RequestParam("param") @Positive @NotNull Integer p,
@RequestParam @Size(max = 5) String other) {
return ResponseEntity.ok("param: " + p + ", other: " + other);

Check failure on line 216 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "param: " 7 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBO&open=AZz268WV1Bw9PZgzVkBO&pullRequest=313
}

@GetMapping("/beanValidation/headerParameter")
Expand Down Expand Up @@ -238,7 +241,7 @@

@PostMapping("/beanValidation/body")
public ResponseEntity<String> beanValidationBody(@Valid @RequestBody Model body) {
return ResponseEntity.ok("body: " + body);

Check failure on line 244 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-3-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "body: " 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268WV1Bw9PZgzVkBQ&open=AZz268WV1Bw9PZgzVkBQ&pullRequest=313
}

@PostMapping("/beanValidation/body/nested")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.util.Collections;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.github.belgif.rest.problem.openapi.validation.sb4.api.MyFirstPathApi;
import io.github.belgif.rest.problem.openapi.validation.sb4.api.MyHeaderPathApi;
import io.github.belgif.rest.problem.openapi.validation.sb4.api.MyQueryPathApi;
import io.github.belgif.rest.problem.openapi.validation.sb4.model.MyRequestBodySchema;
import io.github.belgif.rest.problem.openapi.validation.sb4.model.PostOperationWithAllOfSchemaRequest;
import io.github.belgif.rest.problem.openapi.validation.sb4.model.PostOperationWithOneOfSchemaRequest;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.api.MyFirstPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.api.MyHeaderPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.api.MyQueryPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.model.MyRequestBodySchema;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.model.PostOperationWithAllOfSchemaRequest;
import io.github.belgif.rest.problem.it.openapi.validation.sb3.model.PostOperationWithOneOfSchemaRequest;

@RestController
@RequestMapping("/openapi-validation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;

import io.github.belgif.rest.problem.it.AbstractOpenApiValidationSpringBootIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;

import io.github.belgif.rest.problem.it.AbstractRestProblemExtIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.util.Arrays;
import java.util.stream.Stream;
Expand All @@ -7,7 +7,6 @@
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;

import io.github.belgif.rest.problem.it.AbstractRestProblemSpringBootIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
<configuration>
<inputSpec>${project.basedir}/../belgif-rest-problem-it-common/src/main/resources/openapi.yaml</inputSpec>
<generatorName>spring</generatorName>
<apiPackage>io.github.belgif.rest.problem.openapi.validation.sb4.api</apiPackage>
<modelPackage>io.github.belgif.rest.problem.openapi.validation.sb4.model</modelPackage>
<apiPackage>io.github.belgif.rest.problem.it.openapi.validation.sb4.api</apiPackage>
<modelPackage>io.github.belgif.rest.problem.it.openapi.validation.sb4.model</modelPackage>
<openapiNormalizer>REF_AS_PARENT_IN_ALLOF=true</openapiNormalizer>
<generateSupportingFiles>false</generateSupportingFiles>
<configOptions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.net.URI;

Expand All @@ -9,6 +9,7 @@

import com.acme.custom.CustomProblem;

import io.github.belgif.rest.problem.BadRequestProblem;
import io.github.belgif.rest.problem.api.Problem;
import io.github.belgif.rest.problem.it.model.JacksonModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

public enum Client {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.net.URI;

Expand Down Expand Up @@ -26,6 +26,9 @@

import com.acme.custom.CustomProblem;

import io.github.belgif.rest.problem.BadRequestProblem;
import io.github.belgif.rest.problem.DefaultProblem;
import io.github.belgif.rest.problem.ServiceUnavailableProblem;
import io.github.belgif.rest.problem.api.Input;
import io.github.belgif.rest.problem.api.Problem;
import io.github.belgif.rest.problem.i18n.I18N;
Expand Down Expand Up @@ -66,7 +69,7 @@
@EventListener
public void onApplicationEvent(ServletWebServerInitializedEvent event) {
this.restTemplate = restTemplateBuilder
.rootUri("http://localhost:" + event.getWebServer().getPort() + "/spring/backend")

Check failure on line 72 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "http://localhost:" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBb&open=AZz268X91Bw9PZgzVkBb&pullRequest=313

Check failure on line 72 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/spring/backend" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBX&open=AZz268X91Bw9PZgzVkBX&pullRequest=313
.build();
this.webClient = webClientBuilder
.baseUrl("http://localhost:" + event.getWebServer().getPort() + "/spring/backend")
Expand Down Expand Up @@ -95,7 +98,7 @@

@GetMapping("/runtime")
public void runtime() {
throw new RuntimeException("oops");

Check warning on line 101 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBW&open=AZz268X91Bw9PZgzVkBW&pullRequest=313
}

@GetMapping("/unmapped")
Expand Down Expand Up @@ -130,7 +133,7 @@
public void badRequestFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/badRequest", String.class);

Check failure on line 136 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/badRequest" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBf&open=AZz268X91Bw9PZgzVkBf&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/badRequest").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -147,7 +150,7 @@
public void customFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/custom", String.class);

Check failure on line 153 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/custom" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBe&open=AZz268X91Bw9PZgzVkBe&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/custom").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -164,7 +167,7 @@
public void unmappedFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/unmapped", String.class);

Check failure on line 170 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/unmapped" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBZ&open=AZz268X91Bw9PZgzVkBZ&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/unmapped").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -181,7 +184,7 @@
public void applicationJsonProblemFromBackend(@RequestParam("client") Client client) {
try {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/applicationJsonProblem", String.class);

Check failure on line 187 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/applicationJsonProblem" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBc&open=AZz268X91Bw9PZgzVkBc&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/applicationJsonProblem").retrieve().toEntity(String.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -197,7 +200,7 @@
@GetMapping("/jacksonMismatchedInputFromBackend")
public void jacksonMismatchedInputFromBackend(@RequestParam("client") Client client) {
if (client == Client.REST_TEMPLATE) {
restTemplate.getForObject("/jacksonMismatchedInput", JacksonModel.class);

Check failure on line 203 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/jacksonMismatchedInput" 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBd&open=AZz268X91Bw9PZgzVkBd&pullRequest=313
} else if (client == Client.WEB_CLIENT) {
webClient.get().uri("/jacksonMismatchedInput").retrieve().toEntity(JacksonModel.class).block();
} else if (client == Client.REST_CLIENT) {
Expand All @@ -210,7 +213,7 @@
public ResponseEntity<String> beanValidationQueryParameter(
@RequestParam("param") @Positive @NotNull Integer p,
@RequestParam @Size(max = 5) String other) {
return ResponseEntity.ok("param: " + p + ", other: " + other);

Check failure on line 216 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "param: " 7 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBY&open=AZz268X91Bw9PZgzVkBY&pullRequest=313
}

@GetMapping("/beanValidation/headerParameter")
Expand Down Expand Up @@ -238,7 +241,7 @@

@PostMapping("/beanValidation/body")
public ResponseEntity<String> beanValidationBody(@Valid @RequestBody Model body) {
return ResponseEntity.ok("body: " + body);

Check failure on line 244 in belgif-rest-problem-it/belgif-rest-problem-spring-boot-4-it/src/main/java/io/github/belgif/rest/problem/it/FrontendController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "body: " 3 times.

See more on https://sonarcloud.io/project/issues?id=belgif_rest-problem-java&issues=AZz268X91Bw9PZgzVkBa&open=AZz268X91Bw9PZgzVkBa&pullRequest=313
}

@PostMapping("/beanValidation/body/nested")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.util.Collections;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.github.belgif.rest.problem.openapi.validation.sb3.api.*;
import io.github.belgif.rest.problem.openapi.validation.sb3.model.MyRequestBodySchema;
import io.github.belgif.rest.problem.openapi.validation.sb3.model.PostOperationWithAllOfSchemaRequest;
import io.github.belgif.rest.problem.openapi.validation.sb3.model.PostOperationWithOneOfSchemaRequest;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.api.MyFirstPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.api.MyHeaderPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.api.MyQueryPathApi;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.model.MyRequestBodySchema;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.model.PostOperationWithAllOfSchemaRequest;
import io.github.belgif.rest.problem.it.openapi.validation.sb4.model.PostOperationWithOneOfSchemaRequest;

@RestController
@RequestMapping("/openapi-validation")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;

import io.github.belgif.rest.problem.it.AbstractOpenApiValidationSpringBootIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;

import io.github.belgif.rest.problem.it.AbstractRestProblemExtIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.belgif.rest.problem;
package io.github.belgif.rest.problem.it;

import java.util.Arrays;
import java.util.stream.Stream;
Expand All @@ -7,7 +7,6 @@
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.annotation.DirtiesContext;

import io.github.belgif.rest.problem.it.AbstractRestProblemSpringBootIT;
import io.restassured.RestAssured;
import io.restassured.specification.RequestSpecification;

Expand Down