diff --git a/.github/workflows/02-workflow-filtro.yaml b/.github/workflows/02-workflow-filtro.yaml new file mode 100644 index 0000000..3c016db --- /dev/null +++ b/.github/workflows/02-workflow-filtro.yaml @@ -0,0 +1,13 @@ +name: 02 - Workflow Filtro + +on: + push: + branches: 'feature/**' + +jobs: + echo: + runs-on: ubuntu-latest + steps: + - name: Exibir o evento + run: echo "Workflow disparado por ${{ github.event_name }}"cls + \ No newline at end of file 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 diff --git a/.github/workflows/continous_integration.yaml b/.github/workflows/continous_integration.yaml new file mode 100644 index 0000000..7ae161d --- /dev/null +++ b/.github/workflows/continous_integration.yaml @@ -0,0 +1,20 @@ +name: Continuous Integration +on: + pull_request: + branches: + - develop +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 diff --git a/README.md b/README.md index 541f35a..c482df5 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Aplicação API docker compose up --build ``` -## Testes unitários (validação) +## Testes unitários (validation) ./mvnw test @@ -25,3 +25,4 @@ http://localhost:8080/swagger-ui/index.html ![](/assets/images/swagger.png) +minha primeira alteração no readme!! 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..5ffeabf 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 @@ -1,6 +1,5 @@ package com.github.fiap.simple_api_java.controller; -import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.*; import static org.mockito.BDDMockito.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -57,7 +56,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á"); } }