diff --git a/docs/modules/onecx-user-profile-avatar-svc/pages/onecx-user-profile-avatar-svc-extensions.adoc b/docs/modules/onecx-user-profile-avatar-svc/pages/onecx-user-profile-avatar-svc-extensions.adoc index aa28da8..03dd42b 100644 --- a/docs/modules/onecx-user-profile-avatar-svc/pages/onecx-user-profile-avatar-svc-extensions.adoc +++ b/docs/modules/onecx-user-profile-avatar-svc/pages/onecx-user-profile-avatar-svc-extensions.adoc @@ -11,147 +11,147 @@ h| Version | 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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] +| 2.36.0 | 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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] +| 2.36.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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] +| 2.36.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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] +| 2.36.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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] +| 2.36.0 | onecx-tenant | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-tenant.html[Link] -| https://github.com/onecx/onecx-quarkus/blob/0.24.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] -| 0.24.0 +| https://github.com/onecx/onecx-quarkus/blob/0.34.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] +| 0.34.0 | tkit-quarkus-jpa-tenant | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa-tenant.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] +| 2.36.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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] +| 2.36.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.2 +| 3.15.1 | quarkus-liquibase | https://quarkus.io/guides/liquibase[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-liquibase.adoc[Link] -| 3.12.2 +| 3.15.1 | 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.2 +| 3.15.1 | 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.2 +| 3.15.1 | quarkus-hibernate-orm | https://quarkus.io/guides/hibernate-orm[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-orm.adoc[Link] -| 3.12.2 +| 3.15.1 | quarkus-rest | 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.2 +| 3.15.1 | quarkus-rest-jackson | https://quarkus.io/guides/rest-json[Link] | -| 3.12.2 +| 3.15.1 | quarkus-jdbc-postgresql | https://quarkus.io/guides/datasource[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-jdbc-postgresql.adoc[Link] -| 3.12.2 +| 3.15.1 | 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.2 +| 3.15.1 | 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.2 +| 3.15.1 | 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.2 +| 3.15.1 | 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.2 +| 3.15.1 | 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.28.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] -| 2.28.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] +| 2.36.0 | onecx-core | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link] | -| 0.24.0 +| 0.34.0 | 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.2 +| 3.15.1 | onecx-security | | -| 0.24.0 +| 0.34.0 |=== \ No newline at end of file diff --git a/src/main/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestController.java b/src/main/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestController.java index 25554f7..cb50a6d 100644 --- a/src/main/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestController.java +++ b/src/main/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestController.java @@ -29,7 +29,7 @@ public class AvatarExternalV1RestController implements AvatarExternalV1Api { public Response getImage(String userId, RefTypeDTOV1 refType) { Avatar avatar = avatarDAO.findByUserIdAndRefType(userId, refType.toString()); if (avatar == null) { - return Response.status(Response.Status.NOT_FOUND).build(); + return Response.status(Response.Status.NO_CONTENT).build(); } return Response.ok(avatar.getImageData(), avatar.getMimeType()) .header(HttpHeaders.CONTENT_LENGTH, avatar.getLength()).build(); diff --git a/src/main/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestController.java b/src/main/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestController.java index cb69000..5a3c06c 100644 --- a/src/main/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestController.java +++ b/src/main/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestController.java @@ -13,7 +13,6 @@ import org.tkit.onecx.user.profile.avatar.rs.internal.mappers.AvatarMapper; import org.tkit.onecx.user.profile.avatar.rs.internal.mappers.ExceptionMapper; import org.tkit.quarkus.context.ApplicationContext; -import org.tkit.quarkus.jpa.exceptions.ConstraintException; import org.tkit.quarkus.log.cdi.LogService; import gen.org.tkit.onecx.user.profile.avatar.rs.internal.AvatarInternalApi; @@ -60,7 +59,7 @@ public Response deleteMyImage() { public Response getImage(String userId, RefTypeDTO refType) { Avatar avatar = avatarDAO.findByUserIdAndRefType(userId, refType.toString()); if (avatar == null) { - return Response.status(Response.Status.NOT_FOUND).build(); + return Response.status(Response.Status.NO_CONTENT).build(); } return Response.ok(avatar.getImageData(), avatar.getMimeType()) .header(HttpHeaders.CONTENT_LENGTH, avatar.getLength()).build(); @@ -104,11 +103,6 @@ public Response uploadMyImage(Integer contentLength, RefTypeDTO refType, byte[] return uploadImage(contentLength, userId, refType, body); } - @ServerExceptionMapper - public RestResponse exception(ConstraintException ex) { - return exceptionMapper.exception(ex); - } - @ServerExceptionMapper public RestResponse constraint(ConstraintViolationException ex) { return exceptionMapper.constraint(ex); diff --git a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestControllerTest.java b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestControllerTest.java index 6a7f3b0..60dd567 100644 --- a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestControllerTest.java +++ b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/external/v1/controllers/AvatarExternalV1RestControllerTest.java @@ -73,7 +73,7 @@ void getMyImageJpgTest() { } @Test - void getImageTest_shouldReturnNotFound_whenImagesDoesNotExist() { + void getImageTest_shouldReturnNoContent_whenImagesDoesNotExist() { var userId = "productNameGetTest"; var refType = RefTypeDTOV1.MEDIUM; @@ -85,6 +85,6 @@ void getImageTest_shouldReturnNotFound_whenImagesDoesNotExist() { .queryParam("refType", refType) .get("{userId}") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } } diff --git a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTenantTest.java b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTenantTest.java index ac51a5f..b3d491d 100644 --- a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTenantTest.java +++ b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTenantTest.java @@ -65,7 +65,6 @@ void uploadImage() { .statusCode(CREATED.getStatusCode()) .extract() .body().as(ImageInfoDTO.class); - } @Test @@ -92,7 +91,7 @@ void getImageJpgTest() { .pathParam("userId", userId) .get("{userId}") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } @@ -130,7 +129,7 @@ void getMyImageJpgTest() { .header(APM_HEADER_PARAM, createToken("user2", "org2")) .get("me") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } @Test diff --git a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTest.java b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTest.java index c74529f..2b4b2fd 100644 --- a/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/user/profile/avatar/rs/internal/controllers/AvatarInternalRestControllerTest.java @@ -111,7 +111,6 @@ void uploadImage() { .statusCode(CREATED.getStatusCode()) .extract() .body().as(ImageInfoDTO.class); - } @Test @@ -251,7 +250,7 @@ void getMyImageJpgTest() { } @Test - void getImageTest_shouldReturnNotFound_whenImagesDoesNotExist() { + void getImageTest_shouldReturnNoContent_whenImagesDoesNotExist() { var userId = "productNameGetTest"; var refType = RefTypeDTO.MEDIUM; @@ -274,7 +273,7 @@ void getImageTest_shouldReturnNotFound_whenImagesDoesNotExist() { .queryParam("refType", refType) .get("{userId}") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } @Test @@ -336,7 +335,7 @@ void deleteImage() { .queryParam("refType", refType) .get("{userId}") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } @Test @@ -367,11 +366,11 @@ void deleteMyImage() { .queryParam("refType", refType) .get("me") .then() - .statusCode(NOT_FOUND.getStatusCode()); + .statusCode(NO_CONTENT.getStatusCode()); } @Test - void updateImage_returnNotFound_whenEntryNotExists() { + void updateImage_returnNoContent_whenEntryNotExists() { var userId = "productNameUpdateFailed"; var refType = RefTypeDTO.MEDIUM; diff --git a/src/test/java/org/tkit/onecx/user/profile/avatar/test/SecurityTest.java b/src/test/java/org/tkit/onecx/user/profile/avatar/test/SecurityTest.java index 2ba405b..195522b 100644 --- a/src/test/java/org/tkit/onecx/user/profile/avatar/test/SecurityTest.java +++ b/src/test/java/org/tkit/onecx/user/profile/avatar/test/SecurityTest.java @@ -12,7 +12,7 @@ public class SecurityTest extends AbstractSecurityTest { @Override public SecurityTestConfig getConfig() { SecurityTestConfig config = new SecurityTestConfig(); - config.addConfig("read", "/internal/avatar/id", 404, List.of("ocx-up:read"), "get"); + config.addConfig("read", "/internal/avatar/id", 204, List.of("ocx-up:read"), "get"); return config; } }