Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sonar issues
Browse files Browse the repository at this point in the history
andrejpetras committed Jul 19, 2024
1 parent 6e74fd9 commit dfe273a
Showing 2 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -12,37 +12,37 @@ h| Version

| https://quarkus.io/guides/rest[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-rest.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-smallrye-openapi
| https://quarkus.io/guides/openapi-swaggerui[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-openapi.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-rest-jackson
| https://quarkus.io/guides/rest-json[Link]
|
| 3.12.0
| 3.12.2
| quarkus-smallrye-health
| https://quarkus.io/guides/smallrye-health[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-health.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-opentelemetry
| https://quarkus.io/guides/opentelemetry[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-opentelemetry.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-micrometer-registry-prometheus
| https://quarkus.io/guides/telemetry-micrometer[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-micrometer-registry-prometheus.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-openapi-generator
@@ -54,91 +54,91 @@ h| Version
| https://quarkus.io/guides/rest-client[Link]
|
| 3.12.0
| 3.12.2
| tkit-quarkus-log-cdi
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link]
| 2.28.0
| tkit-quarkus-log-rs
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link]
| 2.28.0
| tkit-quarkus-log-json
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link]
| 2.28.0
| tkit-quarkus-rest
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link]
| 2.28.0
| tkit-quarkus-rest-context
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest-context.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link]
| 2.28.0
| tkit-quarkus-jpa
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link]
| 2.28.0
| quarkus-hibernate-validator
| https://quarkus.io/guides/validation[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-validator.adoc[Link]
| 3.12.0
| 3.12.2
| onecx-permissions
| https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-permissions.html[Link]
| https://github.com/onecx/onecx-quarkus/blob/0.22.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link]
| 0.22.0
| https://github.com/onecx/onecx-quarkus/blob/0.24.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link]
| 0.24.0
| quarkus-oidc
| https://quarkus.io/guides/security-oidc-bearer-token-authentication-tutorial[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-oidc-client-reactive-filter
| https://quarkus.io/guides/security-openid-connect-client-reference[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc-client-reactive-filter.adoc[Link]
| 3.12.0
| 3.12.2
| tkit-quarkus-security
| https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link]
| https://github.com/1000kit/tkit-quarkus/blob/2.27.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.27.0
| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link]
| 2.28.0
| onecx-core
| https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link]
|
| 0.22.0
| 0.24.0
| quarkus-arc
| https://quarkus.io/guides/cdi-reference[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-arc.adoc[Link]
| 3.12.0
| 3.12.2
| quarkus-container-image-docker
| https://quarkus.io/guides/container-image[Link]
| https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-container-image-docker.adoc[Link]
| 3.12.0
| 3.12.2
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
@QuarkusTest
@LogService
@TestHTTPEndpoint(ImagesRestController.class)
public class ImageRestControllerTest extends AbstractTest {
class ImageRestControllerTest extends AbstractTest {
@InjectMockServerClient
MockServerClient mockServerClient;

@@ -46,12 +46,12 @@ public class ImageRestControllerTest extends AbstractTest {
private static final File FILE = new File(
Objects.requireNonNull(ImagesRestController.class.getResource("/images/Testimage.jpg")).getFile());

static final String mockId = "MOCK";
static final String MOCK_ID = "MOCK";

@BeforeEach
void resetExpectation() {
try {
mockServerClient.clear(mockId);
mockServerClient.clear(MOCK_ID);
} catch (Exception ex) {
// mockId not existing
}
@@ -67,7 +67,7 @@ void getImageDataByIdTest() {

// create mock rest endpoint
mockServerClient.when(request().withPath("/internal/images/" + "d-11-111").withMethod(HttpMethod.GET))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(Response.Status.OK.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(response)));
@@ -93,7 +93,7 @@ void getImageInfoByIdTest() {

// create mock rest endpoint
mockServerClient.when(request().withPath("/internal/images/info/" + "11-111").withMethod(HttpMethod.GET))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(Response.Status.OK.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(response)));
@@ -124,7 +124,7 @@ void createImageDataTest() throws IOException {
mockServerClient.when(request().withPath("/internal/images").withMethod(HttpMethod.POST)
.withContentType(MediaType.ANY_IMAGE_TYPE)
.withBody(FileUtils.readFileToByteArray(FILE)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(Response.Status.OK.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(response)));
@@ -155,7 +155,7 @@ void createImageInfoTest() {
mockServerClient.when(request().withPath("/internal/images/info").withMethod(HttpMethod.POST)
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(CREATED.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)));
@@ -190,7 +190,7 @@ void updateImageDataByIdTest() throws IOException {
mockServerClient.when(request().withPath("/internal/images/d-11-111").withMethod(HttpMethod.PUT)
.withContentType(MediaType.ANY_IMAGE_TYPE)
.withBody(FileUtils.readFileToByteArray(FILE)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(Response.Status.OK.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(response)));
@@ -215,7 +215,7 @@ void updateImageDataByIdTest() throws IOException {
mockServerClient.when(request().withPath("/internal/images/abc").withMethod(HttpMethod.PUT)
.withContentType(MediaType.ANY_IMAGE_TYPE)
.withBody(FileUtils.readFileToByteArray(FILE)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(NOT_FOUND.getStatusCode()));

//update not-existing image
@@ -242,7 +242,7 @@ void updateImageInfoByIdTest() {
mockServerClient.when(request().withPath("/internal/images/info/11-111").withMethod(HttpMethod.PUT)
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(CREATED.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)));
@@ -285,7 +285,7 @@ void updateOrderTest() {
mockServerClient.when(request().withPath("/internal/images/info/11-111").withMethod(HttpMethod.PUT)
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(CREATED.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(info)));
@@ -362,7 +362,7 @@ void deleteImageInfoByIdTest() {

// create mock rest endpoint
mockServerClient.when(request().withPath("/internal/images/info/" + "11-111").withMethod(HttpMethod.DELETE))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(NO_CONTENT.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON));

@@ -385,7 +385,7 @@ void getAllImageInfosTest() {

// create mock rest endpoint
mockServerClient.when(request().withPath("/internal/images/w1/info").withMethod(HttpMethod.GET))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(Response.Status.OK.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(infos)));
@@ -411,7 +411,7 @@ void testMaxUploadSize() throws IOException {
mockServerClient.when(request().withPath("/internal/images").withMethod(HttpMethod.POST)
.withContentType(MediaType.ANY_IMAGE_TYPE)
.withBody(FileUtils.readFileToByteArray(FILE)))
.withId(mockId)
.withId(MOCK_ID)
.respond(httpRequest -> response().withStatusCode(BAD_REQUEST.getStatusCode())
.withContentType(MediaType.APPLICATION_JSON)
.withBody(JsonBody.json(error)));

0 comments on commit dfe273a

Please sign in to comment.