Skip to content
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

Development: Adjust server tests to restructuring into modules #9314

Merged
merged 48 commits into from
Sep 28, 2024

Move architecture tests and object method tests into shared test package

8b43b93
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Development: Adjust server tests to restructuring into modules #9314

Move architecture tests and object method tests into shared test package
8b43b93
Select commit
Loading
Failed to load commit list.
GitHub Actions / Java Architecture Tests failed Sep 13, 2024 in 0s

52 passed, 1 failed and 1 skipped

Tests failed

Report Passed Failed Skipped Time
build/test-results/test/TEST-de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest.xml 7✅ 1❌ 269ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.domain.notification.NotificationPlaceholderArchitectureTest.xml 2✅ 76ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ArchitectureTest.xml 19✅ 1⚪ 4s
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.EnforceRoleInResourceArchitectureTest.xml 2✅ 235ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.FeedbackArchitectureTest.xml 2✅ 390ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.RepositoryArchitectureTest.xml 11✅ 403ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ResourceArchitectureTest.xml 4✅ 86ms
build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ServiceArchitectureTest.xml 5✅ 224ms

❌ build/test-results/test/TEST-de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest.xml

8 tests were completed in 269ms with 7 passed, 1 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest 7✅ 1❌ 269ms

❌ de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest

✅ testEnforceAdminAnnotations()
✅ testEnforceAtLeastEditorAnnotations()
✅ testNoPreAuthorizeOnRestEndpoints()
✅ testEnforceAtLeastTutorAnnotations()
✅ testEnforceAtLeastInstructorAnnotations()
✅ testEnforceAtLeastStudentAnnotations()
❌ testEnforceNothingAnnotations()
	java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are annotated with @EnforceNothing and are not annotated with @ManualConfig should be declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..'' was violated (4 times):
✅ testNoPreAuthorizeOnRestControllers()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.domain.notification.NotificationPlaceholderArchitectureTest.xml

2 tests were completed in 76ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.domain.notification.NotificationPlaceholderArchitectureTest 2✅ 76ms

✅ de.tum.cit.aet.artemis.domain.notification.NotificationPlaceholderArchitectureTest

✅ testNotificationPlaceholderCreatorStringArrayCreation()
✅ testPlaceholderCreatorMethodSignature()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ArchitectureTest.xml

20 tests were completed in 4s with 19 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.ArchitectureTest 19✅ 1⚪ 4s

✅ de.tum.cit.aet.artemis.shared.architecture.ArchitectureTest

✅ ensureSpringComponentsAreProfileAnnotated()
✅ testNoJunitJupiterAssertions()
✅ hasMatchingAuthorizationTestClassBeCorrectlyImplemented()
✅ testFileWriteUsage()
✅ testCorrectStringUtils()
✅ testValidSimpMessageSendingOperationsUsage()
✅ testLogging()
✅ testNoHazelcastUsageInConstructors()
✅ testJSONImplementations()
✅ testNoRestControllersImported()
✅ testNoDirectGitCommitCalls()
✅ testNoCollectorsToList()
✅ testClassNameAndVisibility()
✅ testGsonExclusion()
✅ testNoJUnit4()
⚪ testDTOImplementations()
✅ shouldNotUserAutowiredAnnotation()
✅ testCorrectLoggerFields()
✅ testJsonIncludeNonEmpty()
✅ testNullnessAnnotations()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.EnforceRoleInResourceArchitectureTest.xml

2 tests were completed in 235ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.EnforceRoleInResourceArchitectureTest 2✅ 235ms

✅ de.tum.cit.aet.artemis.shared.architecture.EnforceRoleInResourceArchitectureTest

✅ testEnforceRoleInExerciseEndpointHasExerciseIdParameter()
✅ testEnforceRoleInCourseEndpointHasCourseIdParameter()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.FeedbackArchitectureTest.xml

2 tests were completed in 390ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.FeedbackArchitectureTest 2✅ 390ms

✅ de.tum.cit.aet.artemis.shared.architecture.FeedbackArchitectureTest

✅ testSetLongFeedbackTextNotUsed()
✅ testGetLongFeedbackTextNotUsed()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.RepositoryArchitectureTest.xml

11 tests were completed in 403ms with 11 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.RepositoryArchitectureTest 11✅ 403ms

✅ de.tum.cit.aet.artemis.shared.architecture.RepositoryArchitectureTest

✅ testNoEntityGraphsOnQueries()
✅ testNoUnusedRepositoryMethods()
✅ testTransactional()
✅ shouldBeInRepositoryPackage()
✅ testRepositoryParamAnnotation()
✅ orElseThrowShouldNotBeCalled()
✅ repositoriesImplementArtemisJpaRepository()
✅ persistenceShouldNotAccessServices()
✅ testJPQLStyle()
✅ shouldBeNamedRepository()
✅ testOnlySpringTransactionalAnnotation()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ResourceArchitectureTest.xml

4 tests were completed in 86ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.ResourceArchitectureTest 4✅ 86ms

✅ de.tum.cit.aet.artemis.shared.architecture.ResourceArchitectureTest

✅ allPublicMethodsShouldReturnResponseEntity()
✅ shouldBeNamedResource()
✅ shouldBeInResourcePackage()
✅ shouldCorrectlyUseRequestMappingAnnotations()

✅ build/test-results/test/TEST-de.tum.cit.aet.artemis.shared.architecture.ServiceArchitectureTest.xml

5 tests were completed in 224ms with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
de.tum.cit.aet.artemis.shared.architecture.ServiceArchitectureTest 5✅ 224ms

✅ de.tum.cit.aet.artemis.shared.architecture.ServiceArchitectureTest

✅ testCorrectAsyncCalls()
✅ shouldBeNamedService()
✅ testCorrectServiceAnnotation()
✅ shouldBeInServicePackage()
✅ testNoWrongServiceImports()

Annotations

Check failure on line 85 in src/test/java/de/tum/cit/aet/artemis/authorization/AuthorizationArchitectureTest.java

See this annotation in the file changed.

@github-actions github-actions / Java Architecture Tests

de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest ► testEnforceNothingAnnotations()

Failed test found in:
  build/test-results/test/TEST-de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest.xml
Error:
  java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are annotated with @EnforceNothing and are not annotated with @ManualConfig should be declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..'' was violated (4 times):
Raw output
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are annotated with @EnforceNothing and are not annotated with @ManualConfig should be declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..'' was violated (4 times):
Method <de.tum.cit.aet.artemis.iris.web.PublicPyrisStatusUpdateResource.setCompetencyExtractionJobStatus(java.lang.String, de.tum.cit.aet.artemis.iris.service.pyris.dto.competency.PyrisCompetencyStatusUpdateDTO, jakarta.servlet.http.HttpServletRequest)> is not declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..' in (PublicPyrisStatusUpdateResource.java:116)
Method <de.tum.cit.aet.artemis.iris.web.PublicPyrisStatusUpdateResource.setStatusOfCourseChatJob(java.lang.String, de.tum.cit.aet.artemis.iris.service.pyris.dto.chat.PyrisChatStatusUpdateDTO, jakarta.servlet.http.HttpServletRequest)> is not declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..' in (PublicPyrisStatusUpdateResource.java:90)
Method <de.tum.cit.aet.artemis.iris.web.PublicPyrisStatusUpdateResource.setStatusOfIngestionJob(java.lang.String, de.tum.cit.aet.artemis.iris.service.pyris.dto.lectureingestionwebhook.PyrisLectureIngestionStatusUpdateDTO, jakarta.servlet.http.HttpServletRequest)> is not declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..' in (PublicPyrisStatusUpdateResource.java:139)
Method <de.tum.cit.aet.artemis.iris.web.PublicPyrisStatusUpdateResource.setStatusOfJob(java.lang.String, de.tum.cit.aet.artemis.iris.service.pyris.dto.chat.PyrisChatStatusUpdateDTO, jakarta.servlet.http.HttpServletRequest)> is not declared in classes that reside in a package 'de.tum.cit.aet.artemis.*.web.open..' in (PublicPyrisStatusUpdateResource.java:65)
	at com.tngtech.archunit.lang.ArchRule$Assertions.assertNoViolation(ArchRule.java:94)
	at com.tngtech.archunit.lang.ArchRule$Assertions.check(ArchRule.java:86)
	at com.tngtech.archunit.lang.ArchRule$Factory$SimpleArchRule.check(ArchRule.java:165)
	at com.tngtech.archunit.lang.syntax.ObjectsShouldInternal.check(ObjectsShouldInternal.java:81)
	at de.tum.cit.aet.artemis.authorization.AuthorizationArchitectureTest.testEnforceNothingAnnotations(AuthorizationArchitectureTest.java:85)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)