From 7196f274cef094b8dd100900d0ebc96dc8f23969 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Mon, 23 Dec 2024 15:33:59 +0300 Subject: [PATCH 01/25] Add password validator test code --- code-bugfixing/password-validator/pom.xml | 41 +++++++++++++++++++ .../com/aicode/java/PasswordValidator.java | 26 ++++++++++++ .../src/test/java/com/aicode/java/.dirkeep | 0 3 files changed, 67 insertions(+) create mode 100644 code-bugfixing/password-validator/pom.xml create mode 100644 code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java create mode 100644 code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep diff --git a/code-bugfixing/password-validator/pom.xml b/code-bugfixing/password-validator/pom.xml new file mode 100644 index 0000000..1e91e5a --- /dev/null +++ b/code-bugfixing/password-validator/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + com.aicode.java + passwordValidator + 1.0-SNAPSHOT + + 17 + 17 + UTF-8 + + + + org.junit.jupiter + junit-jupiter-api + 5.8.0 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.8.0 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java b/code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java new file mode 100644 index 0000000..f00e4ed --- /dev/null +++ b/code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java @@ -0,0 +1,26 @@ +package com.aicode.java; + +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +public class PasswordValidator { + + // Regular expression for a strong password + private static final String PASSWORD_REGEX = + "^(?=.[0-9])" + + "(?=.*[a-Z])" + + "(?=.**[A-Z])" + + "(?=.*[@#$%^&+=!])" + + "(?=\\S+$)" + + ".{10,}"; + + private static final Pattern PASSWORD_PATTERN = Pattern.compile(PASSWORD_REGEX); + + public static boolean isValidPassword(String password) { + if (password == null) { + return false; + } + Matcher matcher = PASSWORD_PATTERN.matcher(password); + return matcher.matches(); + } +} diff --git a/code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From d4ec493f62f4d4dfd1b0306080f76cce71607ff3 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Tue, 24 Dec 2024 13:36:35 +0300 Subject: [PATCH 02/25] Add order repository test --- code-bugfixing/order-repository/pom.xml | 58 +++++++++++++++++++ .../src/main/java/com/aicode/java/App.java | 12 ++++ .../src/main/java/com/aicode/java/Order.java | 28 +++++++++ .../java/com/aicode/java/OrderRepository.java | 28 +++++++++ .../src/test/java/com/aicode/java/.dirkeep | 0 5 files changed, 126 insertions(+) create mode 100644 code-bugfixing/order-repository/pom.xml create mode 100644 code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java create mode 100644 code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java create mode 100644 code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java create mode 100644 code-bugfixing/order-repository/src/test/java/com/aicode/java/.dirkeep diff --git a/code-bugfixing/order-repository/pom.xml b/code-bugfixing/order-repository/pom.xml new file mode 100644 index 0000000..8e2db1d --- /dev/null +++ b/code-bugfixing/order-repository/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.4.1 + + + + com.aicode.java + order-repository + 1.0-SNAPSHOT + + + 17 + UTF-8 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.projectlombok + lombok + 1.18.36 + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + com.h2database + h2 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${java.version} + ${java.version} + + + + + \ No newline at end of file diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java b/code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java new file mode 100644 index 0000000..db49162 --- /dev/null +++ b/code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java @@ -0,0 +1,12 @@ +package com.aicode.java; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class App { + + public static void main(String[] args) { + SpringApplication.run(App.class, args); + } +} \ No newline at end of file diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java b/code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java new file mode 100644 index 0000000..1fda770 --- /dev/null +++ b/code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java @@ -0,0 +1,28 @@ +package com.aicode.java; + +import jakarta.persistence.Entity;; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import java.time.LocalDateTime; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@Entity +@Table(name = "orders") +public class Order { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private Long customerId; + private LocalDateTime orderDate; + private String status; + private Double totalCost; +} \ No newline at end of file diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java new file mode 100644 index 0000000..ee2dded --- /dev/null +++ b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java @@ -0,0 +1,28 @@ +package com.aicode.java; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import java.time.LocalDateTime; + +public interface OrderRepository extends JpaRepository { + + @Query("SELECT o FROM Order o " + + "WHERE (:status IS NULL OR o.status = :status) " + + "AND (:customerId IS NULL OR o.customerId = :customerId) " + + "AND (CAST(:minTotalCost AS double) IS NULL OR o.totalCost >= :minTotalCost) " + + "AND (CAST(:maxTotalCost AS double) IS NULL OR o.totalCost <= :maxTotalCost) " + + "AND (:startDate IS NULL OR o.orderDate >= :startDate) " + + "AND (:endDate IS NULL OR o.orderDate <= :endDate)") + Page findOrders( + @Param("status") String status, + @Param("customerId") Long customerId, + @Param("minTotalCost") Double minTotalCost, + @Param("maxTotalCost") Double maxTotalCost, + @Param("startDate") LocalDateTime startDate, + @Param("endDate") LocalDateTime endDate, + Pageable pageable + ); +} diff --git a/code-bugfixing/order-repository/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/order-repository/src/test/java/com/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 7a06785e4d4abab0e2603db849ca45536b226260 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Tue, 24 Dec 2024 14:02:27 +0300 Subject: [PATCH 03/25] Update OrderRepository --- .../src/main/java/com/aicode/java/OrderRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java index ee2dded..e787752 100644 --- a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java +++ b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java @@ -9,10 +9,10 @@ public interface OrderRepository extends JpaRepository { - @Query("SELECT o FROM Order o " + + @Query("SELECT o FROM Orders o " + "WHERE (:status IS NULL OR o.status = :status) " + "AND (:customerId IS NULL OR o.customerId = :customerId) " + - "AND (CAST(:minTotalCost AS double) IS NULL OR o.totalCost >= :minTotalCost) " + + "AND (CAST(:minTotalCost AS double) IS NULL OR o.totalCost >= :minTotalCost " + "AND (CAST(:maxTotalCost AS double) IS NULL OR o.totalCost <= :maxTotalCost) " + "AND (:startDate IS NULL OR o.orderDate >= :startDate) " + "AND (:endDate IS NULL OR o.orderDate <= :endDate)") From 261790c22e311ac31a0c07b6595bb3c16adf4f9c Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Tue, 24 Dec 2024 14:14:40 +0300 Subject: [PATCH 04/25] Update OrderRepository --- .../main/java/com/aicode/java/OrderRepository.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java index e787752..9030fd5 100644 --- a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java +++ b/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java @@ -10,12 +10,12 @@ public interface OrderRepository extends JpaRepository { @Query("SELECT o FROM Orders o " + - "WHERE (:status IS NULL OR o.status = :status) " + - "AND (:customerId IS NULL OR o.customerId = :customerId) " + - "AND (CAST(:minTotalCost AS double) IS NULL OR o.totalCost >= :minTotalCost " + - "AND (CAST(:maxTotalCost AS double) IS NULL OR o.totalCost <= :maxTotalCost) " + - "AND (:startDate IS NULL OR o.orderDate >= :startDate) " + - "AND (:endDate IS NULL OR o.orderDate <= :endDate)") + "WHERE (:status IS NULL OR o.status = status) " + + "AND (:customerId IS NULL OR o.customerId = customerId) " + + "AND (CAST(:minTotalCost AS double) IS NULL OR o.totalCost >= minTotalCost) " + + "AND (CAST(:maxTotalCost AS double) IS NULL OR o.totalCost <= maxTotalCost) " + + "AND (:startDate IS NULL OR o.orderDate >= startDate) " + + "AND (:endDate IS NULL OR o.orderDate <= endDate)") Page findOrders( @Param("status") String status, @Param("customerId") Long customerId, From b49bb28621d9db82de78c2e479cb0813c8edaa7c Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 14:34:38 +0300 Subject: [PATCH 05/25] Add C# password validator test --- .../C#/VisualStudio/passwordValidator.sln | 28 +++++++++++++++++ .../passwordValidator/PasswordValidator.cs | 30 +++++++++++++++++++ .../VisualStudio/passwordValidator/Program.cs | 2 ++ .../passwordValidator.csproj | 10 +++++++ .../PasswordValidatorTest.cs | 30 +++++++++++++++++++ .../passwordValidatorTest.csproj | 22 ++++++++++++++ .../password-validator/{ => java}/pom.xml | 0 .../com/aicode/java/PasswordValidator.java | 0 .../src/test/java/com/aicode/java/.dirkeep | 0 9 files changed, 122 insertions(+) create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidator.sln create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/PasswordValidator.cs create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/Program.cs create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/passwordValidator.csproj create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs create mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/passwordValidatorTest.csproj rename code-bugfixing/password-validator/{ => java}/pom.xml (100%) rename code-bugfixing/password-validator/{ => java}/src/main/java/com/aicode/java/PasswordValidator.java (100%) create mode 100644 code-bugfixing/password-validator/java/src/test/java/com/aicode/java/.dirkeep diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator.sln b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator.sln new file mode 100644 index 0000000..8dc7d69 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "passwordValidator", "passwordValidator\passwordValidator.csproj", "{FFABDF22-C88D-4CF4-933A-BFE14C3264C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "passwordValidatorTest", "passwordValidatorTest\passwordValidatorTest.csproj", "{2908A07E-BBE3-49EB-9797-43859C4D7FF6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FFABDF22-C88D-4CF4-933A-BFE14C3264C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FFABDF22-C88D-4CF4-933A-BFE14C3264C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FFABDF22-C88D-4CF4-933A-BFE14C3264C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FFABDF22-C88D-4CF4-933A-BFE14C3264C5}.Release|Any CPU.Build.0 = Release|Any CPU + {2908A07E-BBE3-49EB-9797-43859C4D7FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2908A07E-BBE3-49EB-9797-43859C4D7FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2908A07E-BBE3-49EB-9797-43859C4D7FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2908A07E-BBE3-49EB-9797-43859C4D7FF6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/PasswordValidator.cs b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/PasswordValidator.cs new file mode 100644 index 0000000..00aa383 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/PasswordValidator.cs @@ -0,0 +1,30 @@ +using System.Text.RegularExpressions; + + + public class PasswordValidator + { + // Regular expression for a strong password + private static readonly string PASSWORD_REGEX = + @"^(?=.*[0-9])" + + @"(?=.*[a-z])" + + @"(?=.*[A-Z])" + + @"(?=*[@#$%^&+=])" + + @"(?=\S+$)" + + @".{10}"; + + private static readonly Regex PASSWORD_PATTERN = new Regex(PASSWORD_REGEX); + + public static bool IsValidPassword(string password) + { + if (password == null) + { + return false; + } + Match match = PASSWORD_PATTERN.Match(password); + return match.Success; + } + } + + + + diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/Program.cs b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/Program.cs new file mode 100644 index 0000000..83fa4f4 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/Program.cs @@ -0,0 +1,2 @@ +// See https://aka.ms/new-console-template for more information +Console.WriteLine("Hello, World!"); diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/passwordValidator.csproj b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/passwordValidator.csproj new file mode 100644 index 0000000..d439800 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidator/passwordValidator.csproj @@ -0,0 +1,10 @@ + + + + Exe + net7.0 + enable + enable + + + diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs new file mode 100644 index 0000000..ad25539 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs @@ -0,0 +1,30 @@ +using NUnit.Framework; + + +namespace Tests +{ + [TestFixture] + public class PasswordValidatorTest + { + [Test] + public void TestValidPasswords() + { + Assert.IsTrue(PasswordValidator.IsValidPassword("Password1!")); + Assert.IsTrue(PasswordValidator.IsValidPassword("StrongPass123$")); + Assert.IsTrue(PasswordValidator.IsValidPassword("Good#Pass1")); + Assert.IsTrue(PasswordValidator.IsValidPassword("Valid1@Pass")); + } + + [Test] + public void TestInvalidPasswords() + { + Assert.IsFalse(PasswordValidator.IsValidPassword("Pass1!")); + Assert.IsFalse(PasswordValidator.IsValidPassword("password1!")); + Assert.IsFalse(PasswordValidator.IsValidPassword("PASSWORD1!")); + Assert.IsFalse(PasswordValidator.IsValidPassword("Password!")); + Assert.IsFalse(PasswordValidator.IsValidPassword("Password1")); + Assert.IsFalse(PasswordValidator.IsValidPassword("Password 1!")); + Assert.IsFalse(PasswordValidator.IsValidPassword(null)); + } + } +} \ No newline at end of file diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/passwordValidatorTest.csproj b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/passwordValidatorTest.csproj new file mode 100644 index 0000000..0e3d788 --- /dev/null +++ b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/passwordValidatorTest.csproj @@ -0,0 +1,22 @@ + + + + net7.0 + enable + enable + + false + true + + + + + + + + + + + + + diff --git a/code-bugfixing/password-validator/pom.xml b/code-bugfixing/password-validator/java/pom.xml similarity index 100% rename from code-bugfixing/password-validator/pom.xml rename to code-bugfixing/password-validator/java/pom.xml diff --git a/code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java b/code-bugfixing/password-validator/java/src/main/java/com/aicode/java/PasswordValidator.java similarity index 100% rename from code-bugfixing/password-validator/src/main/java/com/aicode/java/PasswordValidator.java rename to code-bugfixing/password-validator/java/src/main/java/com/aicode/java/PasswordValidator.java diff --git a/code-bugfixing/password-validator/java/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/password-validator/java/src/test/java/com/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 863196687d950785c9c92eac3fc11e15fd240f2c Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 14:36:34 +0300 Subject: [PATCH 06/25] Move Java order repository test to java folder --- code-bugfixing/order-repository/{ => java}/pom.xml | 0 .../{ => java}/src/main/java/com/aicode/java/App.java | 0 .../{ => java}/src/main/java/com/aicode/java/Order.java | 0 .../{ => java}/src/main/java/com/aicode/java/OrderRepository.java | 0 .../{ => java}/src/test/java/com/aicode/java/.dirkeep | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename code-bugfixing/order-repository/{ => java}/pom.xml (100%) rename code-bugfixing/order-repository/{ => java}/src/main/java/com/aicode/java/App.java (100%) rename code-bugfixing/order-repository/{ => java}/src/main/java/com/aicode/java/Order.java (100%) rename code-bugfixing/order-repository/{ => java}/src/main/java/com/aicode/java/OrderRepository.java (100%) rename code-bugfixing/order-repository/{ => java}/src/test/java/com/aicode/java/.dirkeep (100%) diff --git a/code-bugfixing/order-repository/pom.xml b/code-bugfixing/order-repository/java/pom.xml similarity index 100% rename from code-bugfixing/order-repository/pom.xml rename to code-bugfixing/order-repository/java/pom.xml diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java b/code-bugfixing/order-repository/java/src/main/java/com/aicode/java/App.java similarity index 100% rename from code-bugfixing/order-repository/src/main/java/com/aicode/java/App.java rename to code-bugfixing/order-repository/java/src/main/java/com/aicode/java/App.java diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java b/code-bugfixing/order-repository/java/src/main/java/com/aicode/java/Order.java similarity index 100% rename from code-bugfixing/order-repository/src/main/java/com/aicode/java/Order.java rename to code-bugfixing/order-repository/java/src/main/java/com/aicode/java/Order.java diff --git a/code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java b/code-bugfixing/order-repository/java/src/main/java/com/aicode/java/OrderRepository.java similarity index 100% rename from code-bugfixing/order-repository/src/main/java/com/aicode/java/OrderRepository.java rename to code-bugfixing/order-repository/java/src/main/java/com/aicode/java/OrderRepository.java diff --git a/code-bugfixing/order-repository/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/order-repository/java/src/test/java/com/aicode/java/.dirkeep similarity index 100% rename from code-bugfixing/order-repository/src/test/java/com/aicode/java/.dirkeep rename to code-bugfixing/order-repository/java/src/test/java/com/aicode/java/.dirkeep From 339e39abea96f75086ed2b37e5b98e71e49180c6 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 14:37:12 +0300 Subject: [PATCH 07/25] Remove scr folder --- .../password-validator/src/test/java/com/aicode/java/.dirkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep diff --git a/code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/password-validator/src/test/java/com/aicode/java/.dirkeep deleted file mode 100644 index e69de29..0000000 From 6c527f076e7c697cd9c649fb50987e8d2af0305c Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 14:37:58 +0300 Subject: [PATCH 08/25] Remove PasswordValidatorTest.cs --- .../PasswordValidatorTest.cs | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs diff --git a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs b/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs deleted file mode 100644 index ad25539..0000000 --- a/code-bugfixing/password-validator/C#/VisualStudio/passwordValidatorTest/PasswordValidatorTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -using NUnit.Framework; - - -namespace Tests -{ - [TestFixture] - public class PasswordValidatorTest - { - [Test] - public void TestValidPasswords() - { - Assert.IsTrue(PasswordValidator.IsValidPassword("Password1!")); - Assert.IsTrue(PasswordValidator.IsValidPassword("StrongPass123$")); - Assert.IsTrue(PasswordValidator.IsValidPassword("Good#Pass1")); - Assert.IsTrue(PasswordValidator.IsValidPassword("Valid1@Pass")); - } - - [Test] - public void TestInvalidPasswords() - { - Assert.IsFalse(PasswordValidator.IsValidPassword("Pass1!")); - Assert.IsFalse(PasswordValidator.IsValidPassword("password1!")); - Assert.IsFalse(PasswordValidator.IsValidPassword("PASSWORD1!")); - Assert.IsFalse(PasswordValidator.IsValidPassword("Password!")); - Assert.IsFalse(PasswordValidator.IsValidPassword("Password1")); - Assert.IsFalse(PasswordValidator.IsValidPassword("Password 1!")); - Assert.IsFalse(PasswordValidator.IsValidPassword(null)); - } - } -} \ No newline at end of file From f9f7f0f1443d981975c93a95f6c200ad27386116 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 17:49:48 +0300 Subject: [PATCH 09/25] Add password-validator test for TS --- .../TypeScript/VSCode/jest.config.js | 18 ++++++++++++++++++ .../TypeScript/VSCode/package.json | 16 ++++++++++++++++ .../VSCode/src/PasswordValidator.ts | 19 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 code-bugfixing/password-validator/TypeScript/VSCode/jest.config.js create mode 100644 code-bugfixing/password-validator/TypeScript/VSCode/package.json create mode 100644 code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts diff --git a/code-bugfixing/password-validator/TypeScript/VSCode/jest.config.js b/code-bugfixing/password-validator/TypeScript/VSCode/jest.config.js new file mode 100644 index 0000000..625fa4f --- /dev/null +++ b/code-bugfixing/password-validator/TypeScript/VSCode/jest.config.js @@ -0,0 +1,18 @@ +module.exports = { + "roots": [ + "/src" + ], + "transform": { + "^.+\\.tsx?$": "ts-jest" + }, + "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ], + } + \ No newline at end of file diff --git a/code-bugfixing/password-validator/TypeScript/VSCode/package.json b/code-bugfixing/password-validator/TypeScript/VSCode/package.json new file mode 100644 index 0000000..32eabce --- /dev/null +++ b/code-bugfixing/password-validator/TypeScript/VSCode/package.json @@ -0,0 +1,16 @@ +{ + "name": "helper-lib", + "version": "1.0.1", + "description": "", + "main": "passwordValidator.ts", + "scripts": { + "test": "jest" + }, + "license": "ISC", + "devDependencies": { + "@types/jest": "^29.5.2", + "jest": "^29.5.0", + "ts-jest": "^29.1.0", + "typescript": "^5.1.3" + } +} diff --git a/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts b/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts new file mode 100644 index 0000000..7fef129 --- /dev/null +++ b/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts @@ -0,0 +1,19 @@ +export class PasswordValidator { + + // Regular expression for a strong password + private static readonly PASSWORD_REGEX: RegExp = new RegExp( + "^(?=.*[0-9])" + + "(?=.*[a-z])" + + "(?=.*[A-Z])" + + "(?=.*[@#$%^&+=!])" + + "(?=\\S+$)" + + ".{8,}$" + ); + + public static isValidPassword(password: string | null): boolean { + if (password === null) { + return false; + } + return PasswordValidator.PASSWORD_REGEX.test(password); + } +} \ No newline at end of file From 65558b35411d1f1cb177a00093f9d194dc2c880e Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 26 Dec 2024 17:53:41 +0300 Subject: [PATCH 10/25] Update PasswordValidator.ts --- .../TypeScript/VSCode/src/PasswordValidator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts b/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts index 7fef129..0101e0b 100644 --- a/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts +++ b/code-bugfixing/password-validator/TypeScript/VSCode/src/PasswordValidator.ts @@ -2,12 +2,12 @@ export class PasswordValidator { // Regular expression for a strong password private static readonly PASSWORD_REGEX: RegExp = new RegExp( - "^(?=.*[0-9])" + + "^(?=[0-9])" + "(?=.*[a-z])" + "(?=.*[A-Z])" + - "(?=.*[@#$%^&+=!])" + + "(?=.*[@#$%^&+=])" + "(?=\\S+$)" + - ".{8,}$" + ".{8}$" ); public static isValidPassword(password: string | null): boolean { From a0b701bee83e6004815e8050fe013245e1210c46 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 27 Dec 2024 16:27:33 +0300 Subject: [PATCH 11/25] Add order processor test --- code-bugfixing/order-processor/java/pom.xml | 41 +++++++++++++++++++ .../src/main/java/com/aicode/java/Order.java | 36 ++++++++++++++++ .../java/com/aicode/java/OrderProcessor.java | 38 +++++++++++++++++ .../main/java/com/aicode/java/Product.java | 28 +++++++++++++ .../src/test/java/com/aicode/java/.dirkeep | 0 5 files changed, 143 insertions(+) create mode 100644 code-bugfixing/order-processor/java/pom.xml create mode 100644 code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Order.java create mode 100644 code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java create mode 100644 code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Product.java create mode 100644 code-bugfixing/order-processor/java/src/test/java/com/aicode/java/.dirkeep diff --git a/code-bugfixing/order-processor/java/pom.xml b/code-bugfixing/order-processor/java/pom.xml new file mode 100644 index 0000000..67406d5 --- /dev/null +++ b/code-bugfixing/order-processor/java/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + com.aicode.java + orderProcessor + 1.0-SNAPSHOT + + 17 + 17 + UTF-8 + + + + org.junit.jupiter + junit-jupiter-api + 5.8.0 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.8.0 + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Order.java b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Order.java new file mode 100644 index 0000000..a15c213 --- /dev/null +++ b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Order.java @@ -0,0 +1,36 @@ +package com.aicode.java; + +import java.util.Date; +import java.util.List; + +class Order { + + String orderId; + String customerId; + Date orderDate; + List products; + + public Order(String orderId, String customerId, Date orderDate, List products) { + this.orderId = orderId; + this.customerId = customerId; + this.orderDate = orderDate; + this.products = products; + } + + public String getCustomerId() { + return customerId; + } + + public List getProducts() { + return products; + } + + + public Date getOrderDate() { + return orderDate; + } + + public void setOrderDate(Date orderDate) { + this.orderDate = orderDate; + } +} diff --git a/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java new file mode 100644 index 0000000..1e25f1c --- /dev/null +++ b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java @@ -0,0 +1,38 @@ +package com.aicode.java; + +import java.util.*; +import java.util.stream.Collectors; + +public class OrderProcessor { + + /** + * Calculates the most popular product based on the total quantity sold from orders + * placed in the last 30 days. + * + *

This method processes a list of orders and identifies the product with the highest + * cumulative quantity sold in the last 30 days. If no products are found within this + * timeframe, "No Products" is returned.

+ * + * @return the name of the most popular product as determined by the highest total quantity sold + * in the last 30 days, or "No Products" if there are no qualifying products. + */ + public String calculateMostPopularProduct(List orders) { + Date currentDate = new Date(); + + // Calculate the date 30 days prior to the current date + Calendar calendar = Calendar.getInstance(); + calendar.setTime(currentDate); + calendar.add(Calendar.DAY_OF_YEAR, -30); + Date thirtyDaysAgo = calendar.getTime(); + + // Filter and process orders from the last 30 days + return orders.stream() + .filter(order -> !order.getOrderDate().before(thirtyDaysAgo)) + .flatMap(order -> order.getProducts().stream()) + .collect(Collectors.groupingBy(Product::getProductName, Collectors.summingInt(Product::getQuantity))) + .entrySet().stream() + .max(Map.Entry.comparingByValue()) + .map(Map.Entry::getKey) + .orElse("No Products"); + } +} \ No newline at end of file diff --git a/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Product.java b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Product.java new file mode 100644 index 0000000..f45e7b9 --- /dev/null +++ b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/Product.java @@ -0,0 +1,28 @@ +package com.aicode.java; + +class Product { + + String productId; + String productName; + int quantity; + double price; + + public Product(String productId, String productName, int quantity, double price) { + this.productId = productId; + this.productName = productName; + this.quantity = quantity; + this.price = price; + } + + public int getQuantity() { + return quantity; + } + + public double getPrice() { + return price; + } + + public String getProductName() { + return productName; + } +} \ No newline at end of file diff --git a/code-bugfixing/order-processor/java/src/test/java/com/aicode/java/.dirkeep b/code-bugfixing/order-processor/java/src/test/java/com/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 8dcb8bf8cb438afc05f3ed4cf556f4688c4fb43e Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 27 Dec 2024 16:55:13 +0300 Subject: [PATCH 12/25] Add order processor test --- .../src/main/java/com/aicode/java/OrderProcessor.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java index 1e25f1c..10f04cf 100644 --- a/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java +++ b/code-bugfixing/order-processor/java/src/main/java/com/aicode/java/OrderProcessor.java @@ -19,19 +19,17 @@ public class OrderProcessor { public String calculateMostPopularProduct(List orders) { Date currentDate = new Date(); - // Calculate the date 30 days prior to the current date Calendar calendar = Calendar.getInstance(); calendar.setTime(currentDate); - calendar.add(Calendar.DAY_OF_YEAR, -30); + calendar.add(Calendar.HOUR, -30); Date thirtyDaysAgo = calendar.getTime(); - // Filter and process orders from the last 30 days return orders.stream() - .filter(order -> !order.getOrderDate().before(thirtyDaysAgo)) + .filter(order -> order.getOrderDate().before(thirtyDaysAgo)) .flatMap(order -> order.getProducts().stream()) .collect(Collectors.groupingBy(Product::getProductName, Collectors.summingInt(Product::getQuantity))) .entrySet().stream() - .max(Map.Entry.comparingByValue()) + .max(Map.Entry.comparingByKey()) .map(Map.Entry::getKey) .orElse("No Products"); } From cd4eacd6d3ba8ecd81b85603e735b51baad49073 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Wed, 8 Jan 2025 15:09:46 +0300 Subject: [PATCH 13/25] Add the utilizing new Date and Time API features test --- .../new-date-time-api/java/pom.xml | 39 +++++++++++++++++++ .../com/epam/aicode/java/DateHandler.java | 29 ++++++++++++++ .../test/java/com/epam/aicode/java/.dirkeep | 0 3 files changed, 68 insertions(+) create mode 100644 code-refactoring/new-date-time-api/java/pom.xml create mode 100644 code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java create mode 100644 code-refactoring/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep diff --git a/code-refactoring/new-date-time-api/java/pom.xml b/code-refactoring/new-date-time-api/java/pom.xml new file mode 100644 index 0000000..fb0390c --- /dev/null +++ b/code-refactoring/new-date-time-api/java/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + com.epam.aicode + java + 1.0-SNAPSHOT + java + + + UTF-8 + 5.8.2 + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java b/code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java new file mode 100644 index 0000000..937ab3b --- /dev/null +++ b/code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java @@ -0,0 +1,29 @@ +package com.epam.aicode.java; + +import java.util.Calendar; +import java.util.Date; +import java.text.SimpleDateFormat; + +public class DateHandler { + + public Date getCurrentDate() { + return new Date(); + } + + public String formatDate(Date date) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + return formatter.format(date); + } + + public Date addDaysToCurrentDate(int daysToAdd) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DAY_OF_MONTH, daysToAdd); + return calendar.getTime(); + } + + public String getDayOfWeek(Date date) { + SimpleDateFormat formatter = new SimpleDateFormat("EEEE"); + return formatter.format(date); + } +} \ No newline at end of file diff --git a/code-refactoring/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep b/code-refactoring/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 7152d1d1974587abf908657e46fe2aca4912a611 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Wed, 8 Jan 2025 17:15:26 +0300 Subject: [PATCH 14/25] Refactor logging implementations from older frameworks to SLF4J test --- code-refactoring/legacy-logging/java/pom.xml | 39 +++++++++++++++++++ .../com/epam/aicode/java/OrderService.java | 30 ++++++++++++++ .../test/java/com/epam/aicode/java/.dirkeep | 0 3 files changed, 69 insertions(+) create mode 100644 code-refactoring/legacy-logging/java/pom.xml create mode 100644 code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java create mode 100644 code-refactoring/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep diff --git a/code-refactoring/legacy-logging/java/pom.xml b/code-refactoring/legacy-logging/java/pom.xml new file mode 100644 index 0000000..fb0390c --- /dev/null +++ b/code-refactoring/legacy-logging/java/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + com.epam.aicode + java + 1.0-SNAPSHOT + java + + + UTF-8 + 5.8.2 + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java new file mode 100644 index 0000000..2be5b02 --- /dev/null +++ b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java @@ -0,0 +1,30 @@ +package com.epam.aicode.java; + +import java.util.logging.Level; +import java.util.logging.Logger; + +public class OrderService { + + private static final Logger logger = Logger.getLogger(OrderService.class.getName()); + + public void processOrder(String orderId) { + if (orderId == null || orderId.isEmpty()) { + logger.log(Level.SEVERE, "Order ID is null or empty"); + return; + } + + logger.log(Level.INFO, "Processing order: {0}", orderId); + + try { + // Simulate order processing logic + logger.log(Level.FINE, "Fetching order details for {0}", orderId); + // Simulating potential exception + if ("invalid".equals(orderId)) { + throw new RuntimeException("Order processing error"); + } + logger.log(Level.INFO, "Order {0} processed successfully", orderId); + } catch (Exception e) { + logger.log(Level.SEVERE, "Error processing order: {0}", orderId); + } + } +} diff --git a/code-refactoring/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep b/code-refactoring/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 037d3b8796c2e30b4bb9dcf0806800389f299308 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Wed, 8 Jan 2025 22:51:05 +0300 Subject: [PATCH 15/25] Add Product and Order classes --- code-refactoring/legacy-logging/java/pom.xml | 23 +++++++++++++--- .../main/java/com/epam/aicode/java/Order.java | 26 +++++++++++++++++++ .../com/epam/aicode/java/OrderService.java | 26 ++++++++++++++----- .../java/com/epam/aicode/java/Product.java | 23 ++++++++++++++++ 4 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java create mode 100644 code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java diff --git a/code-refactoring/legacy-logging/java/pom.xml b/code-refactoring/legacy-logging/java/pom.xml index fb0390c..81b5bf9 100644 --- a/code-refactoring/legacy-logging/java/pom.xml +++ b/code-refactoring/legacy-logging/java/pom.xml @@ -16,11 +16,28 @@ - org.junit.jupiter - junit-jupiter-api - 5.8.2 + org.mockito + mockito-junit-jupiter + 5.3.1 test + + junit + junit + 4.13.1 + test + + + + org.slf4j + slf4j-api + 2.0.16 + + + ch.qos.logback + logback-classic + 1.5.16 + diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java new file mode 100644 index 0000000..27313cb --- /dev/null +++ b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java @@ -0,0 +1,26 @@ +package com.epam.aicode.java; + +import java.util.List; + +public class Order { + + private String orderId; + + private List products; + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public List getProducts() { + return products; + } + + public void setProducts(List products) { + this.products = products; + } +} diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java index 2be5b02..11d7bb9 100644 --- a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java +++ b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java @@ -1,5 +1,7 @@ package com.epam.aicode.java; +import java.util.ArrayList; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -7,24 +9,34 @@ public class OrderService { private static final Logger logger = Logger.getLogger(OrderService.class.getName()); - public void processOrder(String orderId) { + public List processOrder(Order order) { + String orderId = order.getOrderId(); + if (orderId == null || orderId.isEmpty()) { logger.log(Level.SEVERE, "Order ID is null or empty"); - return; + return null; } logger.log(Level.INFO, "Processing order: {0}", orderId); + List productNames = new ArrayList<>(); try { - // Simulate order processing logic - logger.log(Level.FINE, "Fetching order details for {0}", orderId); - // Simulating potential exception - if ("invalid".equals(orderId)) { - throw new RuntimeException("Order processing error"); + List products = order.getProducts(); + + if (products == null || products.isEmpty()) { + logger.log(Level.WARNING, "No products found in order: {0}", orderId); + return null; } + + for (Product product : products) { + productNames.add(product.getProductName()); + logger.log(Level.INFO, "Processed product: {0}", product.getProductId()); + } + logger.log(Level.INFO, "Order {0} processed successfully", orderId); } catch (Exception e) { logger.log(Level.SEVERE, "Error processing order: {0}", orderId); } + return productNames; } } diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java new file mode 100644 index 0000000..983d330 --- /dev/null +++ b/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java @@ -0,0 +1,23 @@ +package com.epam.aicode.java; + +public class Product { + + private String productId; + private String productName; + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } +} From fef48f2f25fa909dda0c02d7947fb08b66c00fd8 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 9 Jan 2025 17:07:04 +0300 Subject: [PATCH 16/25] Add rest-controller test --- .../rest-controller/java/pom.xml | 54 +++++++++++ .../java/com/epam/aicode/java/Player.java | 64 +++++++++++++ .../epam/aicode/java/PlayerController.java | 92 +++++++++++++++++++ .../aicode/java/PlayerNotFoundException.java | 8 ++ .../com/epam/aicode/java/PlayerService.java | 11 +++ .../java/src/test/java/.dirkeep | 0 6 files changed, 229 insertions(+) create mode 100644 solution-migration/rest-controller/java/pom.xml create mode 100644 solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/Player.java create mode 100644 solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java create mode 100644 solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerNotFoundException.java create mode 100644 solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java create mode 100644 solution-migration/rest-controller/java/src/test/java/.dirkeep diff --git a/solution-migration/rest-controller/java/pom.xml b/solution-migration/rest-controller/java/pom.xml new file mode 100644 index 0000000..c6a4be3 --- /dev/null +++ b/solution-migration/rest-controller/java/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + com.epam.aicode + java + 1.0-SNAPSHOT + java + + + UTF-8 + 5.8.2 + + + + org.springframework.boot + spring-boot-starter-parent + 3.2.1 + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/Player.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/Player.java new file mode 100644 index 0000000..4d68d80 --- /dev/null +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/Player.java @@ -0,0 +1,64 @@ +package com.epam.aicode.java; + +import jakarta.persistence.*; + +@Entity +public class Player { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private String surname; + private String name; + private String email; + private Double hcp; + private Long photoId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Double getHcp() { + return hcp; + } + + public void setHcp(Double hcp) { + this.hcp = hcp; + } + + public Long getPhotoId() { + return photoId; + } + + public void setPhotoId(Long photoId) { + this.photoId = photoId; + } +} diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java new file mode 100644 index 0000000..a3e33db --- /dev/null +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java @@ -0,0 +1,92 @@ +package com.epam.aicode.java; + +import java.util.logging.Level; +import java.util.logging.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; + +@Controller +@RequestMapping("/player") +public class PlayerController { + + private static final Logger LOGGER = Logger.getLogger(PlayerController.class.getName()); + + private static final String PLAYER_MAIN_PAGE = "player/player-main"; + private static final String PLAYER_ADD_PAGE = "player/player-add"; + private static final String PLAYER_DETAILS_PAGE = "player/player-details"; + private static final String PLAYER_EDIT_PAGE = "player/player-edit"; + private static final String PLAYER_ATTRIBUTE = "player"; + private static final String PLAYERS_ATTRIBUTE = "players"; + private static final String REDIRECT_TO_PLAYER = "redirect:/player"; + + private final PlayerService playerService; + + @Autowired + public PlayerController(PlayerService playerService) { + this.playerService = playerService; + } + + @GetMapping + public String displayPlayerMainPage(Model model) { + model.addAttribute(PLAYERS_ATTRIBUTE, playerService.getAllPlayers()); + return PLAYER_MAIN_PAGE; + } + + @GetMapping("/add") + public String displayPlayerAddPage() { + return PLAYER_ADD_PAGE; + } + + @PostMapping("/add") + public String addPlayer(@ModelAttribute Player player, BindingResult bindingResult, Model model) { + if (bindingResult.hasErrors()) { + model.addAttribute(PLAYER_ATTRIBUTE, player); + return PLAYER_ADD_PAGE; + } + playerService.savePlayer(player); + LOGGER.log(Level.INFO, "Player " + player.getSurname() + " " + player.getName() + + " with ID " + player.getId() + " has been saved in the DB"); + return REDIRECT_TO_PLAYER; + } + + @GetMapping("/{id}") + public String displayPlayerDetailsPage(@PathVariable("id") Long id, Model model) { + Player player = playerService.getPlayerById(id) + .orElseThrow(() -> new PlayerNotFoundException("Player by ID not found")); + + model.addAttribute(PLAYER_ATTRIBUTE, player); + return PLAYER_DETAILS_PAGE; + } + + @GetMapping("/{id}/edit") + public String displayPlayerEditPage(@PathVariable("id") Long id, Model model) { + Player player = playerService.getPlayerById(id) + .orElseThrow(() -> new PlayerNotFoundException("Player by ID not found")); + + model.addAttribute(PLAYER_ATTRIBUTE, player); + return PLAYER_EDIT_PAGE; + } + + @PostMapping("/{id}/edit") + public String updatePlayer(@ModelAttribute Player player, Model model) { + playerService.savePlayer(player); + LOGGER.log(Level.INFO, "Player " + player.getSurname() + " " + player.getName() + " with ID " + + player.getId() + " has been updated in the DB"); + + model.addAttribute(PLAYER_ATTRIBUTE, player); + return PLAYER_DETAILS_PAGE; + } + + @PostMapping("/{id}/remove") + public String deletePlayer(@PathVariable("id") Long id) { + Player player = playerService.getPlayerById(id) + .orElseThrow(() -> new PlayerNotFoundException("Player by ID not found")); + playerService.deletePlayer(id); + LOGGER.log(Level.INFO, "Player " + player.getSurname() + " " + player.getName() + " with ID " + + player.getId() + " was REMOVED from DB"); + return REDIRECT_TO_PLAYER; + } +} \ No newline at end of file diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerNotFoundException.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerNotFoundException.java new file mode 100644 index 0000000..dbe4938 --- /dev/null +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerNotFoundException.java @@ -0,0 +1,8 @@ +package com.epam.aicode.java; + +public class PlayerNotFoundException extends RuntimeException { + + public PlayerNotFoundException(String message) { + super(message); + } +} diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java new file mode 100644 index 0000000..df810cd --- /dev/null +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java @@ -0,0 +1,11 @@ +package com.epam.aicode.java; + +import java.util.Optional; + +public interface PlayerService { + + Iterable getAllPlayers(); + Optional getPlayerById(Long id); + Player savePlayer(Player player); + void deletePlayer(Long id); +} diff --git a/solution-migration/rest-controller/java/src/test/java/.dirkeep b/solution-migration/rest-controller/java/src/test/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 0337075cfe1856a9d143246d73a9d6494e31dcbb Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 9 Jan 2025 18:14:03 +0300 Subject: [PATCH 17/25] Update PlayerController --- .../rest-controller/java/pom.xml | 28 ++++++++++++++++++- .../epam/aicode/java/PlayerController.java | 19 ++----------- .../java/{ => com/epam/aicode/java}/.dirkeep | 0 3 files changed, 29 insertions(+), 18 deletions(-) rename solution-migration/rest-controller/java/src/test/java/{ => com/epam/aicode/java}/.dirkeep (100%) diff --git a/solution-migration/rest-controller/java/pom.xml b/solution-migration/rest-controller/java/pom.xml index c6a4be3..3f486c8 100644 --- a/solution-migration/rest-controller/java/pom.xml +++ b/solution-migration/rest-controller/java/pom.xml @@ -30,10 +30,36 @@ org.springframework.boot spring-boot-starter-data-jpa + org.junit.jupiter junit-jupiter-api - 5.8.2 + 5.9.0 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.0 + test + + + + org.mockito + mockito-core + 5.5.0 + test + + + org.mockito + mockito-junit-jupiter + 5.5.0 + test + + + org.springframework.boot + spring-boot-starter-test + 2.7.5 test diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java index a3e33db..4b24117 100644 --- a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerController.java @@ -17,7 +17,6 @@ public class PlayerController { private static final String PLAYER_MAIN_PAGE = "player/player-main"; private static final String PLAYER_ADD_PAGE = "player/player-add"; private static final String PLAYER_DETAILS_PAGE = "player/player-details"; - private static final String PLAYER_EDIT_PAGE = "player/player-edit"; private static final String PLAYER_ATTRIBUTE = "player"; private static final String PLAYERS_ATTRIBUTE = "players"; private static final String REDIRECT_TO_PLAYER = "redirect:/player"; @@ -30,16 +29,11 @@ public PlayerController(PlayerService playerService) { } @GetMapping - public String displayPlayerMainPage(Model model) { + public String getPlayers(Model model) { model.addAttribute(PLAYERS_ATTRIBUTE, playerService.getAllPlayers()); return PLAYER_MAIN_PAGE; } - @GetMapping("/add") - public String displayPlayerAddPage() { - return PLAYER_ADD_PAGE; - } - @PostMapping("/add") public String addPlayer(@ModelAttribute Player player, BindingResult bindingResult, Model model) { if (bindingResult.hasErrors()) { @@ -53,7 +47,7 @@ public String addPlayer(@ModelAttribute Player player, BindingResult bindingResu } @GetMapping("/{id}") - public String displayPlayerDetailsPage(@PathVariable("id") Long id, Model model) { + public String getPlayerById(@PathVariable("id") Long id, Model model) { Player player = playerService.getPlayerById(id) .orElseThrow(() -> new PlayerNotFoundException("Player by ID not found")); @@ -61,15 +55,6 @@ public String displayPlayerDetailsPage(@PathVariable("id") Long id, Model model) return PLAYER_DETAILS_PAGE; } - @GetMapping("/{id}/edit") - public String displayPlayerEditPage(@PathVariable("id") Long id, Model model) { - Player player = playerService.getPlayerById(id) - .orElseThrow(() -> new PlayerNotFoundException("Player by ID not found")); - - model.addAttribute(PLAYER_ATTRIBUTE, player); - return PLAYER_EDIT_PAGE; - } - @PostMapping("/{id}/edit") public String updatePlayer(@ModelAttribute Player player, Model model) { playerService.savePlayer(player); diff --git a/solution-migration/rest-controller/java/src/test/java/.dirkeep b/solution-migration/rest-controller/java/src/test/java/com/epam/aicode/java/.dirkeep similarity index 100% rename from solution-migration/rest-controller/java/src/test/java/.dirkeep rename to solution-migration/rest-controller/java/src/test/java/com/epam/aicode/java/.dirkeep From 9419ac2efc6bda771fe82f4955f54b15ea86383f Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 9 Jan 2025 18:20:46 +0300 Subject: [PATCH 18/25] Update the PlayerService --- .../java/src/main/java/com/epam/aicode/java/PlayerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java index df810cd..82289d5 100644 --- a/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java +++ b/solution-migration/rest-controller/java/src/main/java/com/epam/aicode/java/PlayerService.java @@ -1,10 +1,11 @@ package com.epam.aicode.java; +import java.util.List; import java.util.Optional; public interface PlayerService { - Iterable getAllPlayers(); + List getAllPlayers(); Optional getPlayerById(Long id); Player savePlayer(Player player); void deletePlayer(Long id); From 3d9aa32153fda7a7be90d03031eccd6edf5b2696 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Thu, 9 Jan 2025 18:25:39 +0300 Subject: [PATCH 19/25] Move the legacy-logging test to the solution-migration category --- .../legacy-logging/java/pom.xml | 0 .../java/src/main/java/com/epam/aicode/java/Order.java | 0 .../java/src/main/java/com/epam/aicode/java/OrderService.java | 0 .../java/src/main/java/com/epam/aicode/java/Product.java | 0 .../java/src/test/java/com/epam/aicode/java/.dirkeep | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {code-refactoring => solution-migration}/legacy-logging/java/pom.xml (100%) rename {code-refactoring => solution-migration}/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java (100%) rename {code-refactoring => solution-migration}/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java (100%) rename {code-refactoring => solution-migration}/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java (100%) rename {code-refactoring => solution-migration}/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep (100%) diff --git a/code-refactoring/legacy-logging/java/pom.xml b/solution-migration/legacy-logging/java/pom.xml similarity index 100% rename from code-refactoring/legacy-logging/java/pom.xml rename to solution-migration/legacy-logging/java/pom.xml diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java b/solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java similarity index 100% rename from code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java rename to solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/Order.java diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java b/solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java similarity index 100% rename from code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java rename to solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/OrderService.java diff --git a/code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java b/solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java similarity index 100% rename from code-refactoring/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java rename to solution-migration/legacy-logging/java/src/main/java/com/epam/aicode/java/Product.java diff --git a/code-refactoring/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep b/solution-migration/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep similarity index 100% rename from code-refactoring/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep rename to solution-migration/legacy-logging/java/src/test/java/com/epam/aicode/java/.dirkeep From 341ec8b826849e05abfc676bb5d953cb85d4604f Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 13:40:13 +0300 Subject: [PATCH 20/25] Add the immutable-class test --- code-refactoring/immutable-class/java/pom.xml | 39 ++++++++++++ .../java/com/epam/aicode/java/Player.java | 61 +++++++++++++++++++ .../test/java/com/epam/aicode/java/.dirkeep | 0 3 files changed, 100 insertions(+) create mode 100644 code-refactoring/immutable-class/java/pom.xml create mode 100644 code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java create mode 100644 code-refactoring/immutable-class/java/src/test/java/com/epam/aicode/java/.dirkeep diff --git a/code-refactoring/immutable-class/java/pom.xml b/code-refactoring/immutable-class/java/pom.xml new file mode 100644 index 0000000..fb0390c --- /dev/null +++ b/code-refactoring/immutable-class/java/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + + com.epam.aicode + java + 1.0-SNAPSHOT + java + + + UTF-8 + 5.8.2 + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java b/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java new file mode 100644 index 0000000..dedbcc3 --- /dev/null +++ b/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java @@ -0,0 +1,61 @@ +package com.epam.aicode.java; + +public class Player { + + private Integer age; + private String email; + private String phone; + private String name; + private String surname; + + public Player() { + } + + public Player(Integer age, String email, String phone, String name, String surname) { + this.age = age; + this.email = email; + this.phone = phone; + this.name = name; + this.surname = surname; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } +} diff --git a/code-refactoring/immutable-class/java/src/test/java/com/epam/aicode/java/.dirkeep b/code-refactoring/immutable-class/java/src/test/java/com/epam/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 2fec95736a67a08a3292e361afd618724aefc6f1 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 13:56:50 +0300 Subject: [PATCH 21/25] Update the pom file to add lombok library --- code-refactoring/immutable-class/java/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code-refactoring/immutable-class/java/pom.xml b/code-refactoring/immutable-class/java/pom.xml index fb0390c..b428fa9 100644 --- a/code-refactoring/immutable-class/java/pom.xml +++ b/code-refactoring/immutable-class/java/pom.xml @@ -12,6 +12,7 @@ UTF-8 5.8.2 + 1.18.36 @@ -21,6 +22,12 @@ 5.8.2 test + + org.projectlombok + lombok + ${lombok.version} + provided + From c462c580a67193c800767a7cdf339c563d9c234c Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 14:03:49 +0300 Subject: [PATCH 22/25] Update the Player --- .../java/src/main/java/com/epam/aicode/java/Player.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java b/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java index dedbcc3..0cbca6c 100644 --- a/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java +++ b/code-refactoring/immutable-class/java/src/main/java/com/epam/aicode/java/Player.java @@ -8,9 +8,6 @@ public class Player { private String name; private String surname; - public Player() { - } - public Player(Integer age, String email, String phone, String name, String surname) { this.age = age; this.email = email; From 3be58e4f4fe03d065e8fb454e8ce4f9b4f37a283 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 14:19:39 +0300 Subject: [PATCH 23/25] Update the pom-file test --- code-refactoring/pom-file/java/pom.xml | 46 +++++++++++++++++++ .../test/java/com/epam/aicode/java/.dirkeep | 0 2 files changed, 46 insertions(+) create mode 100644 code-refactoring/pom-file/java/pom.xml create mode 100644 code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep diff --git a/code-refactoring/pom-file/java/pom.xml b/code-refactoring/pom-file/java/pom.xml new file mode 100644 index 0000000..b428fa9 --- /dev/null +++ b/code-refactoring/pom-file/java/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + com.epam.aicode + java + 1.0-SNAPSHOT + java + + + UTF-8 + 5.8.2 + 1.18.36 + + + + + org.junit.jupiter + junit-jupiter-api + 5.8.2 + test + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + 17 + 17 + + + + + \ No newline at end of file diff --git a/code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep b/code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep new file mode 100644 index 0000000..e69de29 From 9bcaac16e77ef64dbc55a4052e2dc0d3503f1ae1 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 15:02:40 +0300 Subject: [PATCH 24/25] Update the pom file --- code-refactoring/pom-file/java/pom.xml | 40 +++++++++++++++++-- .../test/java/com/epam/aicode/java/.dirkeep | 0 2 files changed, 37 insertions(+), 3 deletions(-) delete mode 100644 code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep diff --git a/code-refactoring/pom-file/java/pom.xml b/code-refactoring/pom-file/java/pom.xml index b428fa9..9952931 100644 --- a/code-refactoring/pom-file/java/pom.xml +++ b/code-refactoring/pom-file/java/pom.xml @@ -11,11 +11,24 @@ UTF-8 - 5.8.2 - 1.18.36 + + org.springframework.boot + spring-boot-starter-web + 3.4.1 + + + org.springframework.boot + spring-boot-starter-data-jpa + 3.4.1 + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + 2.5.0 + org.junit.jupiter junit-jupiter-api @@ -25,9 +38,30 @@ org.projectlombok lombok - ${lombok.version} + 1.18.36 provided + + com.mysql + mysql-connector-j + 9.1.0 + + + com.fasterxml.jackson.core + jackson-databind + 2.18.2 + + + org.slf4j + slf4j-api + 2.0.16 + + + org.slf4j + slf4j-simple + 2.0.16 + test + diff --git a/code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep b/code-refactoring/pom-file/java/src/test/java/com/epam/aicode/java/.dirkeep deleted file mode 100644 index e69de29..0000000 From b32a33f2e2d477c228a87430daeecb7027ab53e7 Mon Sep 17 00:00:00 2001 From: Palina Talkachova Date: Fri, 10 Jan 2025 15:13:32 +0300 Subject: [PATCH 25/25] Move the new date time API test to the solution-migration category --- .../new-date-time-api/java/pom.xml | 0 .../java/src/main/java/com/epam/aicode/java/DateHandler.java | 0 .../java/src/test/java/com/epam/aicode/java/.dirkeep | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {code-refactoring => solution-migration}/new-date-time-api/java/pom.xml (100%) rename {code-refactoring => solution-migration}/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java (100%) rename {code-refactoring => solution-migration}/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep (100%) diff --git a/code-refactoring/new-date-time-api/java/pom.xml b/solution-migration/new-date-time-api/java/pom.xml similarity index 100% rename from code-refactoring/new-date-time-api/java/pom.xml rename to solution-migration/new-date-time-api/java/pom.xml diff --git a/code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java b/solution-migration/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java similarity index 100% rename from code-refactoring/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java rename to solution-migration/new-date-time-api/java/src/main/java/com/epam/aicode/java/DateHandler.java diff --git a/code-refactoring/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep b/solution-migration/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep similarity index 100% rename from code-refactoring/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep rename to solution-migration/new-date-time-api/java/src/test/java/com/epam/aicode/java/.dirkeep