From 99b6e34bd218c3a5dc3e121acb98c8840ba73e07 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Tue, 2 Jan 2024 12:15:01 +0100 Subject: [PATCH 01/11] feat: refactored exim-api --- .../ExportImportRestControllerV1.java | 10 ++-- .../rs/exim/v1/log/ExportImportLogParam.java | 10 ++-- .../exim/v1/mappers/ExportImportMapperV1.java | 9 +-- .../openapi/onecx-theme-exim-v1-openapi.yaml | 55 +++++++------------ src/main/resources/application.properties | 5 +- ...rtImportRestControllerV1ExceptionTest.java | 4 +- ...xportImportRestControllerV1TenantTest.java | 27 ++++----- .../ExportImportRestControllerV1Test.java | 27 ++++----- 8 files changed, 70 insertions(+), 77 deletions(-) diff --git a/src/main/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1.java b/src/main/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1.java index 4ff3895..27c1dc8 100644 --- a/src/main/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1.java +++ b/src/main/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1.java @@ -35,7 +35,7 @@ public class ExportImportRestControllerV1 implements ThemesExportImportApi { ExportImportMapperV1 mapper; @Override - public Response exportThemes(EximExportRequestDTOV1 request) { + public Response exportThemes(ExportThemeRequestDTOV1 request) { var themes = dao.findThemeByNames(request.getNames()); var data = themes.collect(Collectors.toMap(Theme::getName, theme -> theme)); @@ -48,12 +48,12 @@ public Response exportThemes(EximExportRequestDTOV1 request) { @Override @Transactional(Transactional.TxType.REQUIRES_NEW) - public Response importThemes(EximImportRequestDTOV1 request) { + public Response importThemes(ThemeSnapshotDTOV1 request) { var keys = request.getThemes().keySet(); var themes = dao.findThemeByNames(keys); var map = themes.collect(Collectors.toMap(Theme::getName, theme -> theme)); - Map items = new HashMap<>(); + Map items = new HashMap<>(); request.getThemes().forEach((name, dto) -> { @@ -63,13 +63,13 @@ public Response importThemes(EximImportRequestDTOV1 request) { theme = mapper.create(dto); theme.setName(name); dao.create(theme); - items.put(name, mapper.create(EximThemeResultStatusDTOV1.CREATED)); + items.put(name, ImportThemeResponseStatusDTOV1.CREATED); } else { mapper.update(dto, theme); dao.update(theme); - items.put(name, mapper.create(EximThemeResultStatusDTOV1.UPDATE)); + items.put(name, ImportThemeResponseStatusDTOV1.UPDATE); } }); diff --git a/src/main/java/io/github/onecx/theme/rs/exim/v1/log/ExportImportLogParam.java b/src/main/java/io/github/onecx/theme/rs/exim/v1/log/ExportImportLogParam.java index 3b3225c..9d68422 100644 --- a/src/main/java/io/github/onecx/theme/rs/exim/v1/log/ExportImportLogParam.java +++ b/src/main/java/io/github/onecx/theme/rs/exim/v1/log/ExportImportLogParam.java @@ -6,8 +6,8 @@ import org.tkit.quarkus.log.cdi.LogParam; -import gen.io.github.onecx.theme.rs.exim.v1.model.EximExportRequestDTOV1; -import gen.io.github.onecx.theme.rs.exim.v1.model.EximImportRequestDTOV1; +import gen.io.github.onecx.theme.rs.exim.v1.model.ExportThemeRequestDTOV1; +import gen.io.github.onecx.theme.rs.exim.v1.model.ThemeSnapshotDTOV1; @ApplicationScoped public class ExportImportLogParam implements LogParam { @@ -15,8 +15,8 @@ public class ExportImportLogParam implements LogParam { @Override public List getClasses() { return List.of( - item(10, EximExportRequestDTOV1.class, x -> x.getClass().getSimpleName()), - item(10, EximImportRequestDTOV1.class, - x -> x.getClass().getSimpleName() + ":" + ((EximImportRequestDTOV1) x).getId())); + item(10, ExportThemeRequestDTOV1.class, x -> x.getClass().getSimpleName()), + item(10, ThemeSnapshotDTOV1.class, + x -> x.getClass().getSimpleName() + ":" + ((ThemeSnapshotDTOV1) x).getId())); } } diff --git a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java index cab851c..4527aff 100644 --- a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java +++ b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java @@ -25,15 +25,16 @@ public abstract class ExportImportMapperV1 { @Mapping(target = "id", source = "request.id") @Mapping(target = "themes", source = "themes") - public abstract EximImportResultDTOV1 create(EximImportRequestDTOV1 request, Map themes); + public abstract ImportThemeResponseDTOV1 create(ThemeSnapshotDTOV1 request, + Map themes); - public abstract EximThemeResultDTOV1 create(EximThemeResultStatusDTOV1 status); + // public abstract EximThemeResultDTOV1 create(EximThemeResultStatusDTOV1 status); - public EximImportRequestDTOV1 create(Map data) { + public ThemeSnapshotDTOV1 create(Map data) { if (data == null) { return null; } - EximImportRequestDTOV1 result = new EximImportRequestDTOV1(); + ThemeSnapshotDTOV1 result = new ThemeSnapshotDTOV1(); result.setCreated(OffsetDateTime.now()); result.setThemes(map(data)); return result; diff --git a/src/main/openapi/onecx-theme-exim-v1-openapi.yaml b/src/main/openapi/onecx-theme-exim-v1-openapi.yaml index ddfb412..ee05185 100644 --- a/src/main/openapi/onecx-theme-exim-v1-openapi.yaml +++ b/src/main/openapi/onecx-theme-exim-v1-openapi.yaml @@ -19,16 +19,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EximExportRequest' + $ref: '#/components/schemas/ExportThemeRequest' responses: "200": description: OK content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/EximImportRequest' + $ref: '#/components/schemas/ThemeSnapshot' "404": description: No themes founds /exim/v1/themes/import: @@ -42,14 +40,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EximImportRequest' + $ref: '#/components/schemas/ThemeSnapshot' responses: "200": description: Import result content: application/json: schema: - $ref: '#/components/schemas/EximImportResult' + $ref: '#/components/schemas/ImportThemeResponse' "400": description: Bad request content: @@ -58,7 +56,7 @@ paths: $ref: '#/components/schemas/EximProblemDetailResponse' components: schemas: - EximExportRequest: + ExportThemeRequest: type: object properties: names: @@ -66,47 +64,36 @@ components: uniqueItems: true items: type: string - EximImportResult: + ThemeSnapshot: type: object properties: id: type: string minLength: 10 description: ID of the request + created: + $ref: '#/components/schemas/OffsetDateTime' themes: - $ref: '#/components/schemas/EximImportResultThemes' - EximImportResultThemes: - type: object - nullable: false - additionalProperties: - $ref: '#/components/schemas/EximThemeResult' - EximThemeResult: - type: object - properties: - status: - $ref: '#/components/schemas/EximThemeResultStatus' - EximThemeResultStatus: - type: string - enum: - - UPDATE - - CREATED - - SKIP - EximImportRequest: + type: object + nullable: false + additionalProperties: + $ref: '#/components/schemas/EximTheme' + ImportThemeResponse: type: object properties: id: type: string minLength: 10 description: ID of the request - created: - $ref: '#/components/schemas/OffsetDateTime' themes: - $ref: '#/components/schemas/EximImportThemes' - EximImportThemes: - type: object - nullable: false - additionalProperties: - $ref: '#/components/schemas/EximTheme' + additionalProperties: + $ref: '#/components/schemas/ImportThemeResponseStatus' + ImportThemeResponseStatus: + type: string + enum: + - UPDATE + - CREATED + - SKIP EximTheme: type: object properties: diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9f98d3c..d745cdc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -23,11 +23,14 @@ tkit.rs.context.tenant-id.enabled=true %prod.quarkus.datasource.username=${DB_USER:onecx-theme} %prod.quarkus.datasource.password=${DB_PWD:onecx-theme} +%dev.quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgresdb:5432/onecx-theme?sslmode=disable} +%dev.quarkus.datasource.username=${DB_USER:onecx-theme} +%dev.quarkus.datasource.password=${DB_PWD:onecx-theme} # DEV %dev.tkit.rs.context.tenant-id.enabled=true %dev.tkit.rs.context.tenant-id.mock.enabled=true -%dev.tkit.rs.context.tenant-id.mock.default-tenant=test +%dev.tkit.rs.context.tenant-id.mock.default-tenant=tenant100 %dev.tkit.rs.context.tenant-id.mock.data.org1=tenant100 # TEST diff --git a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1ExceptionTest.java b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1ExceptionTest.java index 4e65d30..af478da 100644 --- a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1ExceptionTest.java +++ b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1ExceptionTest.java @@ -10,7 +10,7 @@ import org.mockito.Mockito; import org.tkit.quarkus.jpa.exceptions.DAOException; -import gen.io.github.onecx.theme.rs.exim.v1.model.EximExportRequestDTOV1; +import gen.io.github.onecx.theme.rs.exim.v1.model.ExportThemeRequestDTOV1; import io.github.onecx.theme.domain.daos.ThemeDAO; import io.github.onecx.theme.test.AbstractTest; import io.quarkus.test.InjectMock; @@ -34,7 +34,7 @@ void beforeAll() { @Test void exportThemesExceptionTest() { - var request = new EximExportRequestDTOV1(); + var request = new ExportThemeRequestDTOV1(); given() .when() diff --git a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1TenantTest.java b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1TenantTest.java index d6c7e86..8b528a7 100644 --- a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1TenantTest.java +++ b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1TenantTest.java @@ -25,7 +25,7 @@ class ExportImportRestControllerV1TenantTest extends AbstractTest { @Test void exportThemesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ExportThemeRequestDTOV1(); var dto = given() .when() @@ -35,7 +35,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(2); @@ -48,7 +48,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(1); @@ -61,7 +61,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(2); @@ -79,7 +79,7 @@ void exportThemesTest() { @Test void exportThemesWrongNamesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ExportThemeRequestDTOV1(); request.setNames(Set.of("does-not-exists")); given() @@ -105,13 +105,13 @@ void exportThemesEmptyBodyTest() { .extract().as(EximProblemDetailResponseDTOV1.class); assertThat(exception.getErrorCode()).isEqualTo("CONSTRAINT_VIOLATIONS"); - assertThat(exception.getDetail()).isEqualTo("exportThemes.eximExportRequestDTOV1: must not be null"); + assertThat(exception.getDetail()).isEqualTo("exportThemes.exportThemeRequestDTOV1: must not be null"); } @Test void importThemesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ThemeSnapshotDTOV1(); var data = given() .when() @@ -121,7 +121,7 @@ void importThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(data).isNotNull(); assertThat(data.getThemes()).hasSize(2); @@ -137,14 +137,15 @@ void importThemesTest() { .post("import") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportResultDTOV1.class); + .extract().as(ImportThemeResponseDTOV1.class); - assertThat(dto).isNotNull().returns(data.getId(), from(EximImportResultDTOV1::getId)); + assertThat(dto).isNotNull().returns(data.getId(), from(ImportThemeResponseDTOV1::getId)); assertThat(dto.getThemes()).isNotNull().hasSize(3); - assertThat(dto.getThemes().get("cg")).returns(EximThemeResultStatusDTOV1.UPDATE, from(EximThemeResultDTOV1::getStatus)); - assertThat(dto.getThemes().get("new_theme")).returns(EximThemeResultStatusDTOV1.CREATED, - from(EximThemeResultDTOV1::getStatus)); + assertThat(dto.getThemes().get("cg")).returns(ImportThemeResponseStatusDTOV1.UPDATE.toString(), + from(ImportThemeResponseStatusDTOV1::toString)); + assertThat(dto.getThemes().get("new_theme")).returns(ImportThemeResponseStatusDTOV1.CREATED.toString(), + from(ImportThemeResponseStatusDTOV1::toString)); } } diff --git a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java index 79d2d36..c07f92b 100644 --- a/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java +++ b/src/test/java/io/github/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java @@ -25,7 +25,7 @@ class ExportImportRestControllerV1Test extends AbstractTest { @Test void exportThemesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ExportThemeRequestDTOV1(); var dto = given() .when() @@ -34,7 +34,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(3); @@ -46,7 +46,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(3); @@ -58,7 +58,7 @@ void exportThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(dto).isNotNull(); assertThat(dto.getThemes()).hasSize(2); } @@ -66,7 +66,7 @@ void exportThemesTest() { @Test void exportThemesWrongNamesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ExportThemeRequestDTOV1(); request.setNames(Set.of("does-not-exists")); given() @@ -90,13 +90,13 @@ void exportThemesEmptyBodyTest() { .extract().as(EximProblemDetailResponseDTOV1.class); assertThat(exception.getErrorCode()).isEqualTo("CONSTRAINT_VIOLATIONS"); - assertThat(exception.getDetail()).isEqualTo("exportThemes.eximExportRequestDTOV1: must not be null"); + assertThat(exception.getDetail()).isEqualTo("exportThemes.exportThemeRequestDTOV1: must not be null"); } @Test void importThemesTest() { - var request = new EximExportRequestDTOV1(); + var request = new ThemeSnapshotDTOV1(); var data = given() .when() @@ -105,7 +105,7 @@ void importThemesTest() { .post("export") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportRequestDTOV1.class); + .extract().as(ThemeSnapshotDTOV1.class); assertThat(data).isNotNull(); assertThat(data.getThemes()).hasSize(3); @@ -120,14 +120,15 @@ void importThemesTest() { .post("import") .then() .statusCode(OK.getStatusCode()) - .extract().as(EximImportResultDTOV1.class); + .extract().as(ImportThemeResponseDTOV1.class); - assertThat(dto).isNotNull().returns(data.getId(), from(EximImportResultDTOV1::getId)); + assertThat(dto).isNotNull().returns(data.getId(), from(ImportThemeResponseDTOV1::getId)); assertThat(dto.getThemes()).isNotNull().hasSize(4); - assertThat(dto.getThemes().get("cg")).returns(EximThemeResultStatusDTOV1.UPDATE, from(EximThemeResultDTOV1::getStatus)); - assertThat(dto.getThemes().get("new_theme")).returns(EximThemeResultStatusDTOV1.CREATED, - from(EximThemeResultDTOV1::getStatus)); + assertThat(dto.getThemes().get("cg")).returns(ImportThemeResponseStatusDTOV1.UPDATE.toString(), + from(ImportThemeResponseStatusDTOV1::toString)); + assertThat(dto.getThemes().get("new_theme")).returns(ImportThemeResponseStatusDTOV1.CREATED.toString(), + from(ImportThemeResponseStatusDTOV1::toString)); } } From 586b7b5d576a6f1af4f3f0473a932c01cd0dc8db Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:16:08 +0100 Subject: [PATCH 02/11] fix: removed comment --- .../onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java index 4527aff..9cf135c 100644 --- a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java +++ b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java @@ -27,9 +27,7 @@ public abstract class ExportImportMapperV1 { @Mapping(target = "themes", source = "themes") public abstract ImportThemeResponseDTOV1 create(ThemeSnapshotDTOV1 request, Map themes); - - // public abstract EximThemeResultDTOV1 create(EximThemeResultStatusDTOV1 status); - + public ThemeSnapshotDTOV1 create(Map data) { if (data == null) { return null; From e06639e08d4f9eb88e9ee0b8a21684cfc7aa96d3 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:18:55 +0100 Subject: [PATCH 03/11] fix: reverted changes --- src/main/resources/application.properties | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d745cdc..e4d8dcd 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -23,14 +23,11 @@ tkit.rs.context.tenant-id.enabled=true %prod.quarkus.datasource.username=${DB_USER:onecx-theme} %prod.quarkus.datasource.password=${DB_PWD:onecx-theme} -%dev.quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgresdb:5432/onecx-theme?sslmode=disable} -%dev.quarkus.datasource.username=${DB_USER:onecx-theme} -%dev.quarkus.datasource.password=${DB_PWD:onecx-theme} # DEV %dev.tkit.rs.context.tenant-id.enabled=true %dev.tkit.rs.context.tenant-id.mock.enabled=true -%dev.tkit.rs.context.tenant-id.mock.default-tenant=tenant100 +%dev.tkit.rs.context.tenant-id.mock.default-tenant=test %dev.tkit.rs.context.tenant-id.mock.data.org1=tenant100 # TEST @@ -58,5 +55,4 @@ quarkus.test.integration-test-profile=test-it %test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 -# PIPE CONFIG - +# PIPE CONFIG \ No newline at end of file From d418a6d64af25217bc4f67db7d94b7920410a8ac Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:20:32 +0100 Subject: [PATCH 04/11] fix: format --- .../onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java index 9cf135c..0a233e0 100644 --- a/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java +++ b/src/main/java/io/github/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java @@ -27,7 +27,7 @@ public abstract class ExportImportMapperV1 { @Mapping(target = "themes", source = "themes") public abstract ImportThemeResponseDTOV1 create(ThemeSnapshotDTOV1 request, Map themes); - + public ThemeSnapshotDTOV1 create(Map data) { if (data == null) { return null; From 7382da461df3d0ca1521c080a50a190f3d992d68 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:21:57 +0100 Subject: [PATCH 05/11] feat: spaces --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e4d8dcd..c626e9d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -55,4 +55,4 @@ quarkus.test.integration-test-profile=test-it %test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 -# PIPE CONFIG \ No newline at end of file +# PIPE CONFIG From 19598d810736092681004b4dec92a42c84c574f3 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:23:41 +0100 Subject: [PATCH 06/11] fix: removed space --- src/main/resources/application.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c626e9d..9ffeee2 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -44,7 +44,6 @@ tkit.rs.context.tenant-id.enabled=true %test.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token %test.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 - # TEST-IT quarkus.test.integration-test-profile=test-it %test-it.tkit.log.json.enabled=false From 5439dd8ee727a6243236f0888a8c2ded245a37ba Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:26:52 +0100 Subject: [PATCH 07/11] fix: dos spacing --- src/main/resources/application.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9ffeee2..734c2e2 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -53,5 +53,4 @@ quarkus.test.integration-test-profile=test-it %test-it.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token %test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 - # PIPE CONFIG From ae4adf130db355e987d8dc43d44506a9611b8b39 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:30:14 +0100 Subject: [PATCH 08/11] fix: encoding --- src/main/resources/application.properties | 112 +++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 734c2e2..49773b5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,56 +1,56 @@ -# DEFAULT -quarkus.datasource.db-kind=postgresql -quarkus.datasource.jdbc.max-size=30 -quarkus.datasource.jdbc.min-size=10 - -quarkus.hibernate-orm.database.generation=validate -quarkus.hibernate-orm.multitenant=DISCRIMINATOR -quarkus.liquibase.migrate-at-start=true -quarkus.liquibase.validate-on-migrate=true - - -tkit.dataimport.enabled=false -tkit.dataimport.configurations.theme.file=dev-data.import.json -tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT -tkit.dataimport.configurations.theme.enabled=false -tkit.dataimport.configurations.theme.stop-at-error=true - -# enable or disable multi-tenancy support -tkit.rs.context.tenant-id.enabled=true - -# PROD -%prod.quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgresdb:5432/onecx-theme?sslmode=disable} -%prod.quarkus.datasource.username=${DB_USER:onecx-theme} -%prod.quarkus.datasource.password=${DB_PWD:onecx-theme} - - -# DEV -%dev.tkit.rs.context.tenant-id.enabled=true -%dev.tkit.rs.context.tenant-id.mock.enabled=true -%dev.tkit.rs.context.tenant-id.mock.default-tenant=test -%dev.tkit.rs.context.tenant-id.mock.data.org1=tenant100 - -# TEST -%test.tkit.dataimport.enabled=true -%test.tkit.dataimport.configurations.theme.enabled=true -%test.tkit.dataimport.configurations.theme.file=./src/test/resources/import/theme-import.json -%test.tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT -%test.tkit.dataimport.configurations.theme.stop-at-error=true - -%test.tkit.rs.context.tenant-id.enabled=true -%test.tkit.rs.context.tenant-id.mock.enabled=true -%test.tkit.rs.context.tenant-id.mock.default-tenant=default -%test.tkit.rs.context.tenant-id.mock.claim-org-id=orgId -%test.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token -%test.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 -%test.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 -# TEST-IT -quarkus.test.integration-test-profile=test-it -%test-it.tkit.log.json.enabled=false -%test-it.tkit.rs.context.tenant-id.mock.enabled=true -%test-it.tkit.rs.context.tenant-id.mock.default-tenant=default -%test-it.tkit.rs.context.tenant-id.mock.claim-org-id=orgId -%test-it.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token -%test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 -%test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 -# PIPE CONFIG +# DEFAULT +quarkus.datasource.db-kind=postgresql +quarkus.datasource.jdbc.max-size=30 +quarkus.datasource.jdbc.min-size=10 + +quarkus.hibernate-orm.database.generation=validate +quarkus.hibernate-orm.multitenant=DISCRIMINATOR +quarkus.liquibase.migrate-at-start=true +quarkus.liquibase.validate-on-migrate=true + + +tkit.dataimport.enabled=false +tkit.dataimport.configurations.theme.file=dev-data.import.json +tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT +tkit.dataimport.configurations.theme.enabled=false +tkit.dataimport.configurations.theme.stop-at-error=true + +# enable or disable multi-tenancy support +tkit.rs.context.tenant-id.enabled=true + +# PROD +%prod.quarkus.datasource.jdbc.url=${DB_URL:jdbc:postgresql://postgresdb:5432/onecx-theme?sslmode=disable} +%prod.quarkus.datasource.username=${DB_USER:onecx-theme} +%prod.quarkus.datasource.password=${DB_PWD:onecx-theme} + + +# DEV +%dev.tkit.rs.context.tenant-id.enabled=true +%dev.tkit.rs.context.tenant-id.mock.enabled=true +%dev.tkit.rs.context.tenant-id.mock.default-tenant=test +%dev.tkit.rs.context.tenant-id.mock.data.org1=tenant100 + +# TEST +%test.tkit.dataimport.enabled=true +%test.tkit.dataimport.configurations.theme.enabled=true +%test.tkit.dataimport.configurations.theme.file=./src/test/resources/import/theme-import.json +%test.tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT +%test.tkit.dataimport.configurations.theme.stop-at-error=true + +%test.tkit.rs.context.tenant-id.enabled=true +%test.tkit.rs.context.tenant-id.mock.enabled=true +%test.tkit.rs.context.tenant-id.mock.default-tenant=default +%test.tkit.rs.context.tenant-id.mock.claim-org-id=orgId +%test.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token +%test.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 +%test.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 +# TEST-IT +quarkus.test.integration-test-profile=test-it +%test-it.tkit.log.json.enabled=false +%test-it.tkit.rs.context.tenant-id.mock.enabled=true +%test-it.tkit.rs.context.tenant-id.mock.default-tenant=default +%test-it.tkit.rs.context.tenant-id.mock.claim-org-id=orgId +%test-it.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token +%test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 +%test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 +# PIPE CONFIG \ No newline at end of file From 978529f7036a0b74776f22541ece11b4c2c0fae7 Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 3 Jan 2024 11:30:50 +0100 Subject: [PATCH 09/11] fix: readded linebreak --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 49773b5..b920ee2 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -53,4 +53,4 @@ quarkus.test.integration-test-profile=test-it %test-it.tkit.rs.context.tenant-id.mock.token-header-param=apm-principal-token %test-it.tkit.rs.context.tenant-id.mock.data.org1=tenant-100 %test-it.tkit.rs.context.tenant-id.mock.data.org2=tenant-200 -# PIPE CONFIG \ No newline at end of file +# PIPE CONFIG From f2c1b60ec8aae1fe3c38867c58cc19aecd11e99f Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Wed, 3 Jan 2024 11:52:54 +0100 Subject: [PATCH 10/11] fix: disable JSON logger --- src/main/resources/application.properties | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b920ee2..c3b2d8c 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,13 +8,17 @@ quarkus.hibernate-orm.multitenant=DISCRIMINATOR quarkus.liquibase.migrate-at-start=true quarkus.liquibase.validate-on-migrate=true - tkit.dataimport.enabled=false tkit.dataimport.configurations.theme.file=dev-data.import.json tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT tkit.dataimport.configurations.theme.enabled=false tkit.dataimport.configurations.theme.stop-at-error=true +tkit.quarkus.log.level=INFO +tkit.log.json.enabled=false +tkit.log.json.pretty-print=false +tkit.log.json.print-details=false + # enable or disable multi-tenancy support tkit.rs.context.tenant-id.enabled=true From b3422df34bd0a0001e94d36f505c810158e93a00 Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Wed, 3 Jan 2024 11:56:10 +0100 Subject: [PATCH 11/11] fix: disable JSON logger --- src/main/resources/application.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index c3b2d8c..b95fe05 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -14,7 +14,6 @@ tkit.dataimport.configurations.theme.metadata.operation=CLEAN_INSERT tkit.dataimport.configurations.theme.enabled=false tkit.dataimport.configurations.theme.stop-at-error=true -tkit.quarkus.log.level=INFO tkit.log.json.enabled=false tkit.log.json.pretty-print=false tkit.log.json.print-details=false