From b9b6147341578ddef9cada3b7b15593fb1cefdae Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Tue, 4 Mar 2025 23:22:12 -0500 Subject: [PATCH 1/7] chore: add task to make test report --- build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 98080e9..e1a75c5 100644 --- a/build.gradle +++ b/build.gradle @@ -44,6 +44,10 @@ dependencies { testImplementation 'org.mockito:mockito-junit-jupiter:4.0.0' } -tasks.named('test') { +test { useJUnitPlatform() -} + + testLogging { + events "passed", "skipped", "failed" + } +} \ No newline at end of file From d96fc2fd043956380751bbbcb73df46cfea30b67 Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Tue, 4 Mar 2025 23:23:32 -0500 Subject: [PATCH 2/7] chore: set up initial pipe file to run unit tests and generate report --- .github/workflows/gradle.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..c1a6d72 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,35 @@ +name: Java Test + +on: + push: + branches: [ "main", "development" ] + + pull_request: + branches: [ "main", "development" ] + +jobs: + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build and test with Gradle + run: ./gradlew clean test + + - name: Publish Unit Test Results + uses: actions/upload-artifact@v3 + with: + name: test-results + path: build/test-results/test \ No newline at end of file From 5ac0192822cc7fc330e0eb4b4535ab9cdeb57016 Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Wed, 5 Mar 2025 22:05:02 -0500 Subject: [PATCH 3/7] refactor: update gitignore --- .gitignore | 280 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 247 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index c2065bc..1a2c73a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,251 @@ -HELP.md +# Created by https://www.toptal.com/developers/gitignore/api/gradle,java,intellij,jetbrains +# Edit at https://www.toptal.com/developers/gitignore?templates=gradle,java,intellij,jetbrains + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +### JetBrains ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### JetBrains Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij + +### Gradle ### .gradle -build/ -!gradle/wrapper/gradle-wrapper.jar -!**/src/main/**/build/ -!**/src/test/**/build/ +**/build/ +!src/**/build/ -### STS ### -.apt_generated -.classpath -.factorypath +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Avoid ignore Gradle wrappper properties +!gradle-wrapper.properties + +# Cache of project +.gradletasknamecache + +# Eclipse Gradle plugin generated files +# Eclipse Core .project -.settings -.springBeans -.sts4-cache -bin/ -!**/src/main/**/bin/ -!**/src/test/**/bin/ - -### IntelliJ IDEA ### +# JDT-specific (Eclipse Java Development Tools) +.classpath + +### Gradle Patch ### +# Java heap dump +*.hprof + +# env +.env + +# idea .idea -*.iws -*.iml -*.ipr -out/ -!**/src/main/**/out/ -!**/src/test/**/out/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ + +# End of https://www.toptal.com/developers/gitignore/api/gradle,java,intellij,jetbrains \ No newline at end of file From 76410b5a36d5794ef84981ac5dfc3fc32ae5070b Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Wed, 5 Mar 2025 23:30:14 -0500 Subject: [PATCH 4/7] chore: add hibernate dialect --- src/main/resources/application.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index dba591d..56df31b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,3 +1,4 @@ +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB_NAME}?createDatabaseIfNotExist=true spring.datasource.username=${DB_USER} From f80bf5c2bb7fd6ca32168a385ad309d8ecc5328b Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Wed, 5 Mar 2025 23:32:00 -0500 Subject: [PATCH 5/7] chore: remove conflicting dependency and add spring-dotenv --- build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e1a75c5..ce462ad 100644 --- a/build.gradle +++ b/build.gradle @@ -28,9 +28,8 @@ dependencies { implementation 'com.auth0:java-jwt:4.3.0' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0' implementation 'org.springframework.boot:spring-boot-starter-actuator' - - // https://mvnrepository.com/artifact/io.github.cdimascio/java-dotenv - implementation group: 'io.github.cdimascio', name: 'java-dotenv', version: '5.2.2' + + implementation 'me.paulschwarz:spring-dotenv:3.0.0' testImplementation 'org.springframework.boot:spring-boot-starter-test' From a574dffcfec058ff4d5276df6d13b574994ebd78 Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Wed, 5 Mar 2025 23:35:17 -0500 Subject: [PATCH 6/7] fix: upgrade actions/upload-artifact to version 4 --- .github/workflows/gradle.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c1a6d72..c9bf8e7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -29,7 +29,7 @@ jobs: run: ./gradlew clean test - name: Publish Unit Test Results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-results path: build/test-results/test \ No newline at end of file From f29bad8c4e3815226ffaec9ad3555b32eaf683da Mon Sep 17 00:00:00 2001 From: leiber bertel Date: Wed, 5 Mar 2025 23:46:48 -0500 Subject: [PATCH 7/7] refactor: remove default context test --- .../pizza/LeiberPizzeriaApplicationTests.java | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 src/test/java/com/leiber/pizza/LeiberPizzeriaApplicationTests.java diff --git a/src/test/java/com/leiber/pizza/LeiberPizzeriaApplicationTests.java b/src/test/java/com/leiber/pizza/LeiberPizzeriaApplicationTests.java deleted file mode 100644 index 85d4d68..0000000 --- a/src/test/java/com/leiber/pizza/LeiberPizzeriaApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.leiber.pizza; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class LeiberPizzeriaApplicationTests { - - @Test - void contextLoads() { - } - -}