From 32c702cb9423058102af3a9861359dad658acccc Mon Sep 17 00:00:00 2001 From: DISHA ANAND Date: Sat, 4 Nov 2023 18:13:05 -0300 Subject: [PATCH 01/10] test: added test-cased for JSR310DateConverters, RandomUtil, ProblemDetailWithCause file --- .../domain/util/JSR310DateConvertersTest.java | 31 ++++++++++++ .../jhipster/security/ssl/RandomUtilTest.java | 30 +++++++++++ .../errors/ProblemDetailWithCauseTest.java | 50 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 jhipster-framework/src/test/java/tech/jhipster/domain/util/JSR310DateConvertersTest.java create mode 100644 jhipster-framework/src/test/java/tech/jhipster/security/ssl/RandomUtilTest.java create mode 100644 jhipster-framework/src/test/java/tech/jhipster/web/rest/errors/ProblemDetailWithCauseTest.java diff --git a/jhipster-framework/src/test/java/tech/jhipster/domain/util/JSR310DateConvertersTest.java b/jhipster-framework/src/test/java/tech/jhipster/domain/util/JSR310DateConvertersTest.java new file mode 100644 index 000000000..2398bc8b2 --- /dev/null +++ b/jhipster-framework/src/test/java/tech/jhipster/domain/util/JSR310DateConvertersTest.java @@ -0,0 +1,31 @@ +package tech.jhipster.domain.util; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.time.*; +import java.util.Date; +public class JSR310DateConvertersTest { + @Test + void testLocalDateToDateConverter() { + LocalDate localDate = LocalDate.now(); + Date date = JSR310DateConverters.LocalDateToDateConverter.INSTANCE.convert(localDate); + + assertEquals(localDate, JSR310DateConverters.DateToLocalDateConverter.INSTANCE.convert(date)); + } + + @Test + void testDurationToLongConverter() { + Duration duration = Duration.ofHours(5); + Long durationInNanos = JSR310DateConverters.DurationToLongConverter.INSTANCE.convert(duration); + + assertEquals(duration, JSR310DateConverters.LongToDurationConverter.INSTANCE.convert(durationInNanos)); + } + + @Test + void testDateToZonedDateTimeConverter() { + Date date = new Date(); + ZonedDateTime zonedDateTime = JSR310DateConverters.DateToZonedDateTimeConverter.INSTANCE.convert(date); + + assertEquals(date.toInstant(), JSR310DateConverters.ZonedDateTimeToDateConverter.INSTANCE.convert(zonedDateTime).toInstant()); + } + +} diff --git a/jhipster-framework/src/test/java/tech/jhipster/security/ssl/RandomUtilTest.java b/jhipster-framework/src/test/java/tech/jhipster/security/ssl/RandomUtilTest.java new file mode 100644 index 000000000..dfb1129ef --- /dev/null +++ b/jhipster-framework/src/test/java/tech/jhipster/security/ssl/RandomUtilTest.java @@ -0,0 +1,30 @@ +package tech.jhipster.security.ssl; + +import org.junit.jupiter.api.Test; +import tech.jhipster.security.RandomUtil; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class RandomUtilTest { + + @Test + void testGenerateRandomAlphanumericString() { + String randomAlphaString = RandomUtil.generateRandomAlphanumericString(); + + // Check if the generated string is not null and has the expected length + assertNotNull(randomAlphaString); + assertTrue(randomAlphaString.length() == 20); + } + + @Test + void testGeneratePassword() { + String password = RandomUtil.generatePassword(); + + // Check if the generated password is not null and has the expected length + assertNotNull(password); + assertTrue(password.length() == 20); + } + + +} diff --git a/jhipster-framework/src/test/java/tech/jhipster/web/rest/errors/ProblemDetailWithCauseTest.java b/jhipster-framework/src/test/java/tech/jhipster/web/rest/errors/ProblemDetailWithCauseTest.java new file mode 100644 index 000000000..cbbbaca25 --- /dev/null +++ b/jhipster-framework/src/test/java/tech/jhipster/web/rest/errors/ProblemDetailWithCauseTest.java @@ -0,0 +1,50 @@ +package tech.jhipster.web.rest.errors; + + +import org.junit.jupiter.api.Test; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import tech.jhipster.web.rest.errors.ProblemDetailWithCause; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +class ProblemDetailWithCauseTest { + + @Test + void testProblemDetailWithCauseBuilder() { + // Create a cause + ProblemDetailWithCause cause = ProblemDetailWithCause.ProblemDetailWithCauseBuilder.instance() + .withStatus(400) + .withTitle("Bad Request") + .withDetail("Invalid input") + .withType(URI.create("about:blank")) + .build(); + + // Create a main problem detail with a cause + ProblemDetailWithCause problemDetailWithCause = ProblemDetailWithCause.ProblemDetailWithCauseBuilder.instance() + .withStatus(500) + .withTitle("Internal Server Error") + .withDetail("Something went wrong") + .withType(URI.create("about:blank")) + .withCause(cause) + .build(); + + // Verify main problem detail + assertEquals(500, problemDetailWithCause.getStatus()); + assertEquals("Internal Server Error", problemDetailWithCause.getTitle()); + assertEquals("Something went wrong", problemDetailWithCause.getDetail()); + assertEquals(URI.create("about:blank"), problemDetailWithCause.getType()); + assertNotNull(problemDetailWithCause.getCause()); + + // Verify the cause + assertEquals(400, problemDetailWithCause.getCause().getStatus()); + assertEquals("Bad Request", problemDetailWithCause.getCause().getTitle()); + assertEquals("Invalid input", problemDetailWithCause.getCause().getDetail()); + assertEquals(URI.create("about:blank"), problemDetailWithCause.getCause().getType()); + } +} From 62add325fffeb703e4a974f7969308de8b2380f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:15:54 +0000 Subject: [PATCH 02/10] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.0 to 3.6.2 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.0 to 3.6.2. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.0...maven-javadoc-plugin-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad521abae..821b7be20 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 3.4.1 3.2.1 3.1.0 - 3.6.0 + 3.6.2 3.3.0 3.2.1 1.6.13 From 87118562735816819425e5bb5c116089893a6381 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:16:02 +0000 Subject: [PATCH 03/10] Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.2.1 to 3.2.2 Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad521abae..94839bb60 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 3.1.1 2.10 3.4.1 - 3.2.1 + 3.2.2 3.1.0 3.6.0 3.3.0 From c9fc47dc353ba77ebe7d66b16fbfe16de87b9876 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:16:22 +0000 Subject: [PATCH 04/10] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.1 to 3.2.2 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.1...surefire-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad521abae..df4d567ea 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 3.1.0 3.6.0 3.3.0 - 3.2.1 + 3.2.2 1.6.13 1.2.1 3.10.0.2594 From 1882570b24a04f0645920bbeb960d1f11488230e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 14:16:33 +0000 Subject: [PATCH 05/10] Bump com.github.spotbugs:spotbugs-annotations from 4.8.0 to 4.8.1 Bumps [com.github.spotbugs:spotbugs-annotations](https://github.com/spotbugs/spotbugs) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.0...4.8.1) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- jhipster-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhipster-dependencies/pom.xml b/jhipster-dependencies/pom.xml index c6f28affc..59ff21680 100644 --- a/jhipster-dependencies/pom.xml +++ b/jhipster-dependencies/pom.xml @@ -54,7 +54,7 @@ 5.3.4 2.7.0 3.24.3 - 4.8.0 + 4.8.1 2022.0.4 2.2.0 1.19.1 From 27e50ba20b2744442f03f9b5042b16e15878c946 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:44:45 +0000 Subject: [PATCH 06/10] Bump io.mongock:mongock-bom from 5.3.4 to 5.3.5 Bumps [io.mongock:mongock-bom](https://github.com/mongock/mongock-bom) from 5.3.4 to 5.3.5. - [Commits](https://github.com/mongock/mongock-bom/commits) --- updated-dependencies: - dependency-name: io.mongock:mongock-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- jhipster-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhipster-dependencies/pom.xml b/jhipster-dependencies/pom.xml index 59ff21680..307bf4c7b 100644 --- a/jhipster-dependencies/pom.xml +++ b/jhipster-dependencies/pom.xml @@ -51,7 +51,7 @@ 7.4 1.8.0 1.5.5.Final - 5.3.4 + 5.3.5 2.7.0 3.24.3 4.8.1 From 9035c24d0805c362aea998f66cc5443ee5af6112 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:17:43 +0000 Subject: [PATCH 07/10] Bump prettier from 3.0.3 to 3.1.0 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 64d6a391e..295570e74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "devDependencies": { - "prettier": "3.0.3" + "prettier": "3.1.0" }, "scripts": { "prettier:check": "prettier --check .", From fa89a88626818785cf4635cd0a967c6d43790e66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:02:38 +0000 Subject: [PATCH 08/10] Bump org.testcontainers:testcontainers-bom from 1.19.1 to 1.19.2 Bumps [org.testcontainers:testcontainers-bom](https://github.com/testcontainers/testcontainers-java) from 1.19.1 to 1.19.2. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.19.1...1.19.2) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- jhipster-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhipster-dependencies/pom.xml b/jhipster-dependencies/pom.xml index 307bf4c7b..7e896ae6d 100644 --- a/jhipster-dependencies/pom.xml +++ b/jhipster-dependencies/pom.xml @@ -57,7 +57,7 @@ 4.8.1 2022.0.4 2.2.0 - 1.19.1 + 1.19.2 7.8.0 2.4.7 4.1.3 From 5028cb9bc404b79d076bd7c0e5dd6fa88f7aaa22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:03:02 +0000 Subject: [PATCH 09/10] Bump com.playtika.reactivefeign:feign-reactor-bom from 4.0.2 to 4.0.3 Bumps [com.playtika.reactivefeign:feign-reactor-bom](https://github.com/PlaytikaOSS/feign-reactive) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/PlaytikaOSS/feign-reactive/releases) - [Commits](https://github.com/PlaytikaOSS/feign-reactive/compare/4.0.2...4.0.3) --- updated-dependencies: - dependency-name: com.playtika.reactivefeign:feign-reactor-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- jhipster-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhipster-dependencies/pom.xml b/jhipster-dependencies/pom.xml index 307bf4c7b..be8bcd847 100644 --- a/jhipster-dependencies/pom.xml +++ b/jhipster-dependencies/pom.xml @@ -44,7 +44,7 @@ 3.3.2 7.14.0 4.4 - 4.0.2 + 4.0.3 2.1.1 1.9.3 From 26048a15357cf23aa7a66c77e8f24ce3c930f558 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:49:36 +0000 Subject: [PATCH 10/10] Bump org.codehaus.mojo:versions-maven-plugin from 2.16.1 to 2.16.2 Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.16.1 to 2.16.2. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.16.1...2.16.2) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d3fad16af..5f692a39c 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.6.13 1.2.1 3.10.0.2594 - 2.16.1 + 2.16.2