-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add test to curriculumrepositorytest findbycourseidandstatus #142
Open
lucasg-c
wants to merge
13
commits into
develop
Choose a base branch
from
feature/add-test-to-curriculumrepositorytest-findbycourseidandstatus
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test: add test to curriculumrepositorytest findbycourseidandstatus #142
lucasg-c
wants to merge
13
commits into
develop
from
feature/add-test-to-curriculumrepositorytest-findbycourseidandstatus
Conversation
This file contains 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
…ndbycourseidandstatus test method
8 tasks
…ove their readability
…les in order to improve code quality
…xcludedid test methods
…ctors curriculumrepositorytest findbycourseidandstatus test methods
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
Application
foi 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 classeCourseRepositoryTest
e 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
CurriculumFactoryUtils
eCurriculumRepositoryTest
. Na primeira classe há um construtorsampleCurriculum
que retorna um objeto sample de tipoCurriculum
a 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@Test
e 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: