{"id":16111516,"url":"https://github.com/samlatavares/java-testes-unitarios","last_synced_at":"2026-05-14T23:03:12.756Z","repository":{"id":132806460,"uuid":"438064088","full_name":"samlatavares/java-testes-unitarios","owner":"samlatavares","description":"Project made during the \"Unit Tests in Java: Master JUnit, Mockito and TDD\" course from Udemy.","archived":false,"fork":false,"pushed_at":"2022-02-18T02:16:56.000Z","size":20421,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T12:16:56.849Z","etag":null,"topics":["java","junit","maven","mockito","powermock","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samlatavares.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-14T00:15:02.000Z","updated_at":"2022-02-18T12:51:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b7efc22-22dd-4029-aacd-7cb1bb8e8074","html_url":"https://github.com/samlatavares/java-testes-unitarios","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlatavares%2Fjava-testes-unitarios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlatavares%2Fjava-testes-unitarios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlatavares%2Fjava-testes-unitarios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlatavares%2Fjava-testes-unitarios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlatavares","download_url":"https://codeload.github.com/samlatavares/java-testes-unitarios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445479,"owners_count":20939948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","junit","maven","mockito","powermock","unit-testing"],"created_at":"2024-10-09T19:43:28.529Z","updated_at":"2025-09-23T21:56:24.699Z","avatar_url":"https://github.com/samlatavares.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# java-testes-unitarios\n\u003cp align=\"center\"\u003e\n\t\u003cspan\u003eEnglish\u003c/span\u003e | \u003ca href=\"https://github.com/samlatavares/java-testes-unitarios/blob/main/translations/pt-br/README.md\"\u003ePortuguês\u003c/a\u003e\n\u003c/p\u003e\n\nProject made during \"\u003ca href=\"https://www.udemy.com/course/testes-unitarios-em-java/\" target=\"_blank\"\u003eUnit Tests in Java: Master JUnit, Mockito and TDD\u003c/a\u003e\" course on Udemy. It's a Java Project with Unit Testing using JUnit and other technologies detailed below. The basis project were made available by the tutor.\n\n## Used Technologies\n- Java Language.\n- JUnit.\n- Mockito.\n- PowerMock.\n- Maven.\n\n## Structure\n\n### Disclaimer\n- I kept some commented code because this is a project made during classes and these code contains diferent forms to write a code that is working.\n- I thought this could be important to review the content that I've learned.\n\n### src/main\n- Main package that contains DAOs, Services and more.\n\n#### br.ce.daos\n- Contains DAOs examples but, how this was a project made to pratice Unit Testing, they are really simple.\n\t- LocacaoDAO: Interface of a rent class that will be mocked.\n\t- LocacaoDAOFake: Example of the rent class DAO implementantion.\n\t\n#### br.ce.entidades\n- Contains all entities of the project.\n\t- Filme: Movie Entity.\n\t- Locacao: Movie rental Entity.\n\t- Usuario: User Entity.\n\t\t\n#### br.ce.exceptions\n- Contains custom Exceptions.\n\t- FilmeSemEstoqueException: Used when the movie that the User are trying to rent is sold out.\n\t- LocadoraException: Used to indicate that something went wrong during the rent process.\n\t- NaoPodeDividirPorZeroException: Used when there are a division per zero during the rent calculus.\n\n#### br.ce.services\n- Contains all the logic.\n\t- Calculadora: A Calculador example, showing the main operations and using some custom exceptions.\n\t- EmailService: A interface to simulate the Email operations.\n\t- LocacaoService: A class with all rent operations.\n\t- SPCService: A interface to simulate a service that consults SPC Database to check if the user have credit restrictions.\n\t- TimerService: A service with a method for get the current date. Can be used as a workaround to mock the current date with Mockito.\n\n#### br.ce.utils\n- Contains the Utility classes.\n\t- DataUtils: A Utility Date class.\n\t\n### src/test\n- Package that contains all unit tests classes.\n\n#### br.ce.builders\n- Contains all Data Builders of the Entities.\n\t- FilmeBuilder: Movie builder.\n\t- LocacaoBuilder: Rent builder.\n\t- UsuarioBuilder: User builder.\n\t\n#### br.ce.runners\n- Contains the runners implementations.\n\t- ParallelRunner: Contains an example of an implementantion that can be used to run Parallel Tests.\n\n#### br.ce.servicos\n- Contains all test classes.\n\t- CalculadoraMockTest: Contains some examples of how Spy and Mock Annotations works.\n\t- CalculadoraTest: Contains the tests of the Calculadora (Calculator) class.\n\t- CalculoValorLocacaoTest: Contains the test of the rent calculus.\n\t- LocacaoServiceTest: Contains all tests of the LocacaoService (rent) class.\n\t- LocacaoServiceTest_PowerMock: Contains examples of methods of the LocacaoServiceTest that could use PowerMock.\t\n\n#### br.ce.servicos.matchers\n- Contains all custom matchers that can be used on the tests asserts.\n\n#### br.ce.suites\n- Contains a Tests Suite that runs all tests from CalculoValorLocacaoTest and LocacaoServiceTest classes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlatavares%2Fjava-testes-unitarios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlatavares%2Fjava-testes-unitarios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlatavares%2Fjava-testes-unitarios/lists"}