test: add test to curriculumrepositorytest findbycourseidandstatus - #142
Open
lucasg-c wants to merge 13 commits into
Open
test: add test to curriculumrepositorytest findbycourseidandstatus#142lucasg-c wants to merge 13 commits into
lucasg-c wants to merge 13 commits into
Conversation
…ndbycourseidandstatus test method
8 tasks
…ove their readability
…les in order to improve code quality
…xcludedid test methods
…ctors curriculumrepositorytest findbycourseidandstatus test methods
lucasg-c
marked this pull request as ready for review
July 8, 2022 20:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #140, resolves #141
Neste Pull Request, para solucionar as Issues #140 e #141, foram criadadas três classes e modificadas quatro. A primeira modificação na classe
Applicationfoi necessária para executar os testes codificados, visto que a linha 17@Import(RequestExpiresVerification.class)causa um erro que impossibilita essas execuções. A modificação na classeCampusRepositoryTest, embora alheia aos conteúdos das Issues, ocorreu para testar inicialmente o ambiente de testes dado o erro mencionado anteriormente.Para resolver o item "Implementar o teste do método
existsByAbbreviationAndDepartmentIdExcludedId" (#141) foi necessária a criação da classeCourseRepositoryTeste nela implementar três métodos, sendo dois deles o teste em si. O primeiro métodopublic void setUp(), com assinatura@BeforeEach, contém a criação de objetos sample que são usados durante as execuções dos testes. O métodoexistsByAbbreviationAndDepartmentIdExcludedId()testa o método considerando um retorno boolean true, enquanto o métodoexistsByAbbreviationAndDepartmentIdExcludedIdReturnsFalseWhenAbbreviationDiffers()testa o retorno false. Ambos os métodos foram assinados com@Test.Na resolução dos itens da Issue #140 foram criadas as classes
CurriculumFactoryUtilseCurriculumRepositoryTest. Na primeira classe há um construtorsampleCurriculumque retorna um objeto sample de tipoCurriculuma ser utilizado nos testes efetuados emCurriculumRepositoryTest, que além de também contar com um métodopublic void setUp()contém os testesfindByCourseIdAndStatusReturnsOnlyEnabledCourses(),existsByCourseId()edisableAllByCourseId(). Todos os testes foram assinados com@Teste são métodospublic.Referências:
Este Pull Request — e também a resolução integral das Issues #140 e #141 — relaciona-se com os seguintes PRs: