From cb23f2c6ead6d8d62ef0d262a7a816504337af0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Mon, 14 Apr 2025 21:17:02 -0300 Subject: [PATCH 01/14] =?UTF-8?q?Adicionado=20coment=C3=A1rio=20para=20AB#?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes README.md | 2 +- src/.DS_Store | Bin 0 -> 6148 bytes 3 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 src/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6c47a45960b601abddffbd4b237a25ea5b9a37e7 GIT binary patch literal 6148 zcmeHK!A=4(5S_{fiCjqZ;K4($UQ9R|J*;H?0OJoRV9)>GZXaY=;t&YF&4mL=7UUp)p2l=;j#5xs`0ic{YHG=jivE z$DJ%4ltzj}6c7cLQ2~B;Bif-JUC=0af1~lUA4{_&Y4@`>e6^3ght=dGV08(p>pKMeE#jar>o2Lx#z`0UbFuS_I^d3 zaObUEu)2uPx!x-{i|ADGax~yWRS;WR1>CPwt1s;eWnrR#DDYPb@cE$87-NUIMRRnZ zGgkm$1h+9fn;HYu>;T3NbBpl6luZTNROPN1%BI7w-MH9cZqcTbGR&CAF)MdNu@xSE zZHAMIElMv6hytMk75lZp_5Tp>@Phk)m?Yms0a4&zDWIa{IB8)^uC|so$F)|YouIMt nxZI*iLFdY`dEipKiDnEj%@4rXVQvu~nEVkiGDs&1{Hg*!TTG?W literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 541f35a..13dea01 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Simple API Java -Aplicação API +Aplicação API ## Pré-requisitos diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5a7257d8f2c7aeb32816ebf0bd48aac5d37502e3 GIT binary patch literal 6148 zcmeHKOHRW;47DMPNNl?7a>NZPE)c44g6>#BD56LWsYKc50=*V%!~%&!a0i}0l#Ga2 zA_TTH^E~!=oV+OG86x8O!*WJ6A)*pZkVP30F^{?qe6l!M)>z-n7FS)n8Cm4Fn&jCF zYUz@0=`Mf%A;CZ}5DWwZ|C|BTY?1QFF#2F17zhUT49NbF&;%>T-cYv= zbb18<7BH(o*E1$Ci2+zS_J*)P*g}C8%6`RQ3x_@VyvngRv~Xh0jCDNo$K{3ngv&{% z6IX`O2Lr)C&cLA!CsO~<@GFg8^7D`w1p~prA7g-vdQs2uQeIoXyq?tBgm!@@BJ+At pAkeiG1GN-mAp6Kvo#s!X!(Tb}hO&y-H5?cR0VO25VBiNBcn73$Ns|Bo literal 0 HcmV?d00001 From 6d8d0ec333f496d8b86b1f9e83eca6de1bdc13bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Wed, 16 Apr 2025 21:43:04 -0300 Subject: [PATCH 02/14] Stage --- .DS_Store | Bin 6148 -> 6148 bytes .dockerignore | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .dockerignore diff --git a/.DS_Store b/.DS_Store index 6c47a45960b601abddffbd4b237a25ea5b9a37e7..1f4c00b178202c11f7b652b4cb7e7387ec601f60 100644 GIT binary patch delta 106 zcmZoMXffEJ#u9sf6$1kU3xgg*IzuKyNp8N2OHxjL5>SkTfuW)C-L+$msPZXzSlemGx})ch`<{9 diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7347a7f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md From c3209a47f0b50f775d772a69d92ab4904ee079aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Fri, 18 Apr 2025 21:37:57 -0300 Subject: [PATCH 03/14] Adicionando workflow com actions --- .github/workflows/03-minhas-actions.yaml | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/03-minhas-actions.yaml diff --git a/.github/workflows/03-minhas-actions.yaml b/.github/workflows/03-minhas-actions.yaml new file mode 100644 index 0000000..9be0684 --- /dev/null +++ b/.github/workflows/03-minhas-actions.yaml @@ -0,0 +1,29 @@ +name: 03 - Actions + +on: + push: + branches: "feature/**" + +jobs: + checkout_java_docker: + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Setup Java SDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Build + uses: docker/build-push-action@v6 + with: + push: false + + - name: Executar scripts + run: | + git branch + java --version + mvn clean package \ No newline at end of file From d1e43436f9bf13c6db32d471a6972453d21b6239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 15:37:33 -0300 Subject: [PATCH 04/14] Adicionando CI --- .github/workflows/continuous_integration.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/continuous_integration.yaml diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml new file mode 100644 index 0000000..e69de29 From 3d47536af72569e721d29277ba7f1285ab24926f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 15:40:43 -0300 Subject: [PATCH 05/14] Adicionando CI --- .github/workflows/continuous_integration.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml index e69de29..295a1d6 100644 --- a/.github/workflows/continuous_integration.yaml +++ b/.github/workflows/continuous_integration.yaml @@ -0,0 +1,20 @@ +name: Continuous Integration +on: + pull_request: + types: [opened, reopened] + branches: "feature/**" +jobs: + tests: + runs-on: ubuntu-latest + steps: + - + name: Git Checkout + uses: actions/checkout@v4 + + - name: Setup Java SDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Unit tests + run: mvn test \ No newline at end of file From 1c34df0d6e0b546995da7d0b7d1da0fab9fafa6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 15:42:24 -0300 Subject: [PATCH 06/14] Alterando compose --- compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yaml b/compose.yaml index b7dc1b5..959eeca 100644 --- a/compose.yaml +++ b/compose.yaml @@ -13,6 +13,6 @@ services: - "8080:8080" environment: - PROFILE=dev - - DATABASE_URL=jdbc:mysql://db:3306/api?createDatabaseIfNotExist=true + - DATABASE_URL=jdbc:mysql://bd-fiap-simple-java-api-dev.mysql.database.azure.com:3306/api?createDatabaseIfNotExist=true - DATABASE_USER=root - DATABASE_PWD=root_pass From 4df94b965ce72c8b05630cc4bc3b0701324d5144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 15:47:42 -0300 Subject: [PATCH 07/14] Deletando arquivo de CI --- .github/workflows/continuous_integration.yaml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/continuous_integration.yaml diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml deleted file mode 100644 index 295a1d6..0000000 --- a/.github/workflows/continuous_integration.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Continuous Integration -on: - pull_request: - types: [opened, reopened] - branches: "feature/**" -jobs: - tests: - runs-on: ubuntu-latest - steps: - - - name: Git Checkout - uses: actions/checkout@v4 - - - name: Setup Java SDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Unit tests - run: mvn test \ No newline at end of file From 63bd05f4e8a0777afc19f4e174c2dfd27156b83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 15:53:22 -0300 Subject: [PATCH 08/14] Adicionando CI --- .github/workflows/continuous_integration.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/continuous_integration.yaml diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml new file mode 100644 index 0000000..295a1d6 --- /dev/null +++ b/.github/workflows/continuous_integration.yaml @@ -0,0 +1,20 @@ +name: Continuous Integration +on: + pull_request: + types: [opened, reopened] + branches: "feature/**" +jobs: + tests: + runs-on: ubuntu-latest + steps: + - + name: Git Checkout + uses: actions/checkout@v4 + + - name: Setup Java SDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Unit tests + run: mvn test \ No newline at end of file From e713bf664e284923c84825655488e7de1d909e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:02:42 -0300 Subject: [PATCH 09/14] Update docs --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 13dea01..280115c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ docker compose up --build ./mvnw test - ## Documentação online (OpenAPI) http://localhost:8080/swagger-ui/index.html From cfdc659eb77f2c30fa18a86e3052e7e7f7967e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:10:34 -0300 Subject: [PATCH 10/14] Atualizando branch --- .github/workflows/continuous_integration.yaml | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/continuous_integration.yaml diff --git a/.github/workflows/continuous_integration.yaml b/.github/workflows/continuous_integration.yaml deleted file mode 100644 index 295a1d6..0000000 --- a/.github/workflows/continuous_integration.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Continuous Integration -on: - pull_request: - types: [opened, reopened] - branches: "feature/**" -jobs: - tests: - runs-on: ubuntu-latest - steps: - - - name: Git Checkout - uses: actions/checkout@v4 - - - name: Setup Java SDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Unit tests - run: mvn test \ No newline at end of file From da284f5e36fc5512e01f8a0d0e313ed89f1f1322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:22:26 -0300 Subject: [PATCH 11/14] Codigo com bug --- .../fiap/simple_api_java/controller/ProdutoControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java index 9670a52..6683f68 100644 --- a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java +++ b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java @@ -57,7 +57,7 @@ void testGivenNewProduto_whenCreate_thenSavedProduto() throws Exception{ @DisplayName("test fail") @Test void testGivenNewProduto_whenCreate_thenFail() throws Exception{ - // fail("Um erro acontecerá"); + fail("Um erro acontecerá"); } } From 5eb15d7688eb54db30817df287488826d3bfdcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:24:10 -0300 Subject: [PATCH 12/14] Bug corrigido --- .../fiap/simple_api_java/controller/ProdutoControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java index 6683f68..9670a52 100644 --- a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java +++ b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java @@ -57,7 +57,7 @@ void testGivenNewProduto_whenCreate_thenSavedProduto() throws Exception{ @DisplayName("test fail") @Test void testGivenNewProduto_whenCreate_thenFail() throws Exception{ - fail("Um erro acontecerá"); + // fail("Um erro acontecerá"); } } From e0b4350a29ca1157f132c55b3a1786528e32eed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:31:08 -0300 Subject: [PATCH 13/14] Testando bug em CI --- .../fiap/simple_api_java/controller/ProdutoControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java index 9670a52..6683f68 100644 --- a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java +++ b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java @@ -57,7 +57,7 @@ void testGivenNewProduto_whenCreate_thenSavedProduto() throws Exception{ @DisplayName("test fail") @Test void testGivenNewProduto_whenCreate_thenFail() throws Exception{ - // fail("Um erro acontecerá"); + fail("Um erro acontecerá"); } } From 9258a5b9b30d6668fc06af1ffd39566d64fdd7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Gon=C3=A7alves?= Date: Sat, 19 Apr 2025 16:32:13 -0300 Subject: [PATCH 14/14] =?UTF-8?q?Corre=C3=A7=C3=A3o=20do=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fiap/simple_api_java/controller/ProdutoControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java index 6683f68..9670a52 100644 --- a/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java +++ b/src/test/java/com/github/fiap/simple_api_java/controller/ProdutoControllerTest.java @@ -57,7 +57,7 @@ void testGivenNewProduto_whenCreate_thenSavedProduto() throws Exception{ @DisplayName("test fail") @Test void testGivenNewProduto_whenCreate_thenFail() throws Exception{ - fail("Um erro acontecerá"); + // fail("Um erro acontecerá"); } }