From cb7f1107fe013a66857452c3aebab91ee48065dc Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Fri, 20 Jun 2025 15:51:06 +0300 Subject: [PATCH] Remove allure (phase2) (#2483) Signed-off-by: Avgustin Marinov --- .gitignore | 1 - CONTRIBUTING.md | 20 +- .../repository/urlhandler/Base62UtilTest.java | 23 +- .../PropertyBasedArtifactUrlHandlerTest.java | 64 +- .../urlhandler/URLPlaceholderTest.java | 44 +- .../ArtifactFilesystemRepositoryTest.java | 44 +- .../repository/ArtifactFilesystemTest.java | 23 +- ...29d7-4dd0-bcb6-b2ed361c31e2-container.json | 1 - ...e0fe-4cc1-ab20-30344dfd7f6c-container.json | 1 - ...6013-4be4-8227-85e47d019d3c-container.json | 1 - ...f3-6314-4839-8931-32fd25ee40a2-result.json | 1 - ...9c51-49d4-87a2-83439f64c3f5-container.json | 1 - ...42a3-4022-a827-d28eee4739bd-container.json | 1 - ...7aaf-4ae2-8eb4-0ccc2876d81f-container.json | 1 - ...066c-4930-a6ab-ffebee1f01c0-container.json | 1 - ...e387-41ee-9f65-b7071c39dcc3-container.json | 1 - ...79c5-4b30-8098-6be0f22b98b8-container.json | 1 - ...ccba-4596-92af-8c1856ccc1e2-container.json | 1 - ...266b-46ac-a730-c152c6afcf7a-container.json | 1 - ...754c-4948-8b59-056528a83d1c-container.json | 1 - ...31-9a32-4374-b928-137aca4f2f30-result.json | 1 - ...eb9f-4349-916e-70229f574807-container.json | 1 - ...c9f9-426f-8fc5-597b8d1eccbf-container.json | 1 - ...8c-e102-4ac5-9971-edfe8accda95-result.json | 1 - ...3277-4726-ad64-e84bd2218c37-container.json | 1 - ...8f1e-4038-9342-a6270abf50f5-container.json | 1 - ...13-728c-4020-9afd-e776432afb0b-result.json | 1 - ...f8ca-4017-8db8-f93cec3bab1a-container.json | 1 - ...55-7762-4fcb-9795-5aaafe5329e2-result.json | 1 - ...dfd1-48bf-b383-f83cffa9411e-container.json | 1 - ...bfdd-4c01-aa36-f68b1c09a2fd-container.json | 1 - ...48-2ebf-44ec-a6ee-7e6d7024e1a2-result.json | 1 - ...f9c4-476e-940e-1a4d6ae96684-container.json | 1 - ...37f2-4cae-a692-ccdda74fb1d1-container.json | 1 - ...d1-1800-4cd4-9c59-5094f1221293-result.json | 1 - ...976b-412e-a112-7e96c3901dee-container.json | 1 - ...ba6d-4b94-bb29-0e219c3f8604-container.json | 1 - ...8c-640d-4164-9557-cad7ac0832da-result.json | 1 - ...73-b904-4e05-9b16-bdd986547be7-result.json | 1 - ...a5d4-44a4-bbb0-71bbf92f66f5-container.json | 1 - ...0abf-4693-a4ab-89a4ef475c03-container.json | 1 - ...69-24d2-4eff-ba3c-1ef30b0519fd-result.json | 1 - ...169c-435f-9751-0ff0c0c3ede7-container.json | 1 - ...e8-5368-401c-9297-8c6c7bbf830e-result.json | 1 - ...d959-4d7d-bb53-541eea388c17-container.json | 1 - ...14-7aff-400e-8230-a00f1339827c-result.json | 1 - ...0b58-485e-a615-1caa49d50682-container.json | 1 - ...bd-a706-441a-ada6-e8d141013858-result.json | 1 - ...fe-fd36-4dc0-981e-95e743b8d086-result.json | 1 - ...c849-43f8-88f6-98fec388c199-container.json | 1 - ...47-6a59-4f21-a52c-7c190cb1dfab-result.json | 1 - ...aa11-4f29-97a0-423d009e546d-container.json | 1 - .../repository/FileNameFieldsTest.java | 8 +- .../ddi/json/model/DdiActionFeedbackTest.java | 36 +- .../ddi/json/model/DdiActionHistoryTest.java | 29 +- .../ddi/json/model/DdiArtifactHashTest.java | 29 +- .../ddi/json/model/DdiArtifactTest.java | 29 +- .../json/model/DdiCancelActionToStopTest.java | 29 +- .../hawkbit/ddi/json/model/DdiCancelTest.java | 29 +- .../hawkbit/ddi/json/model/DdiChunkTest.java | 29 +- .../ddi/json/model/DdiConfigDataTest.java | 36 +- .../hawkbit/ddi/json/model/DdiConfigTest.java | 29 +- .../json/model/DdiConfirmationBaseTest.java | 29 +- .../ddi/json/model/DdiControllerBaseTest.java | 29 +- .../ddi/json/model/DdiDeploymentBaseTest.java | 29 +- .../ddi/json/model/DdiDeploymentTest.java | 29 +- .../ddi/json/model/DdiMetadataTest.java | 29 +- .../ddi/json/model/DdiPollingTest.java | 29 +- .../ddi/json/model/DdiProgressTest.java | 29 +- .../hawkbit/ddi/json/model/DdiResultTest.java | 29 +- .../hawkbit/ddi/json/model/DdiStatusTest.java | 33 +- .../JsonIgnorePropertiesAnnotationTest.java | 15 +- .../resource/DdiArtifactDownloadTest.java | 30 +- .../rest/resource/DdiCancelActionTest.java | 64 +- .../ddi/rest/resource/DdiConfigDataTest.java | 63 +- .../resource/DdiConfirmationBaseTest.java | 89 +-- .../rest/resource/DdiDeploymentBaseTest.java | 132 ++-- .../rest/resource/DdiInstalledBaseTest.java | 100 +-- .../rest/resource/DdiRootControllerTest.java | 150 +++-- .../ddi/rest/resource/DosFilterTest.java | 58 +- .../GatewayTokenAuthenticatorTest.java | 37 +- .../SecurityHeaderAuthenticatorTest.java | 51 +- .../SecurityTokenAuthenticatorTest.java | 37 +- .../hawkbit/app/ddi/AllowedHostNamesTest.java | 30 +- .../app/ddi/PreAuthorizeEnabledTest.java | 23 +- .../AmqpMessageDispatcherServiceTest.java | 58 +- .../amqp/AmqpMessageHandlerServiceTest.java | 173 ++--- .../hawkbit/amqp/BaseAmqpServiceTest.java | 37 +- .../amqp/RequestExceptionStrategyTest.java | 37 +- .../AbstractAmqpServiceIntegrationTest.java | 4 - ...ssageDispatcherServiceIntegrationTest.java | 146 +++-- ...pMessageHandlerServiceIntegrationTest.java | 332 ++++++---- .../model/AuditFieldSerializationTest.java | 8 +- .../mgmt/json/model/PagedListTest.java | 30 +- .../MgmtTargetAssignmentResponseBodyTest.java | 14 +- .../rest/resource/MgmtActionResourceTest.java | 129 ++-- .../resource/MgmtBasicAuthResourceTest.java | 23 +- .../rest/resource/MgmtContentTypeTest.java | 93 +-- .../MgmtDistributionSetResourceTest.java | 431 ++++++------ .../MgmtDistributionSetTagResourceTest.java | 121 ++-- .../MgmtDistributionSetTypeResourceTest.java | 142 ++-- .../resource/MgmtRolloutResourceTest.java | 379 ++++++----- .../MgmtSoftwareModuleResourceTest.java | 294 +++++---- .../MgmtSoftwareModuleTypeResourceTest.java | 96 +-- .../MgmtTargetFilterQueryResourceTest.java | 177 ++--- .../rest/resource/MgmtTargetResourceTest.java | 616 ++++++++++-------- .../resource/MgmtTargetTagResourceTest.java | 148 +++-- .../resource/MgmtTargetTypeResourceTest.java | 109 ++-- .../MgmtTenantManagementResourceTest.java | 106 +-- .../rest/resource/util/SortUtilityTest.java | 51 +- .../app/mgmt/AllowedHostNamesTest.java | 30 +- .../eclipse/hawkbit/app/mgmt/CorsTest.java | 16 +- .../app/mgmt/PreAuthorizeEnabledTest.java | 44 +- .../hawkbit/app/AllowedHostNamesTest.java | 30 +- .../org/eclipse/hawkbit/app/CorsTest.java | 16 +- .../hawkbit/app/PreAuthorizeEnabledTest.java | 44 +- .../ArtifactEncryptionServiceTest.java | 15 +- .../MaintenanceScheduleHelperTest.java | 58 +- .../hawkbit/repository/RegexCharTest.java | 23 +- ...gementMethodPreAuthorizeAnnotatedTest.java | 16 +- .../model/TotalTargetCountStatusTest.java | 27 +- .../BusProtoStuffMessageConverterTest.java | 15 +- .../jpa/HawkBitEclipseLinkJpaDialectTest.java | 39 +- .../event/remote/RemoteIdEventTest.java | 50 +- .../remote/RemoteTenantAwareEventTest.java | 44 +- .../entity/AbstractRemoteEntityEventTest.java | 7 +- .../event/remote/entity/ActionEventTest.java | 22 +- .../DistributionSetCreatedEventTest.java | 15 +- .../entity/DistributionSetTagEventTest.java | 22 +- .../DistributionSetUpdatedEventTest.java | 15 +- .../event/remote/entity/RolloutEventTest.java | 15 +- .../remote/entity/RolloutGroupEventTest.java | 22 +- .../entity/SoftwareModuleEventTest.java | 22 +- .../event/remote/entity/TargetEventTest.java | 22 +- .../remote/entity/TargetTagEventTest.java | 22 +- ...tractRepositoryManagementSecurityTest.java | 78 ++- ...urrentDistributionSetInvalidationTest.java | 15 +- .../jpa/acm/context/ContextAwareTest.java | 44 +- .../DistributionSetAccessControllerTest.java | 23 +- .../TargetAccessControllerTest.java | 44 +- .../TargetTypeAccessControllerTest.java | 37 +- .../autoassign/AutoAssignCheckerIntTest.java | 79 +-- .../jpa/autoassign/AutoAssignCheckerTest.java | 16 +- .../autocleanup/AutoActionCleanupTest.java | 43 +- .../autocleanup/AutoCleanupSchedulerTest.java | 15 +- .../jpa/cluster/DistributedLockTest.java | 13 +- .../jpa/event/RepositoryEntityEventTest.java | 93 +-- .../repository/jpa/management/ActionTest.java | 37 +- .../ArtifactManagementSecurityTest.java | 79 ++- .../management/ArtifactManagementTest.java | 143 ++-- .../ConfirmationManagementSecurityTest.java | 51 +- .../ConfirmationManagementTest.java | 89 +-- .../ControllerManagementSecurityTest.java | 219 ++++--- .../management/ControllerManagementTest.java | 400 +++++++----- .../DeploymentManagementSecurityTest.java | 219 ++++--- .../management/DeploymentManagementTest.java | 339 ++++++---- ...ributionSetInvalidationManagementTest.java | 70 +- ...DistributionSetManagementSecurityTest.java | 205 +++--- .../DistributionSetManagementTest.java | 291 +++++---- ...tributionSetTagManagementSecurityTest.java | 30 +- .../DistributionSetTagManagementTest.java | 93 +-- ...ributionSetTypeManagementSecurityTest.java | 44 +- .../DistributionSetTypeManagementTest.java | 87 +-- .../LazyControllerManagementTest.java | 16 +- .../RolloutGroupManagementSecurityTest.java | 79 ++- .../RolloutGroupManagementTest.java | 28 +- .../management/RolloutManagementFlowTest.java | 43 +- .../RolloutManagementSecurityTest.java | 163 +++-- .../jpa/management/RolloutManagementTest.java | 427 ++++++------ .../SoftwareManagementSecurityTest.java | 100 +-- .../SoftwareModuleManagementTest.java | 193 +++--- ...twareModuleTypeManagementSecurityTest.java | 23 +- .../SoftwareModuleTypeManagementTest.java | 84 ++- .../SystemManagementSecurityTest.java | 79 ++- .../jpa/management/SystemManagementTest.java | 44 +- ...rgetFilterQueryManagementSecurityTest.java | 135 ++-- .../TargetFilterQueryManagementTest.java | 185 +++--- .../TargetManagementSearchTest.java | 86 +-- .../TargetManagementSecurityTest.java | 415 +++++++----- .../jpa/management/TargetManagementTest.java | 276 ++++---- .../TargetTagManagementSecurityTest.java | 79 ++- .../management/TargetTagManagementTest.java | 87 +-- .../TargetTypeManagementSecurityTest.java | 114 ++-- .../management/TargetTypeManagementTest.java | 89 +-- ...ntConfigurationManagementSecurityTest.java | 58 +- .../TenantConfigurationManagementTest.java | 128 ++-- .../model/EntityInterceptorListenerTest.java | 57 +- .../jpa/model/ModelEqualsHashcodeTest.java | 37 +- .../jpa/rsql/RSQLActionFieldsTest.java | 30 +- .../jpa/rsql/RSQLRolloutFieldTest.java | 16 +- .../jpa/rsql/RSQLRolloutGroupFieldTest.java | 30 +- .../jpa/rsql/RSQLSoftwareModuleFieldTest.java | 58 +- .../RSQLSoftwareModuleTypeFieldsTest.java | 44 +- .../jpa/rsql/RSQLTagFieldsTest.java | 51 +- .../jpa/rsql/RSQLTargetFieldTest.java | 121 ++-- .../rsql/RSQLTargetFilterQueryFieldsTest.java | 37 +- .../repository/jpa/rsql/RSQLUtilityTest.java | 25 +- .../jpa/rsql/VirtualPropertyResolverTest.java | 27 +- .../SpecificationsBuilderTest.java | 30 +- .../jpa/tenancy/MultiTenancyEntityTest.java | 50 +- ...ExcludePathAwareShallowETagFilterTest.java | 8 +- .../rest/json/model/ExceptionInfoTest.java | 16 +- .../rest/util/FileStreamingUtilTest.java | 8 +- ...93dc-4643-9d2a-03226a2ac582-container.json | 1 - ...c6-1901-431a-ad53-68e5eed7eecd-result.json | 1 - ...9d05-45fb-bbee-0277cf948938-container.json | 1 - ...bc32-47f2-8b00-a3bd24cea23c-container.json | 1 - ...318c-48c6-ae0c-3cfc94716ef4-container.json | 1 - ...43-b07e-44be-9127-20df5e4ec5b6-result.json | 1 - ...97-b4e2-4e4c-a26b-f1e7a8a3bdca-result.json | 1 - ...ba-94c0-4c3b-b50b-093ceae56ae9-result.json | 1 - ...7f-3e4e-4f94-9c54-db2c574fd3cb-result.json | 1 - ...64c1-4b13-8530-234162dd9c35-container.json | 1 - ...8b-a3cf-4731-9d2f-5dc8fd17de88-result.json | 1 - ...82-ba7d-4cce-ba34-4f8c4b1269e2-result.json | 1 - ...6fb3-4d08-b3c4-cd765c898cc7-container.json | 1 - ...1d06-43fe-8751-e1d65185722c-container.json | 1 - ...2e-7fe8-4031-952a-841109b6f3cd-result.json | 1 - ...e0a6-472c-9d61-51aa7e24c61b-container.json | 1 - ...8b2b-4d1a-8353-73e782cbfd33-container.json | 1 - ...b5da-4b26-b6cd-3673318e3980-container.json | 1 - ...2f1b-4940-9f29-5120ed41d9d0-container.json | 1 - ...b164-45f0-b717-676225857648-container.json | 1 - ...58-4ca8-4949-8a91-e51f7a4f1c60-result.json | 1 - ...68-b0d0-422a-af13-7e4c2a3afdf7-result.json | 1 - ...ba-749f-425a-9644-46a3ad15e2df-result.json | 1 - ...49-3a55-4c9e-bd80-2f1a68dc8a68-result.json | 1 - ...7282-4d46-8df4-8feed260ed52-container.json | 1 - ...49-6474-4214-9cda-b425ceecf7b9-result.json | 1 - ...ff9e-4e6f-87df-c1646347bbe0-container.json | 1 - ...0d82-45cf-8ba5-69b966cdb781-container.json | 1 - ...3434-4b36-9e23-8c1cb1ec162c-container.json | 1 - ...d8ed-4695-819b-efa3ab30fc88-container.json | 1 - ...be9b-4214-8453-c5a441067e94-container.json | 1 - ...3353-4550-b4ce-8a9b2c567497-container.json | 1 - ...e9-f2f7-49d6-8e32-6990805914b3-result.json | 1 - ...6a-aa54-4b5b-9fc2-90784325ea1f-result.json | 1 - ...5d-be83-48cd-9488-a6cb019d8605-result.json | 1 - ...d912-4bbc-b19d-033e27bc24fc-container.json | 1 - ...63-6667-4491-a562-ef513672935c-result.json | 1 - ...5b93-4f67-bac0-62a9f2e504b2-container.json | 1 - ...5287-4cb3-b955-0be70b0199a2-container.json | 1 - ...a3-a4d2-410f-ba72-6ca6edbda7a7-result.json | 1 - ...7d6b-4e64-8870-cd32037397ab-container.json | 1 - ...bf-4035-4bd1-a111-98253d19e243-result.json | 1 - ...13-ad73-4948-9959-ab0942d76e84-result.json | 1 - ...61a0-4848-891d-42846bbc3e1f-container.json | 1 - ...41-e1a1-4a6c-a00b-380d09ad5077-result.json | 1 - ...37-52e5-4956-95b6-2e569a7ef8e5-result.json | 1 - ...fe-0395-47d1-bf81-4806c6f2c6e0-result.json | 1 - ...f16c-427b-8dab-60f2ecf7d39f-container.json | 1 - ...18-5e65-4027-9114-d080e55a6901-result.json | 1 - ...c307-46b4-bc95-60ce78ee755b-container.json | 1 - ...e0-9c4f-4fdc-925d-8ce1ba80f916-result.json | 1 - ...3b19-4cc6-aee9-dc4695f7d2f3-container.json | 1 - ...a8-069d-4395-bbbd-2bece07014eb-result.json | 1 - ...4686-4156-857d-0f2a583a0d5e-container.json | 1 - ...e9-7e05-4a99-ab14-70b9008907fa-result.json | 1 - ...2632-4f39-a0fb-190b8c85cb81-container.json | 1 - ...857c-4bb1-89fc-9e5a0ecec390-container.json | 1 - ...aeb6-4f9e-b94a-f6a20197b4fd-container.json | 1 - ...d2ba-464a-8e4a-2e15ec4c76f0-container.json | 1 - ...95-4c60-416a-b076-380387fba8ee-result.json | 1 - ...c9-d4ca-4649-bbf0-063b4e4fd0a0-result.json | 1 - ...f01a-4040-b956-bdd901c8f81d-container.json | 1 - ...ab88-4d8d-95a9-3db7e07bfc38-container.json | 1 - ...5319-4b1a-a07c-286e5d8370d5-container.json | 1 - ...1dcc-4131-b02e-121abf208a7d-container.json | 1 - ...ca-acce-4a5d-86bb-ed04f0cb924c-result.json | 1 - ...fbe6-4c1e-9a92-e82c043cca82-container.json | 1 - ...3153-450b-9d57-367d9d0b836c-container.json | 1 - ...5f-cede-4b62-9f03-cb66907e5787-result.json | 1 - ...48-b944-4910-8983-823c2a167d8e-result.json | 1 - ...be-9d72-45b8-977a-c2d552a6efb9-result.json | 1 - ...ee1b-4524-ab23-8754712bc68b-container.json | 1 - ...022e-4594-9a04-0a4f102fe50c-container.json | 1 - ...c3c9-4e9d-88a5-5d2f62cd10a6-container.json | 1 - ...fd3a-4882-914d-698df3737644-container.json | 1 - ...61-e8ec-4551-a456-93ab9c6ec3ad-result.json | 1 - ...11e9-4440-8159-e11c1507e2a8-container.json | 1 - ...89-f197-4456-a5dd-ae514c43c9d5-result.json | 1 - ...ce0f-4623-9c5f-827ef6226cea-container.json | 1 - ...07-39c3-4ff4-a4b8-3b44b9fdfbef-result.json | 1 - ...87-6274-4a6e-99ac-3620b7530605-result.json | 1 - ...da68-4492-9b9b-356729f62c64-container.json | 1 - ...79-c841-4db2-b5e0-e325efdfb4a1-result.json | 1 - ...3c27-4f5d-a420-499f992531a1-container.json | 1 - ...5bd4-4511-bd74-e0fc4f3f5218-container.json | 1 - ...26-a82a-4da0-92b0-73f30f0abb90-result.json | 1 - ...c0d0-47ff-9687-aa6aa2a401af-container.json | 1 - ...d4c3-4832-8321-1270b0ab2172-container.json | 1 - ...4e-1d5e-4770-8bb5-2cc5edb655d6-result.json | 1 - ...f3-cae6-404b-a987-83d212178c20-result.json | 1 - ...1c-963e-4ea9-a37b-a54f8628c041-result.json | 1 - ...7145-40eb-9004-ed044bd26d0f-container.json | 1 - ...1c-07f3-4cb1-ab5d-a4bab40cc26a-result.json | 1 - ...9d88-4b92-a42d-877cd8bb1d5e-container.json | 1 - ...8ba3-4738-97ab-b8389c4bc5a4-container.json | 1 - ...065d-4d53-a14f-a4973082542c-container.json | 1 - ...ef41-4b51-a52e-defef15b32e1-container.json | 1 - ...d3-61a0-4b72-9e5f-3432e8873be8-result.json | 1 - ...d6-8430-49e0-9f53-fb61937ae380-result.json | 1 - ...6cb4-4f3b-8446-6fdd5bfd3c5e-container.json | 1 - ...fe95-476f-9af6-e8dfd6cca047-container.json | 1 - ...417e-4a57-8e57-4605bd7f1202-container.json | 1 - ...01-b444-4c84-94ba-5537176a522f-result.json | 1 - ...c0-038f-47e1-a4bd-664e3f61b629-result.json | 1 - ...5b-266c-4e81-a8e3-fe8c67c20927-result.json | 1 - ...5a-4f03-4b81-bfc6-2ca150e83a56-result.json | 1 - ...fc-4393-4a16-aaeb-f9599a9340e4-result.json | 1 - ...dc-89b1-4349-a1f5-513ce053c1d5-result.json | 1 - ...669d-43ed-b96f-7ee50c55edf4-container.json | 1 - ...fb-f84a-4c29-9c96-d78a9befc2a7-result.json | 1 - ...8bf0-4958-887d-a656eca31841-container.json | 1 - ...50be-48f2-a8ac-411caa753fe2-container.json | 1 - ...f24f-4b4f-a2e9-ee831a317e51-container.json | 1 - ...0b68-4d64-8e8d-1061da05800c-container.json | 1 - ...b231-49cc-8c2a-4ca42ecfdd1c-container.json | 1 - ...3104-45f3-b7c4-efb8f2a77e79-container.json | 1 - ...2ec4-4691-88f8-80b40107cb81-container.json | 1 - ...87a5-4e6c-a125-8bd8bb16bdbc-container.json | 1 - ...f800-468f-b3fa-f93cba99e1f5-container.json | 1 - ...61-dca1-487c-bc68-e08e399b3182-result.json | 1 - ...4d-4335-4dcf-95ff-31d297e96f2c-result.json | 1 - ...f3-d2dd-4164-af09-701fd2351ae9-result.json | 1 - ...d3-7d9e-469d-8ec6-6477acbd24e6-result.json | 1 - ...2c55-4851-a2b2-53d9be1407ed-container.json | 1 - ...61-bc34-4c8e-92aa-8310e9a89df3-result.json | 1 - ...5b-55ca-4f74-90c7-02755739cda0-result.json | 1 - ...794a-42df-87b6-3000e46c18f8-container.json | 1 - ...68f2-4d17-84b0-2ddcc59c76d4-container.json | 1 - ...7893-4c4c-87fa-2744a3aed54b-container.json | 1 - ...347e-457d-b8ac-ffd6733723e4-container.json | 1 - ...cb00-4d16-8645-268a0060207b-container.json | 1 - ...2f0f-485d-ad60-eead741d093d-container.json | 1 - ...f141-4d0a-a7ad-32720719b2d7-container.json | 1 - ...89bf-4665-93b7-513a4fdc6bd3-container.json | 1 - ...f790-4125-a9c8-eb870e90e42b-container.json | 1 - ...9f61-4f83-b0e1-3d2a20d8a558-container.json | 1 - ...c096-4bfa-b550-8043b31ace7a-container.json | 1 - ...767c-47ef-8e82-615cf8aafe3b-container.json | 1 - ...d0f7-4887-9c8a-3da4711442a0-container.json | 1 - ...82-c02a-4fe9-b627-6c2d27aa5cbb-result.json | 1 - ...9e-a2a3-4724-a4ab-20f21e274bf6-result.json | 1 - ...59-9ba7-4a8a-abb0-b817b62fbbf9-result.json | 1 - ...40af-4f04-8e26-4d5683d1b9b1-container.json | 1 - ...e6-b6b9-45ee-bad5-47beeb796618-result.json | 1 - ...1f-8836-4fc1-b614-82ddcfbc7add-result.json | 1 - ...ff04-4b32-b7e1-1f9406722960-container.json | 1 - ...757f-4fd6-a3a2-e725a82084d2-container.json | 1 - ...4c8e-4b66-a349-864de57916e5-container.json | 1 - ...85-139a-4c3a-88b9-4b6f8ab57d64-result.json | 1 - ...6ba5-4311-8798-6f32d4892396-container.json | 1 - ...ea-0fe0-4248-84d0-3c9d43f8c660-result.json | 1 - ...d384-4112-af06-a7ddab7112ab-container.json | 1 - ...c8-957f-4521-ab1b-fe293ffbf05c-result.json | 1 - ...3d-e4eb-4240-ba35-34eb26112891-result.json | 1 - ...910e-41cb-87a2-9ca127a99043-container.json | 1 - ...15-d557-4d1f-8e28-8a535f14f684-result.json | 1 - ...cb-1dec-433e-a130-fd42df15439f-result.json | 1 - ...95-189a-4dd5-9571-eba4e7f9457a-result.json | 1 - ...32f4-4013-877d-fddfc490c80f-container.json | 1 - ...9e-3efe-4de0-a73d-8c4b4b6bd363-result.json | 1 - ...9f-eec1-49f7-a805-b72c1430e375-result.json | 1 - ...ff-fa32-4651-a1e5-70fb77eeb77c-result.json | 1 - ...6cde-4f6f-8743-da271ffeeaa7-container.json | 1 - ...f9-9864-487a-9e12-6eabd531f4aa-result.json | 1 - ...c4-d3dc-45af-9a80-aca51378da23-result.json | 1 - ...ae-c5ed-476b-bc99-5d69637548f5-result.json | 1 - ...19-f88d-42e3-bc83-eaf1533d2c54-result.json | 1 - ...0e-f92b-4663-acbc-0e68b5743fd7-result.json | 1 - ...a7af-4bfd-895f-19765e4d81bc-container.json | 1 - ...80b3-4657-9336-5e3f06d11772-container.json | 1 - ...8331-4c1e-9316-1d16a599650a-container.json | 1 - ...57-a7e2-4cf2-8ba2-67638cc7841e-result.json | 1 - ...beee-42d0-a6bb-050de2fd2dac-container.json | 1 - ...33ae-4bc0-ab03-f0e081ed2229-container.json | 1 - ...90c1-4b32-ab87-34d3bf6ffdf7-container.json | 1 - ...2507-4a44-90c4-3b6540cda847-container.json | 1 - ...3352-4896-8cce-1428a1d75998-container.json | 1 - ...50-6dc2-4051-8e33-8e4a00ca62dc-result.json | 1 - ...a4-0452-4960-bada-b6457976e383-result.json | 1 - ...c0f5-4861-b1a0-b5acab5bdea6-container.json | 1 - ...4e63-4498-b3bc-5bff411c4efa-container.json | 1 - ...7f-dd92-43c4-b975-b145913db907-result.json | 1 - ...8d-ae91-4365-a883-65c121d5a6f0-result.json | 1 - ...81-a794-42c3-bfc3-0e657da47624-result.json | 1 - ...7f-8343-4732-98c5-38abbd92797a-result.json | 1 - ...e803-4870-9df8-1c589a708f5c-container.json | 1 - ...4e-536a-474a-b31d-b931334d94a7-result.json | 1 - ...1884-4026-bcc1-b57c5368e48f-container.json | 1 - ...232b-4090-a4e3-3d4a8363bac7-container.json | 1 - ...f5-de73-47e3-8d8c-d3dc8e564d1d-result.json | 1 - ...a6-e461-42bd-84c4-86af1971750c-result.json | 1 - ...1b67-4e6b-b18d-61bd7c9aee3f-container.json | 1 - ...c86c-41fd-a251-8fe9b2c07475-container.json | 1 - ...24a5-446d-baf3-389b875541ae-container.json | 1 - ...b6-b5d6-4f4d-9e7c-b63642fea5c4-result.json | 1 - ...007e-48c3-9b5c-2e041d65209b-container.json | 1 - ...6b-c258-43b2-9cfd-61c0588448f5-result.json | 1 - ...9b99-47e2-bfa4-d673364346c1-container.json | 1 - ...1724-4cd8-a67c-3b1803307e0c-container.json | 1 - ...affd-4572-9ab8-11b7c3fc3144-container.json | 1 - .../im/authentication/SpPermissionTest.java | 15 +- .../org/eclipse/hawkbit/util/IpUtilTest.java | 65 +- pom.xml | 8 - 406 files changed, 6993 insertions(+), 5863 deletions(-) delete mode 100644 hawkbit-core/allure-results/06b4b435-29d7-4dd0-bcb6-b2ed361c31e2-container.json delete mode 100644 hawkbit-core/allure-results/1e4882c6-e0fe-4cc1-ab20-30344dfd7f6c-container.json delete mode 100644 hawkbit-core/allure-results/1eb43d00-6013-4be4-8227-85e47d019d3c-container.json delete mode 100644 hawkbit-core/allure-results/1f78aaf3-6314-4839-8931-32fd25ee40a2-result.json delete mode 100644 hawkbit-core/allure-results/20e2a037-9c51-49d4-87a2-83439f64c3f5-container.json delete mode 100644 hawkbit-core/allure-results/236f34e7-42a3-4022-a827-d28eee4739bd-container.json delete mode 100644 hawkbit-core/allure-results/259e6e51-7aaf-4ae2-8eb4-0ccc2876d81f-container.json delete mode 100644 hawkbit-core/allure-results/26b493b3-066c-4930-a6ab-ffebee1f01c0-container.json delete mode 100644 hawkbit-core/allure-results/299732f9-e387-41ee-9f65-b7071c39dcc3-container.json delete mode 100644 hawkbit-core/allure-results/3393d874-79c5-4b30-8098-6be0f22b98b8-container.json delete mode 100644 hawkbit-core/allure-results/34038e21-ccba-4596-92af-8c1856ccc1e2-container.json delete mode 100644 hawkbit-core/allure-results/369f3516-266b-46ac-a730-c152c6afcf7a-container.json delete mode 100644 hawkbit-core/allure-results/39f0b93a-754c-4948-8b59-056528a83d1c-container.json delete mode 100644 hawkbit-core/allure-results/3b629131-9a32-4374-b928-137aca4f2f30-result.json delete mode 100644 hawkbit-core/allure-results/3eb09005-eb9f-4349-916e-70229f574807-container.json delete mode 100644 hawkbit-core/allure-results/40fbbc60-c9f9-426f-8fc5-597b8d1eccbf-container.json delete mode 100644 hawkbit-core/allure-results/43d8b58c-e102-4ac5-9971-edfe8accda95-result.json delete mode 100644 hawkbit-core/allure-results/4b168869-3277-4726-ad64-e84bd2218c37-container.json delete mode 100644 hawkbit-core/allure-results/4d398a49-8f1e-4038-9342-a6270abf50f5-container.json delete mode 100644 hawkbit-core/allure-results/597ffb13-728c-4020-9afd-e776432afb0b-result.json delete mode 100644 hawkbit-core/allure-results/5b69aea3-f8ca-4017-8db8-f93cec3bab1a-container.json delete mode 100644 hawkbit-core/allure-results/5c548055-7762-4fcb-9795-5aaafe5329e2-result.json delete mode 100644 hawkbit-core/allure-results/68e6b06c-dfd1-48bf-b383-f83cffa9411e-container.json delete mode 100644 hawkbit-core/allure-results/74aad84d-bfdd-4c01-aa36-f68b1c09a2fd-container.json delete mode 100644 hawkbit-core/allure-results/81317a48-2ebf-44ec-a6ee-7e6d7024e1a2-result.json delete mode 100644 hawkbit-core/allure-results/85b10456-f9c4-476e-940e-1a4d6ae96684-container.json delete mode 100644 hawkbit-core/allure-results/8ca7e456-37f2-4cae-a692-ccdda74fb1d1-container.json delete mode 100644 hawkbit-core/allure-results/913eecd1-1800-4cd4-9c59-5094f1221293-result.json delete mode 100644 hawkbit-core/allure-results/92653284-976b-412e-a112-7e96c3901dee-container.json delete mode 100644 hawkbit-core/allure-results/93fedcb9-ba6d-4b94-bb29-0e219c3f8604-container.json delete mode 100644 hawkbit-core/allure-results/9829198c-640d-4164-9557-cad7ac0832da-result.json delete mode 100644 hawkbit-core/allure-results/b3d07773-b904-4e05-9b16-bdd986547be7-result.json delete mode 100644 hawkbit-core/allure-results/bbcef88f-a5d4-44a4-bbb0-71bbf92f66f5-container.json delete mode 100644 hawkbit-core/allure-results/bd35f9eb-0abf-4693-a4ab-89a4ef475c03-container.json delete mode 100644 hawkbit-core/allure-results/bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd-result.json delete mode 100644 hawkbit-core/allure-results/c54916fe-169c-435f-9751-0ff0c0c3ede7-container.json delete mode 100644 hawkbit-core/allure-results/c7d19de8-5368-401c-9297-8c6c7bbf830e-result.json delete mode 100644 hawkbit-core/allure-results/cabd9766-d959-4d7d-bb53-541eea388c17-container.json delete mode 100644 hawkbit-core/allure-results/d701f914-7aff-400e-8230-a00f1339827c-result.json delete mode 100644 hawkbit-core/allure-results/e0062d7c-0b58-485e-a615-1caa49d50682-container.json delete mode 100644 hawkbit-core/allure-results/e6bd41bd-a706-441a-ada6-e8d141013858-result.json delete mode 100644 hawkbit-core/allure-results/e82046fe-fd36-4dc0-981e-95e743b8d086-result.json delete mode 100644 hawkbit-core/allure-results/ef752c83-c849-43f8-88f6-98fec388c199-container.json delete mode 100644 hawkbit-core/allure-results/f8b39d47-6a59-4f21-a52c-7c190cb1dfab-result.json delete mode 100644 hawkbit-core/allure-results/fe17f3a0-aa11-4f29-97a0-423d009e546d-container.json delete mode 100644 hawkbit-security-core/allure-results/00095825-93dc-4643-9d2a-03226a2ac582-container.json delete mode 100644 hawkbit-security-core/allure-results/00cef5c6-1901-431a-ad53-68e5eed7eecd-result.json delete mode 100644 hawkbit-security-core/allure-results/01baa046-9d05-45fb-bbee-0277cf948938-container.json delete mode 100644 hawkbit-security-core/allure-results/03463959-bc32-47f2-8b00-a3bd24cea23c-container.json delete mode 100644 hawkbit-security-core/allure-results/03ab9472-318c-48c6-ae0c-3cfc94716ef4-container.json delete mode 100644 hawkbit-security-core/allure-results/04339643-b07e-44be-9127-20df5e4ec5b6-result.json delete mode 100644 hawkbit-security-core/allure-results/05448497-b4e2-4e4c-a26b-f1e7a8a3bdca-result.json delete mode 100644 hawkbit-security-core/allure-results/069b7cba-94c0-4c3b-b50b-093ceae56ae9-result.json delete mode 100644 hawkbit-security-core/allure-results/0834987f-3e4e-4f94-9c54-db2c574fd3cb-result.json delete mode 100644 hawkbit-security-core/allure-results/097c25d6-64c1-4b13-8530-234162dd9c35-container.json delete mode 100644 hawkbit-security-core/allure-results/0dedb88b-a3cf-4731-9d2f-5dc8fd17de88-result.json delete mode 100644 hawkbit-security-core/allure-results/0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2-result.json delete mode 100644 hawkbit-security-core/allure-results/10c815b0-6fb3-4d08-b3c4-cd765c898cc7-container.json delete mode 100644 hawkbit-security-core/allure-results/11545db0-1d06-43fe-8751-e1d65185722c-container.json delete mode 100644 hawkbit-security-core/allure-results/13765e2e-7fe8-4031-952a-841109b6f3cd-result.json delete mode 100644 hawkbit-security-core/allure-results/1465cab3-e0a6-472c-9d61-51aa7e24c61b-container.json delete mode 100644 hawkbit-security-core/allure-results/1545ccc9-8b2b-4d1a-8353-73e782cbfd33-container.json delete mode 100644 hawkbit-security-core/allure-results/1763a9e0-b5da-4b26-b6cd-3673318e3980-container.json delete mode 100644 hawkbit-security-core/allure-results/1794900b-2f1b-4940-9f29-5120ed41d9d0-container.json delete mode 100644 hawkbit-security-core/allure-results/1cd530a2-b164-45f0-b717-676225857648-container.json delete mode 100644 hawkbit-security-core/allure-results/20058e58-4ca8-4949-8a91-e51f7a4f1c60-result.json delete mode 100644 hawkbit-security-core/allure-results/22c8fa68-b0d0-422a-af13-7e4c2a3afdf7-result.json delete mode 100644 hawkbit-security-core/allure-results/2341b3ba-749f-425a-9644-46a3ad15e2df-result.json delete mode 100644 hawkbit-security-core/allure-results/24600249-3a55-4c9e-bd80-2f1a68dc8a68-result.json delete mode 100644 hawkbit-security-core/allure-results/24b94444-7282-4d46-8df4-8feed260ed52-container.json delete mode 100644 hawkbit-security-core/allure-results/288da849-6474-4214-9cda-b425ceecf7b9-result.json delete mode 100644 hawkbit-security-core/allure-results/2a4ad8e0-ff9e-4e6f-87df-c1646347bbe0-container.json delete mode 100644 hawkbit-security-core/allure-results/2b1f393d-0d82-45cf-8ba5-69b966cdb781-container.json delete mode 100644 hawkbit-security-core/allure-results/2faffa73-3434-4b36-9e23-8c1cb1ec162c-container.json delete mode 100644 hawkbit-security-core/allure-results/30f989f1-d8ed-4695-819b-efa3ab30fc88-container.json delete mode 100644 hawkbit-security-core/allure-results/32e61e96-be9b-4214-8453-c5a441067e94-container.json delete mode 100644 hawkbit-security-core/allure-results/363e7068-3353-4550-b4ce-8a9b2c567497-container.json delete mode 100644 hawkbit-security-core/allure-results/367125e9-f2f7-49d6-8e32-6990805914b3-result.json delete mode 100644 hawkbit-security-core/allure-results/36a8466a-aa54-4b5b-9fc2-90784325ea1f-result.json delete mode 100644 hawkbit-security-core/allure-results/39a6455d-be83-48cd-9488-a6cb019d8605-result.json delete mode 100644 hawkbit-security-core/allure-results/3c37f5d7-d912-4bbc-b19d-033e27bc24fc-container.json delete mode 100644 hawkbit-security-core/allure-results/3d320f63-6667-4491-a562-ef513672935c-result.json delete mode 100644 hawkbit-security-core/allure-results/3df83a07-5b93-4f67-bac0-62a9f2e504b2-container.json delete mode 100644 hawkbit-security-core/allure-results/403761e6-5287-4cb3-b955-0be70b0199a2-container.json delete mode 100644 hawkbit-security-core/allure-results/40a60da3-a4d2-410f-ba72-6ca6edbda7a7-result.json delete mode 100644 hawkbit-security-core/allure-results/442a6eab-7d6b-4e64-8870-cd32037397ab-container.json delete mode 100644 hawkbit-security-core/allure-results/44a13cbf-4035-4bd1-a111-98253d19e243-result.json delete mode 100644 hawkbit-security-core/allure-results/45c48313-ad73-4948-9959-ab0942d76e84-result.json delete mode 100644 hawkbit-security-core/allure-results/4631a335-61a0-4848-891d-42846bbc3e1f-container.json delete mode 100644 hawkbit-security-core/allure-results/46783e41-e1a1-4a6c-a00b-380d09ad5077-result.json delete mode 100644 hawkbit-security-core/allure-results/48b84837-52e5-4956-95b6-2e569a7ef8e5-result.json delete mode 100644 hawkbit-security-core/allure-results/49a58dfe-0395-47d1-bf81-4806c6f2c6e0-result.json delete mode 100644 hawkbit-security-core/allure-results/4a659ce4-f16c-427b-8dab-60f2ecf7d39f-container.json delete mode 100644 hawkbit-security-core/allure-results/4b5c5318-5e65-4027-9114-d080e55a6901-result.json delete mode 100644 hawkbit-security-core/allure-results/4d71dd97-c307-46b4-bc95-60ce78ee755b-container.json delete mode 100644 hawkbit-security-core/allure-results/4edf36e0-9c4f-4fdc-925d-8ce1ba80f916-result.json delete mode 100644 hawkbit-security-core/allure-results/4f21d041-3b19-4cc6-aee9-dc4695f7d2f3-container.json delete mode 100644 hawkbit-security-core/allure-results/5293c6a8-069d-4395-bbbd-2bece07014eb-result.json delete mode 100644 hawkbit-security-core/allure-results/52cbf4f6-4686-4156-857d-0f2a583a0d5e-container.json delete mode 100644 hawkbit-security-core/allure-results/577f5fe9-7e05-4a99-ab14-70b9008907fa-result.json delete mode 100644 hawkbit-security-core/allure-results/57c6aa2a-2632-4f39-a0fb-190b8c85cb81-container.json delete mode 100644 hawkbit-security-core/allure-results/5935f63c-857c-4bb1-89fc-9e5a0ecec390-container.json delete mode 100644 hawkbit-security-core/allure-results/59856281-aeb6-4f9e-b94a-f6a20197b4fd-container.json delete mode 100644 hawkbit-security-core/allure-results/59df7109-d2ba-464a-8e4a-2e15ec4c76f0-container.json delete mode 100644 hawkbit-security-core/allure-results/5a9e1495-4c60-416a-b076-380387fba8ee-result.json delete mode 100644 hawkbit-security-core/allure-results/5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0-result.json delete mode 100644 hawkbit-security-core/allure-results/5c80a396-f01a-4040-b956-bdd901c8f81d-container.json delete mode 100644 hawkbit-security-core/allure-results/5d4d8bc8-ab88-4d8d-95a9-3db7e07bfc38-container.json delete mode 100644 hawkbit-security-core/allure-results/5dd4f5a2-5319-4b1a-a07c-286e5d8370d5-container.json delete mode 100644 hawkbit-security-core/allure-results/62ea5167-1dcc-4131-b02e-121abf208a7d-container.json delete mode 100644 hawkbit-security-core/allure-results/6350f0ca-acce-4a5d-86bb-ed04f0cb924c-result.json delete mode 100644 hawkbit-security-core/allure-results/676700f9-fbe6-4c1e-9a92-e82c043cca82-container.json delete mode 100644 hawkbit-security-core/allure-results/69bd9185-3153-450b-9d57-367d9d0b836c-container.json delete mode 100644 hawkbit-security-core/allure-results/6a505c5f-cede-4b62-9f03-cb66907e5787-result.json delete mode 100644 hawkbit-security-core/allure-results/6b625c48-b944-4910-8983-823c2a167d8e-result.json delete mode 100644 hawkbit-security-core/allure-results/6be1d3be-9d72-45b8-977a-c2d552a6efb9-result.json delete mode 100644 hawkbit-security-core/allure-results/6c386c75-ee1b-4524-ab23-8754712bc68b-container.json delete mode 100644 hawkbit-security-core/allure-results/6e04aa85-022e-4594-9a04-0a4f102fe50c-container.json delete mode 100644 hawkbit-security-core/allure-results/6e49f7aa-c3c9-4e9d-88a5-5d2f62cd10a6-container.json delete mode 100644 hawkbit-security-core/allure-results/6ec61ead-fd3a-4882-914d-698df3737644-container.json delete mode 100644 hawkbit-security-core/allure-results/6ff77061-e8ec-4551-a456-93ab9c6ec3ad-result.json delete mode 100644 hawkbit-security-core/allure-results/71a16139-11e9-4440-8159-e11c1507e2a8-container.json delete mode 100644 hawkbit-security-core/allure-results/7393f789-f197-4456-a5dd-ae514c43c9d5-result.json delete mode 100644 hawkbit-security-core/allure-results/7685d60b-ce0f-4623-9c5f-827ef6226cea-container.json delete mode 100644 hawkbit-security-core/allure-results/793a6407-39c3-4ff4-a4b8-3b44b9fdfbef-result.json delete mode 100644 hawkbit-security-core/allure-results/7b675287-6274-4a6e-99ac-3620b7530605-result.json delete mode 100644 hawkbit-security-core/allure-results/7b723a2f-da68-4492-9b9b-356729f62c64-container.json delete mode 100644 hawkbit-security-core/allure-results/7bf55d79-c841-4db2-b5e0-e325efdfb4a1-result.json delete mode 100644 hawkbit-security-core/allure-results/7bf6bf92-3c27-4f5d-a420-499f992531a1-container.json delete mode 100644 hawkbit-security-core/allure-results/7c2d1566-5bd4-4511-bd74-e0fc4f3f5218-container.json delete mode 100644 hawkbit-security-core/allure-results/7c967126-a82a-4da0-92b0-73f30f0abb90-result.json delete mode 100644 hawkbit-security-core/allure-results/7d9a4970-c0d0-47ff-9687-aa6aa2a401af-container.json delete mode 100644 hawkbit-security-core/allure-results/7e5c52ef-d4c3-4832-8321-1270b0ab2172-container.json delete mode 100644 hawkbit-security-core/allure-results/7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6-result.json delete mode 100644 hawkbit-security-core/allure-results/7ff778f3-cae6-404b-a987-83d212178c20-result.json delete mode 100644 hawkbit-security-core/allure-results/801ee71c-963e-4ea9-a37b-a54f8628c041-result.json delete mode 100644 hawkbit-security-core/allure-results/806da070-7145-40eb-9004-ed044bd26d0f-container.json delete mode 100644 hawkbit-security-core/allure-results/8099131c-07f3-4cb1-ab5d-a4bab40cc26a-result.json delete mode 100644 hawkbit-security-core/allure-results/81d148c8-9d88-4b92-a42d-877cd8bb1d5e-container.json delete mode 100644 hawkbit-security-core/allure-results/844406fc-8ba3-4738-97ab-b8389c4bc5a4-container.json delete mode 100644 hawkbit-security-core/allure-results/853f3628-065d-4d53-a14f-a4973082542c-container.json delete mode 100644 hawkbit-security-core/allure-results/8620ac8c-ef41-4b51-a52e-defef15b32e1-container.json delete mode 100644 hawkbit-security-core/allure-results/86d179d3-61a0-4b72-9e5f-3432e8873be8-result.json delete mode 100644 hawkbit-security-core/allure-results/87049cd6-8430-49e0-9f53-fb61937ae380-result.json delete mode 100644 hawkbit-security-core/allure-results/8730d3a0-6cb4-4f3b-8446-6fdd5bfd3c5e-container.json delete mode 100644 hawkbit-security-core/allure-results/88241c03-fe95-476f-9af6-e8dfd6cca047-container.json delete mode 100644 hawkbit-security-core/allure-results/8852d683-417e-4a57-8e57-4605bd7f1202-container.json delete mode 100644 hawkbit-security-core/allure-results/8892bf01-b444-4c84-94ba-5537176a522f-result.json delete mode 100644 hawkbit-security-core/allure-results/897f9bc0-038f-47e1-a4bd-664e3f61b629-result.json delete mode 100644 hawkbit-security-core/allure-results/899a4e5b-266c-4e81-a8e3-fe8c67c20927-result.json delete mode 100644 hawkbit-security-core/allure-results/8a04b45a-4f03-4b81-bfc6-2ca150e83a56-result.json delete mode 100644 hawkbit-security-core/allure-results/8c8bfffc-4393-4a16-aaeb-f9599a9340e4-result.json delete mode 100644 hawkbit-security-core/allure-results/90242adc-89b1-4349-a1f5-513ce053c1d5-result.json delete mode 100644 hawkbit-security-core/allure-results/908c2641-669d-43ed-b96f-7ee50c55edf4-container.json delete mode 100644 hawkbit-security-core/allure-results/914127fb-f84a-4c29-9c96-d78a9befc2a7-result.json delete mode 100644 hawkbit-security-core/allure-results/94753b67-8bf0-4958-887d-a656eca31841-container.json delete mode 100644 hawkbit-security-core/allure-results/94efe841-50be-48f2-a8ac-411caa753fe2-container.json delete mode 100644 hawkbit-security-core/allure-results/97e08bb3-f24f-4b4f-a2e9-ee831a317e51-container.json delete mode 100644 hawkbit-security-core/allure-results/97f34bae-0b68-4d64-8e8d-1061da05800c-container.json delete mode 100644 hawkbit-security-core/allure-results/9878a862-b231-49cc-8c2a-4ca42ecfdd1c-container.json delete mode 100644 hawkbit-security-core/allure-results/99923ea9-3104-45f3-b7c4-efb8f2a77e79-container.json delete mode 100644 hawkbit-security-core/allure-results/9ae59bac-2ec4-4691-88f8-80b40107cb81-container.json delete mode 100644 hawkbit-security-core/allure-results/9bb5b538-87a5-4e6c-a125-8bd8bb16bdbc-container.json delete mode 100644 hawkbit-security-core/allure-results/9f0b72e5-f800-468f-b3fa-f93cba99e1f5-container.json delete mode 100644 hawkbit-security-core/allure-results/a049cd61-dca1-487c-bc68-e08e399b3182-result.json delete mode 100644 hawkbit-security-core/allure-results/a0c5384d-4335-4dcf-95ff-31d297e96f2c-result.json delete mode 100644 hawkbit-security-core/allure-results/a40734f3-d2dd-4164-af09-701fd2351ae9-result.json delete mode 100644 hawkbit-security-core/allure-results/a5e356d3-7d9e-469d-8ec6-6477acbd24e6-result.json delete mode 100644 hawkbit-security-core/allure-results/a663290a-2c55-4851-a2b2-53d9be1407ed-container.json delete mode 100644 hawkbit-security-core/allure-results/a67acf61-bc34-4c8e-92aa-8310e9a89df3-result.json delete mode 100644 hawkbit-security-core/allure-results/a8765d5b-55ca-4f74-90c7-02755739cda0-result.json delete mode 100644 hawkbit-security-core/allure-results/aa6d4af1-794a-42df-87b6-3000e46c18f8-container.json delete mode 100644 hawkbit-security-core/allure-results/aae6fac2-68f2-4d17-84b0-2ddcc59c76d4-container.json delete mode 100644 hawkbit-security-core/allure-results/ac0e4ad9-7893-4c4c-87fa-2744a3aed54b-container.json delete mode 100644 hawkbit-security-core/allure-results/ac6285df-347e-457d-b8ac-ffd6733723e4-container.json delete mode 100644 hawkbit-security-core/allure-results/acc4f0bb-cb00-4d16-8645-268a0060207b-container.json delete mode 100644 hawkbit-security-core/allure-results/aed0c70a-2f0f-485d-ad60-eead741d093d-container.json delete mode 100644 hawkbit-security-core/allure-results/afc3995c-f141-4d0a-a7ad-32720719b2d7-container.json delete mode 100644 hawkbit-security-core/allure-results/b1b63c13-89bf-4665-93b7-513a4fdc6bd3-container.json delete mode 100644 hawkbit-security-core/allure-results/b2b75b89-f790-4125-a9c8-eb870e90e42b-container.json delete mode 100644 hawkbit-security-core/allure-results/b47d2b66-9f61-4f83-b0e1-3d2a20d8a558-container.json delete mode 100644 hawkbit-security-core/allure-results/b605639a-c096-4bfa-b550-8043b31ace7a-container.json delete mode 100644 hawkbit-security-core/allure-results/b80e1c2b-767c-47ef-8e82-615cf8aafe3b-container.json delete mode 100644 hawkbit-security-core/allure-results/b902829b-d0f7-4887-9c8a-3da4711442a0-container.json delete mode 100644 hawkbit-security-core/allure-results/b910d582-c02a-4fe9-b627-6c2d27aa5cbb-result.json delete mode 100644 hawkbit-security-core/allure-results/b94d399e-a2a3-4724-a4ab-20f21e274bf6-result.json delete mode 100644 hawkbit-security-core/allure-results/bb652b59-9ba7-4a8a-abb0-b817b62fbbf9-result.json delete mode 100644 hawkbit-security-core/allure-results/bc20a75f-40af-4f04-8e26-4d5683d1b9b1-container.json delete mode 100644 hawkbit-security-core/allure-results/bd2e4de6-b6b9-45ee-bad5-47beeb796618-result.json delete mode 100644 hawkbit-security-core/allure-results/bd7ce21f-8836-4fc1-b614-82ddcfbc7add-result.json delete mode 100644 hawkbit-security-core/allure-results/bdd0adab-ff04-4b32-b7e1-1f9406722960-container.json delete mode 100644 hawkbit-security-core/allure-results/be1917fc-757f-4fd6-a3a2-e725a82084d2-container.json delete mode 100644 hawkbit-security-core/allure-results/bff8c57c-4c8e-4b66-a349-864de57916e5-container.json delete mode 100644 hawkbit-security-core/allure-results/c0f02a85-139a-4c3a-88b9-4b6f8ab57d64-result.json delete mode 100644 hawkbit-security-core/allure-results/c13e9fbc-6ba5-4311-8798-6f32d4892396-container.json delete mode 100644 hawkbit-security-core/allure-results/c19022ea-0fe0-4248-84d0-3c9d43f8c660-result.json delete mode 100644 hawkbit-security-core/allure-results/c1b49afc-d384-4112-af06-a7ddab7112ab-container.json delete mode 100644 hawkbit-security-core/allure-results/c1bab8c8-957f-4521-ab1b-fe293ffbf05c-result.json delete mode 100644 hawkbit-security-core/allure-results/c291213d-e4eb-4240-ba35-34eb26112891-result.json delete mode 100644 hawkbit-security-core/allure-results/c30386f8-910e-41cb-87a2-9ca127a99043-container.json delete mode 100644 hawkbit-security-core/allure-results/c5c6d015-d557-4d1f-8e28-8a535f14f684-result.json delete mode 100644 hawkbit-security-core/allure-results/c63b4ccb-1dec-433e-a130-fd42df15439f-result.json delete mode 100644 hawkbit-security-core/allure-results/c64eff95-189a-4dd5-9571-eba4e7f9457a-result.json delete mode 100644 hawkbit-security-core/allure-results/c79a1ca5-32f4-4013-877d-fddfc490c80f-container.json delete mode 100644 hawkbit-security-core/allure-results/c8bab49e-3efe-4de0-a73d-8c4b4b6bd363-result.json delete mode 100644 hawkbit-security-core/allure-results/c8fdd19f-eec1-49f7-a805-b72c1430e375-result.json delete mode 100644 hawkbit-security-core/allure-results/ca5e9cff-fa32-4651-a1e5-70fb77eeb77c-result.json delete mode 100644 hawkbit-security-core/allure-results/cad6de8c-6cde-4f6f-8743-da271ffeeaa7-container.json delete mode 100644 hawkbit-security-core/allure-results/cc3f35f9-9864-487a-9e12-6eabd531f4aa-result.json delete mode 100644 hawkbit-security-core/allure-results/ce764dc4-d3dc-45af-9a80-aca51378da23-result.json delete mode 100644 hawkbit-security-core/allure-results/cf3330ae-c5ed-476b-bc99-5d69637548f5-result.json delete mode 100644 hawkbit-security-core/allure-results/cfe76e19-f88d-42e3-bc83-eaf1533d2c54-result.json delete mode 100644 hawkbit-security-core/allure-results/d0b4a60e-f92b-4663-acbc-0e68b5743fd7-result.json delete mode 100644 hawkbit-security-core/allure-results/d1188494-a7af-4bfd-895f-19765e4d81bc-container.json delete mode 100644 hawkbit-security-core/allure-results/d1335aae-80b3-4657-9336-5e3f06d11772-container.json delete mode 100644 hawkbit-security-core/allure-results/d1b3bb95-8331-4c1e-9316-1d16a599650a-container.json delete mode 100644 hawkbit-security-core/allure-results/d252e357-a7e2-4cf2-8ba2-67638cc7841e-result.json delete mode 100644 hawkbit-security-core/allure-results/d300f51f-beee-42d0-a6bb-050de2fd2dac-container.json delete mode 100644 hawkbit-security-core/allure-results/d3612235-33ae-4bc0-ab03-f0e081ed2229-container.json delete mode 100644 hawkbit-security-core/allure-results/d41734d7-90c1-4b32-ab87-34d3bf6ffdf7-container.json delete mode 100644 hawkbit-security-core/allure-results/d4f5378c-2507-4a44-90c4-3b6540cda847-container.json delete mode 100644 hawkbit-security-core/allure-results/d532646e-3352-4896-8cce-1428a1d75998-container.json delete mode 100644 hawkbit-security-core/allure-results/d6556d50-6dc2-4051-8e33-8e4a00ca62dc-result.json delete mode 100644 hawkbit-security-core/allure-results/d7be1fa4-0452-4960-bada-b6457976e383-result.json delete mode 100644 hawkbit-security-core/allure-results/ddb7b828-c0f5-4861-b1a0-b5acab5bdea6-container.json delete mode 100644 hawkbit-security-core/allure-results/e08511dc-4e63-4498-b3bc-5bff411c4efa-container.json delete mode 100644 hawkbit-security-core/allure-results/e2318b7f-dd92-43c4-b975-b145913db907-result.json delete mode 100644 hawkbit-security-core/allure-results/e2501d8d-ae91-4365-a883-65c121d5a6f0-result.json delete mode 100644 hawkbit-security-core/allure-results/e3ef6b81-a794-42c3-bfc3-0e657da47624-result.json delete mode 100644 hawkbit-security-core/allure-results/e4b1797f-8343-4732-98c5-38abbd92797a-result.json delete mode 100644 hawkbit-security-core/allure-results/e506e23a-e803-4870-9df8-1c589a708f5c-container.json delete mode 100644 hawkbit-security-core/allure-results/e78e1d4e-536a-474a-b31d-b931334d94a7-result.json delete mode 100644 hawkbit-security-core/allure-results/e8c23634-1884-4026-bcc1-b57c5368e48f-container.json delete mode 100644 hawkbit-security-core/allure-results/e9929cad-232b-4090-a4e3-3d4a8363bac7-container.json delete mode 100644 hawkbit-security-core/allure-results/e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d-result.json delete mode 100644 hawkbit-security-core/allure-results/ea796ea6-e461-42bd-84c4-86af1971750c-result.json delete mode 100644 hawkbit-security-core/allure-results/ec5b27d8-1b67-4e6b-b18d-61bd7c9aee3f-container.json delete mode 100644 hawkbit-security-core/allure-results/f328f15b-c86c-41fd-a251-8fe9b2c07475-container.json delete mode 100644 hawkbit-security-core/allure-results/f8509304-24a5-446d-baf3-389b875541ae-container.json delete mode 100644 hawkbit-security-core/allure-results/f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4-result.json delete mode 100644 hawkbit-security-core/allure-results/f9451670-007e-48c3-9b5c-2e041d65209b-container.json delete mode 100644 hawkbit-security-core/allure-results/fa723d6b-c258-43b2-9cfd-61c0588448f5-result.json delete mode 100644 hawkbit-security-core/allure-results/fc185157-9b99-47e2-bfa4-d673364346c1-container.json delete mode 100644 hawkbit-security-core/allure-results/fe89ca1a-1724-4cd8-a67c-3b1803307e0c-container.json delete mode 100644 hawkbit-security-core/allure-results/ff3fcabe-affd-4572-9ab8-11b7c3fc3144-container.json diff --git a/.gitignore b/.gitignore index 15d3de490..80b1e9e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ tmp .classpath target !hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target -.allure .vscode .springbeans .metadata diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7942085e..af1370a67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,15 +42,13 @@ So we kindly ask contributors: ### Test documentation -Please document the test cases that you contribute by means of [Allure](https://docs.qameta.io/allure/) annotations and -proper test method naming. - -All test classes are documented with [Allure's](https://docs.qameta.io/allure/#_behaviours_mapping) **@Feature** and * -*@Story** annotations in the following format: +You could document the test cases using the following format: ```java -@Feature("TEST_TYPE - HAWKBIT_COMPONENT") -@Story("Test class description") +/** + * Feature: TEST_TYPE - HAWKBIT_COMPONENT
+ * Story: Test class description + */ ``` Test types are: @@ -69,14 +67,6 @@ Examples for hawkBit components: * Repository * Security -```java -@Feature("Component Tests - Management API") -@Story("Distribution Set Type Resource") -``` - -In addition all test method's name describes in **camel case** what the test is all about and has in addition a long -description in Allures **@Description** annotation. - ## Legal considerations for your contribution Before your contribution can be accepted by the project team contributors must diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java index a48c12940..0593dc522 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java @@ -11,27 +11,28 @@ package org.eclipse.hawkbit.artifact.repository.urlhandler; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Artifact URL Handler") -@Story("Base62 Utility tests") +/** + * Feature: Unit Tests - Artifact URL Handler
+ * Story: Base62 Utility tests + */ class Base62UtilTest { - @Test - @Description("Convert Base10 numbers to Base62 ASCII strings.") - void fromBase10() { + /** + * Convert Base10 numbers to Base62 ASCII strings. + */ + @Test void fromBase10() { assertThat(Base62Util.fromBase10(0L)).isEqualTo("0"); assertThat(Base62Util.fromBase10(11L)).isEqualTo("B"); assertThat(Base62Util.fromBase10(36L)).isEqualTo("a"); assertThat(Base62Util.fromBase10(999L)).isEqualTo("G7"); } - @Test - @Description("Convert Base62 ASCII strings to Base10 numbers.") - void toBase10() { + /** + * Convert Base62 ASCII strings to Base10 numbers. + */ + @Test void toBase10() { assertThat(Base62Util.toBase10("0")).isZero(); assertThat(Base62Util.toBase10("B")).isEqualTo(11); assertThat(Base62Util.toBase10("a")).isEqualTo(36L); diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java index 053fb8960..0f5f8d18b 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java @@ -15,9 +15,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol; import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData; import org.junit.jupiter.api.BeforeEach; @@ -27,9 +24,10 @@ import org.mockito.junit.jupiter.MockitoExtension; /** * Tests for creating urls to download artifacts. + *

+ * Feature: Unit Tests - Artifact URL Handler
+ * Story: Test to generate the artifact download URL */ -@Feature("Unit Tests - Artifact URL Handler") -@Story("Test to generate the artifact download URL") @ExtendWith(MockitoExtension.class) class PropertyBasedArtifactUrlHandlerTest { @@ -61,9 +59,10 @@ class PropertyBasedArtifactUrlHandlerTest { urlHandlerUnderTest = new PropertyBasedArtifactUrlHandler(properties, ""); } - @Test - @Description("Tests the generation of http download url.") - void urlGenerationWithDefaultConfiguration() { + /** + * Tests the generation of http download url. + */ + @Test void urlGenerationWithDefaultConfiguration() { properties.getProtocols().put("download-http", new UrlProtocol()); final List ddiUrls = urlHandlerUnderTest.getUrls(placeHolder, ApiType.DDI); @@ -75,9 +74,10 @@ class PropertyBasedArtifactUrlHandlerTest { .isEqualTo(urlHandlerUnderTest.getUrls(placeHolder, ApiType.DMF)); } - @Test - @Description("Tests the generation of custom download url with a CoAP example that supports DMF only.") - void urlGenerationWithCustomConfiguration() { + /** + * Tests the generation of custom download url with a CoAP example that supports DMF only. + */ + @Test void urlGenerationWithCustomConfiguration() { final UrlProtocol proto = new UrlProtocol(); proto.setIp("127.0.0.1"); proto.setPort(5683); @@ -94,9 +94,10 @@ class PropertyBasedArtifactUrlHandlerTest { "coap://127.0.0.1:5683/fw/" + TENANT + "/" + CONTROLLER_ID + "/sha1/" + SHA1HASH)); } - @Test - @Description("Tests the generation of custom download url using Base62 references with a CoAP example that supports DMF only.") - void urlGenerationWithCustomShortConfiguration() { + /** + * Tests the generation of custom download url using Base62 references with a CoAP example that supports DMF only. + */ + @Test void urlGenerationWithCustomShortConfiguration() { final UrlProtocol proto = new UrlProtocol(); proto.setIp("127.0.0.1"); proto.setPort(5683); @@ -113,9 +114,10 @@ class PropertyBasedArtifactUrlHandlerTest { TEST_PROTO + "://127.0.0.1:5683/fws/" + TENANT + "/" + TARGET_ID_BASE62 + "/" + ARTIFACT_ID_BASE62)); } - @Test - @Description("Verifies that the full qualified host of the statically defined hostname is replaced with the host of the request.") - void urlGenerationWithHostFromRequest() throws URISyntaxException { + /** + * Verifies that the full qualified host of the statically defined hostname is replaced with the host of the request. + */ + @Test void urlGenerationWithHostFromRequest() throws URISyntaxException { final String testHost = "ddi.host.com"; final UrlProtocol proto = new UrlProtocol(); @@ -133,9 +135,10 @@ class PropertyBasedArtifactUrlHandlerTest { TEST_PROTO + "://" + testHost + ":5683/fws/" + TENANT + "/" + TARGET_ID_BASE62 + "/" + ARTIFACT_ID_BASE62)); } - @Test - @Description("Verifies that the protocol of the statically defined hostname is replaced with the protocol of the request.") - void urlGenerationWithProtocolFromRequest() throws URISyntaxException { + /** + * Verifies that the protocol of the statically defined hostname is replaced with the protocol of the request. + */ + @Test void urlGenerationWithProtocolFromRequest() throws URISyntaxException { final String testHost = "ddi.host.com"; final UrlProtocol proto = new UrlProtocol(); @@ -148,9 +151,10 @@ class PropertyBasedArtifactUrlHandlerTest { "https://localhost:8080/fws/" + TENANT + "/" + TARGET_ID_BASE62 + "/" + ARTIFACT_ID_BASE62)); } - @Test - @Description("Verifies that the port of the statically defined hostname is replaced with the port of the request.") - void urlGenerationWithPortFromRequest() throws URISyntaxException { + /** + * Verifies that the port of the statically defined hostname is replaced with the port of the request. + */ + @Test void urlGenerationWithPortFromRequest() throws URISyntaxException { final UrlProtocol proto = new UrlProtocol(); proto.setRef("{protocol}://{hostname}:{portRequest}/{tenant}/controller/v1/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}"); @@ -169,9 +173,10 @@ class PropertyBasedArtifactUrlHandlerTest { CONTROLLER_ID + "/softwaremodules/" + SOFTWARE_MODULE_ID + "/artifacts/" + FILENAME_ENCODE)); } - @Test - @Description("Verifies that if default protocol port in request is used then url is returned without port") - void urlGenerationWithPortFromRequestForHttps() throws URISyntaxException { + /** + * Verifies that if default protocol port in request is used then url is returned without port + */ + @Test void urlGenerationWithPortFromRequestForHttps() throws URISyntaxException { final String protocol = "https"; final UrlProtocol proto = new UrlProtocol(); proto.setRef("{protocolRequest}://{hostnameRequest}:{portRequest}/{tenant}/controller/v1/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}"); @@ -187,9 +192,10 @@ class PropertyBasedArtifactUrlHandlerTest { } - @Test - @Description("Verifies that the domain of the statically defined hostname is replaced with the domain of the request.") - void urlGenerationWithDomainFromRequest() throws URISyntaxException { + /** + * Verifies that the domain of the statically defined hostname is replaced with the domain of the request. + */ + @Test void urlGenerationWithDomainFromRequest() throws URISyntaxException { final UrlProtocol proto = new UrlProtocol(); proto.setHostname("host.bumlux.net"); proto.setRef("{protocol}://{domainRequest}/{tenant}/controller/v1/{controllerId}/softwaremodules/{softwareModuleId}/artifacts/{artifactFileName}"); diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java index e2b7c3b29..644dac240 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java @@ -11,13 +11,12 @@ package org.eclipse.hawkbit.artifact.repository.urlhandler; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Artifact URL Handler") -@Story("URL placeholder tests") +/** + * Feature: Unit Tests - Artifact URL Handler
+ * Story: URL placeholder tests + */ class URLPlaceholderTest { private final URLPlaceholder.SoftwareData softwareData; @@ -28,9 +27,10 @@ class URLPlaceholderTest { this.placeholder = new URLPlaceholder("SuperCorp", 123L, "Super-1", 1L, softwareData); } - @Test - @Description("Same object should be equal") - // Exception squid:S5785 - JUnit assertTrue/assertFalse should be simplified to the corresponding dedicated assertion + /** + * Same object should be equal + */ + @Test // Exception squid:S5785 - JUnit assertTrue/assertFalse should be simplified to the corresponding dedicated assertion // Need to test the equals method and need to bypass magic logic in utility classes @SuppressWarnings({ "squid:S5838" }) void sameObjectShouldBeEqual() { @@ -38,9 +38,10 @@ class URLPlaceholderTest { assertThat(placeholder.equals(placeholder)).isTrue(); } - @Test - @Description("Different object should not be equal") - @SuppressWarnings({ "squid:S5838" }) + /** + * Different object should not be equal + */ + @Test @SuppressWarnings({ "squid:S5838" }) void differentObjectShouldNotBeEqual() { final URLPlaceholder.SoftwareData softwareData2 = new URLPlaceholder.SoftwareData(2L, "file.txt", 123L, "someHash123"); final URLPlaceholder placeholder2 = new URLPlaceholder("SuperCorp", 123L, "Super-2", 2L, softwareData2); @@ -53,18 +54,20 @@ class URLPlaceholderTest { assertThat(placeholder.equals(placeholderWithOtherSoftwareData)).isFalse(); } - @Test - @Description("Different objects with same properties should be equal") - void differentObjectsWithSamePropertiesShouldBeEqual() { + /** + * Different objects with same properties should be equal + */ + @Test void differentObjectsWithSamePropertiesShouldBeEqual() { final URLPlaceholder placeholderWithSameProperties = new URLPlaceholder(placeholder.getTenant(), placeholder.getTenantId(), placeholder.getControllerId(), placeholder.getTargetId(), softwareData); assertThat(placeholder).isEqualTo(placeholderWithSameProperties); assertThat(placeholderWithSameProperties).isEqualTo(placeholder); } - @Test - @Description("Should not equal null") - // Exception squid:S5785 - JUnit assertTrue/assertFalse should be simplified to + /** + * Should not equal null + */ + @Test // Exception squid:S5785 - JUnit assertTrue/assertFalse should be simplified to // the corresponding dedicated assertion // Need to test the equals method and need to bypass magic logic in utility // classes @@ -74,9 +77,10 @@ class URLPlaceholderTest { assertThat(softwareData.equals(null)).isFalse(); } - @Test - @Description("HashCode should not change") - void hashCodeShouldNotChange() { + /** + * HashCode should not change + */ + @Test void hashCodeShouldNotChange() { final URLPlaceholder placeholderWithSameProperties = new URLPlaceholder(placeholder.getTenant(), placeholder.getTenantId(), placeholder.getControllerId(), placeholder.getTargetId(), softwareData); assertThat(placeholder).hasSameHashCodeAs(placeholder).hasSameHashCodeAs(placeholderWithSameProperties); diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java index 5bd6a73e2..c7d78b70d 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java @@ -16,9 +16,6 @@ import java.io.File; import java.io.IOException; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -29,8 +26,10 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @Slf4j -@Feature("Unit Tests - Artifact File System Repository") -@Story("Test storing artifact binaries in the file-system") +/** + * Feature: Unit Tests - Artifact File System Repository
+ * Story: Test storing artifact binaries in the file-system + */ class ArtifactFilesystemRepositoryTest { private static final String TENANT = "test_tenant"; @@ -57,9 +56,10 @@ class ArtifactFilesystemRepositoryTest { } } - @Test - @Description("Verifies that an artifact can be successfully stored in the file-system repository") - void storeSuccessfully() throws IOException { + /** + * Verifies that an artifact can be successfully stored in the file-system repository + */ + @Test void storeSuccessfully() throws IOException { final byte[] fileContent = randomBytes(); final AbstractDbArtifact artifact = storeRandomArtifact(fileContent); @@ -68,36 +68,40 @@ class ArtifactFilesystemRepositoryTest { assertThat(readContent).isEqualTo(fileContent); } - @Test - @Description("Verifies that an artifact can be successfully stored in the file-system repository") - void getStoredArtifactBasedOnSHA1Hash() throws IOException { + /** + * Verifies that an artifact can be successfully stored in the file-system repository + */ + @Test void getStoredArtifactBasedOnSHA1Hash() throws IOException { final byte[] fileContent = randomBytes(); final AbstractDbArtifact artifact = storeRandomArtifact(fileContent); assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNotNull(); } - @Test - @Description("Verifies that an artifact can be deleted in the file-system repository") - void deleteStoredArtifactBySHA1Hash() throws IOException { + /** + * Verifies that an artifact can be deleted in the file-system repository + */ + @Test void deleteStoredArtifactBySHA1Hash() throws IOException { final AbstractDbArtifact artifact = storeRandomArtifact(randomBytes()); artifactFilesystemRepository.deleteBySha1(TENANT, artifact.getHashes().getSha1()); assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNull(); } - @Test - @Description("Verifies that all artifacts of a tenant can be deleted in the file-system repository") - void deleteStoredArtifactOfTenant() throws IOException { + /** + * Verifies that all artifacts of a tenant can be deleted in the file-system repository + */ + @Test void deleteStoredArtifactOfTenant() throws IOException { final AbstractDbArtifact artifact = storeRandomArtifact(randomBytes()); artifactFilesystemRepository.deleteByTenant(TENANT); assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNull(); } - @Test - @Description("Verifies that an artifact which does not exists is deleted quietly in the file-system repository") - void deleteArtifactWhichDoesNotExistsBySHA1HashWithoutException() throws IOException { + /** + * Verifies that an artifact which does not exists is deleted quietly in the file-system repository + */ + @Test void deleteArtifactWhichDoesNotExistsBySHA1HashWithoutException() throws IOException { try { artifactFilesystemRepository.deleteBySha1(TENANT, "sha1HashWhichDoesNotExists"); } catch (final Exception e) { diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java index 122a462ee..6dbb44fca 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java @@ -16,20 +16,20 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.apache.commons.io.IOUtils; import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Artifact File System Repository") -@Story("Test storing artifact binaries in the file-system") +/** + * Feature: Unit Tests - Artifact File System Repository
+ * Story: Test storing artifact binaries in the file-system + */ class ArtifactFilesystemTest { - @Test - @Description("Verifies that an exception is thrown on opening an InputStream when file does not exists") - void getInputStreamOfNonExistingFileThrowsException() { + /** + * Verifies that an exception is thrown on opening an InputStream when file does not exists + */ + @Test void getInputStreamOfNonExistingFileThrowsException() { final File file = new File("fileWhichTotalDoesNotExists"); final ArtifactFilesystem underTest = new ArtifactFilesystem( file, "fileWhichTotalDoesNotExists", @@ -39,9 +39,10 @@ class ArtifactFilesystemTest { .hasCauseInstanceOf(FileNotFoundException.class); } - @Test - @Description("Verifies that an InputStream can be opened if file exists") - void getInputStreamOfExistingFile() throws IOException { + /** + * Verifies that an InputStream can be opened if file exists + */ + @Test void getInputStreamOfExistingFile() throws IOException { final ArtifactFilesystem underTest = new ArtifactFilesystem( AbstractArtifactRepository.createTempFile(false), ArtifactFilesystemTest.class.getSimpleName(), new DbArtifactHash("1", "2", "3"), 0L, null); diff --git a/hawkbit-core/allure-results/06b4b435-29d7-4dd0-bcb6-b2ed361c31e2-container.json b/hawkbit-core/allure-results/06b4b435-29d7-4dd0-bcb6-b2ed361c31e2-container.json deleted file mode 100644 index 1d0119bfa..000000000 --- a/hawkbit-core/allure-results/06b4b435-29d7-4dd0-bcb6-b2ed361c31e2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"06b4b435-29d7-4dd0-bcb6-b2ed361c31e2","name":"FileNameFieldsTest","children":["d701f914-7aff-400e-8230-a00f1339827c"],"befores":[],"afters":[],"start":1750415118826,"stop":1750415119036} \ No newline at end of file diff --git a/hawkbit-core/allure-results/1e4882c6-e0fe-4cc1-ab20-30344dfd7f6c-container.json b/hawkbit-core/allure-results/1e4882c6-e0fe-4cc1-ab20-30344dfd7f6c-container.json deleted file mode 100644 index b9dfe6ff6..000000000 --- a/hawkbit-core/allure-results/1e4882c6-e0fe-4cc1-ab20-30344dfd7f6c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1e4882c6-e0fe-4cc1-ab20-30344dfd7f6c","name":"FileNameFieldsTest","children":["597ffb13-728c-4020-9afd-e776432afb0b"],"befores":[],"afters":[],"start":1750414146349,"stop":1750414146558} \ No newline at end of file diff --git a/hawkbit-core/allure-results/1eb43d00-6013-4be4-8227-85e47d019d3c-container.json b/hawkbit-core/allure-results/1eb43d00-6013-4be4-8227-85e47d019d3c-container.json deleted file mode 100644 index c59209a85..000000000 --- a/hawkbit-core/allure-results/1eb43d00-6013-4be4-8227-85e47d019d3c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1eb43d00-6013-4be4-8227-85e47d019d3c","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["43d8b58c-e102-4ac5-9971-edfe8accda95"],"befores":[],"afters":[],"start":1750415256630,"stop":1750415256926} \ No newline at end of file diff --git a/hawkbit-core/allure-results/1f78aaf3-6314-4839-8931-32fd25ee40a2-result.json b/hawkbit-core/allure-results/1f78aaf3-6314-4839-8931-32fd25ee40a2-result.json deleted file mode 100644 index d34111c0f..000000000 --- a/hawkbit-core/allure-results/1f78aaf3-6314-4839-8931-32fd25ee40a2-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1f78aaf3-6314-4839-8931-32fd25ee40a2","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26175@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414575060,"stop":1750414575211} \ No newline at end of file diff --git a/hawkbit-core/allure-results/20e2a037-9c51-49d4-87a2-83439f64c3f5-container.json b/hawkbit-core/allure-results/20e2a037-9c51-49d4-87a2-83439f64c3f5-container.json deleted file mode 100644 index 6a9e8e700..000000000 --- a/hawkbit-core/allure-results/20e2a037-9c51-49d4-87a2-83439f64c3f5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"20e2a037-9c51-49d4-87a2-83439f64c3f5","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["913eecd1-1800-4cd4-9c59-5094f1221293"],"befores":[],"afters":[],"start":1750414016526,"stop":1750414016717} \ No newline at end of file diff --git a/hawkbit-core/allure-results/236f34e7-42a3-4022-a827-d28eee4739bd-container.json b/hawkbit-core/allure-results/236f34e7-42a3-4022-a827-d28eee4739bd-container.json deleted file mode 100644 index 4161eac43..000000000 --- a/hawkbit-core/allure-results/236f34e7-42a3-4022-a827-d28eee4739bd-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"236f34e7-42a3-4022-a827-d28eee4739bd","name":"FileNameFieldsTest","children":["bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd"],"befores":[],"afters":[],"start":1750414723330,"stop":1750414723507} \ No newline at end of file diff --git a/hawkbit-core/allure-results/259e6e51-7aaf-4ae2-8eb4-0ccc2876d81f-container.json b/hawkbit-core/allure-results/259e6e51-7aaf-4ae2-8eb4-0ccc2876d81f-container.json deleted file mode 100644 index 202bf967f..000000000 --- a/hawkbit-core/allure-results/259e6e51-7aaf-4ae2-8eb4-0ccc2876d81f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"259e6e51-7aaf-4ae2-8eb4-0ccc2876d81f","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["e82046fe-fd36-4dc0-981e-95e743b8d086"],"befores":[],"afters":[],"start":1750414349120,"stop":1750414349298} \ No newline at end of file diff --git a/hawkbit-core/allure-results/26b493b3-066c-4930-a6ab-ffebee1f01c0-container.json b/hawkbit-core/allure-results/26b493b3-066c-4930-a6ab-ffebee1f01c0-container.json deleted file mode 100644 index 3c5c0846f..000000000 --- a/hawkbit-core/allure-results/26b493b3-066c-4930-a6ab-ffebee1f01c0-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"26b493b3-066c-4930-a6ab-ffebee1f01c0","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["3b629131-9a32-4374-b928-137aca4f2f30"],"befores":[],"afters":[],"start":1750414971559,"stop":1750414971740} \ No newline at end of file diff --git a/hawkbit-core/allure-results/299732f9-e387-41ee-9f65-b7071c39dcc3-container.json b/hawkbit-core/allure-results/299732f9-e387-41ee-9f65-b7071c39dcc3-container.json deleted file mode 100644 index 31251284e..000000000 --- a/hawkbit-core/allure-results/299732f9-e387-41ee-9f65-b7071c39dcc3-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"299732f9-e387-41ee-9f65-b7071c39dcc3","name":"FileNameFieldsTest","children":["1f78aaf3-6314-4839-8931-32fd25ee40a2"],"befores":[],"afters":[],"start":1750414575036,"stop":1750414575236} \ No newline at end of file diff --git a/hawkbit-core/allure-results/3393d874-79c5-4b30-8098-6be0f22b98b8-container.json b/hawkbit-core/allure-results/3393d874-79c5-4b30-8098-6be0f22b98b8-container.json deleted file mode 100644 index fdf6e7ac6..000000000 --- a/hawkbit-core/allure-results/3393d874-79c5-4b30-8098-6be0f22b98b8-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3393d874-79c5-4b30-8098-6be0f22b98b8","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["c7d19de8-5368-401c-9297-8c6c7bbf830e"],"befores":[],"afters":[],"start":1750415195491,"stop":1750415195674} \ No newline at end of file diff --git a/hawkbit-core/allure-results/34038e21-ccba-4596-92af-8c1856ccc1e2-container.json b/hawkbit-core/allure-results/34038e21-ccba-4596-92af-8c1856ccc1e2-container.json deleted file mode 100644 index 62926ec1c..000000000 --- a/hawkbit-core/allure-results/34038e21-ccba-4596-92af-8c1856ccc1e2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"34038e21-ccba-4596-92af-8c1856ccc1e2","name":"FileNameFieldsTest","children":["5c548055-7762-4fcb-9795-5aaafe5329e2"],"befores":[],"afters":[],"start":1750414415618,"stop":1750414415801} \ No newline at end of file diff --git a/hawkbit-core/allure-results/369f3516-266b-46ac-a730-c152c6afcf7a-container.json b/hawkbit-core/allure-results/369f3516-266b-46ac-a730-c152c6afcf7a-container.json deleted file mode 100644 index 9baef3fb6..000000000 --- a/hawkbit-core/allure-results/369f3516-266b-46ac-a730-c152c6afcf7a-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"369f3516-266b-46ac-a730-c152c6afcf7a","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["b3d07773-b904-4e05-9b16-bdd986547be7"],"befores":[],"afters":[],"start":1750415892802,"stop":1750415893121} \ No newline at end of file diff --git a/hawkbit-core/allure-results/39f0b93a-754c-4948-8b59-056528a83d1c-container.json b/hawkbit-core/allure-results/39f0b93a-754c-4948-8b59-056528a83d1c-container.json deleted file mode 100644 index 298b0a871..000000000 --- a/hawkbit-core/allure-results/39f0b93a-754c-4948-8b59-056528a83d1c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"39f0b93a-754c-4948-8b59-056528a83d1c","name":"FileNameFieldsTest","children":["e82046fe-fd36-4dc0-981e-95e743b8d086"],"befores":[],"afters":[],"start":1750414349111,"stop":1750414349303} \ No newline at end of file diff --git a/hawkbit-core/allure-results/3b629131-9a32-4374-b928-137aca4f2f30-result.json b/hawkbit-core/allure-results/3b629131-9a32-4374-b928-137aca4f2f30-result.json deleted file mode 100644 index d29593b64..000000000 --- a/hawkbit-core/allure-results/3b629131-9a32-4374-b928-137aca4f2f30-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3b629131-9a32-4374-b928-137aca4f2f30","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27866@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414971573,"stop":1750414971721} \ No newline at end of file diff --git a/hawkbit-core/allure-results/3eb09005-eb9f-4349-916e-70229f574807-container.json b/hawkbit-core/allure-results/3eb09005-eb9f-4349-916e-70229f574807-container.json deleted file mode 100644 index c877755b5..000000000 --- a/hawkbit-core/allure-results/3eb09005-eb9f-4349-916e-70229f574807-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3eb09005-eb9f-4349-916e-70229f574807","name":"FileNameFieldsTest","children":["3b629131-9a32-4374-b928-137aca4f2f30"],"befores":[],"afters":[],"start":1750414971551,"stop":1750414971746} \ No newline at end of file diff --git a/hawkbit-core/allure-results/40fbbc60-c9f9-426f-8fc5-597b8d1eccbf-container.json b/hawkbit-core/allure-results/40fbbc60-c9f9-426f-8fc5-597b8d1eccbf-container.json deleted file mode 100644 index df5153edf..000000000 --- a/hawkbit-core/allure-results/40fbbc60-c9f9-426f-8fc5-597b8d1eccbf-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"40fbbc60-c9f9-426f-8fc5-597b8d1eccbf","name":"FileNameFieldsTest","children":["43d8b58c-e102-4ac5-9971-edfe8accda95"],"befores":[],"afters":[],"start":1750415256621,"stop":1750415256932} \ No newline at end of file diff --git a/hawkbit-core/allure-results/43d8b58c-e102-4ac5-9971-edfe8accda95-result.json b/hawkbit-core/allure-results/43d8b58c-e102-4ac5-9971-edfe8accda95-result.json deleted file mode 100644 index 05a97d2be..000000000 --- a/hawkbit-core/allure-results/43d8b58c-e102-4ac5-9971-edfe8accda95-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"43d8b58c-e102-4ac5-9971-edfe8accda95","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29124@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750415256641,"stop":1750415256888} \ No newline at end of file diff --git a/hawkbit-core/allure-results/4b168869-3277-4726-ad64-e84bd2218c37-container.json b/hawkbit-core/allure-results/4b168869-3277-4726-ad64-e84bd2218c37-container.json deleted file mode 100644 index ccc4b0dab..000000000 --- a/hawkbit-core/allure-results/4b168869-3277-4726-ad64-e84bd2218c37-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4b168869-3277-4726-ad64-e84bd2218c37","name":"FileNameFieldsTest","children":["81317a48-2ebf-44ec-a6ee-7e6d7024e1a2"],"befores":[],"afters":[],"start":1750414464506,"stop":1750414464697} \ No newline at end of file diff --git a/hawkbit-core/allure-results/4d398a49-8f1e-4038-9342-a6270abf50f5-container.json b/hawkbit-core/allure-results/4d398a49-8f1e-4038-9342-a6270abf50f5-container.json deleted file mode 100644 index 149d19844..000000000 --- a/hawkbit-core/allure-results/4d398a49-8f1e-4038-9342-a6270abf50f5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4d398a49-8f1e-4038-9342-a6270abf50f5","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["5c548055-7762-4fcb-9795-5aaafe5329e2"],"befores":[],"afters":[],"start":1750414415626,"stop":1750414415795} \ No newline at end of file diff --git a/hawkbit-core/allure-results/597ffb13-728c-4020-9afd-e776432afb0b-result.json b/hawkbit-core/allure-results/597ffb13-728c-4020-9afd-e776432afb0b-result.json deleted file mode 100644 index cca8703c3..000000000 --- a/hawkbit-core/allure-results/597ffb13-728c-4020-9afd-e776432afb0b-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"597ffb13-728c-4020-9afd-e776432afb0b","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"24408@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414146373,"stop":1750414146533} \ No newline at end of file diff --git a/hawkbit-core/allure-results/5b69aea3-f8ca-4017-8db8-f93cec3bab1a-container.json b/hawkbit-core/allure-results/5b69aea3-f8ca-4017-8db8-f93cec3bab1a-container.json deleted file mode 100644 index 7aa543a1d..000000000 --- a/hawkbit-core/allure-results/5b69aea3-f8ca-4017-8db8-f93cec3bab1a-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5b69aea3-f8ca-4017-8db8-f93cec3bab1a","name":"FileNameFieldsTest","children":["c7d19de8-5368-401c-9297-8c6c7bbf830e"],"befores":[],"afters":[],"start":1750415195482,"stop":1750415195679} \ No newline at end of file diff --git a/hawkbit-core/allure-results/5c548055-7762-4fcb-9795-5aaafe5329e2-result.json b/hawkbit-core/allure-results/5c548055-7762-4fcb-9795-5aaafe5329e2-result.json deleted file mode 100644 index 35c362874..000000000 --- a/hawkbit-core/allure-results/5c548055-7762-4fcb-9795-5aaafe5329e2-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5c548055-7762-4fcb-9795-5aaafe5329e2","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25467@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414415639,"stop":1750414415776} \ No newline at end of file diff --git a/hawkbit-core/allure-results/68e6b06c-dfd1-48bf-b383-f83cffa9411e-container.json b/hawkbit-core/allure-results/68e6b06c-dfd1-48bf-b383-f83cffa9411e-container.json deleted file mode 100644 index 09f84d3c9..000000000 --- a/hawkbit-core/allure-results/68e6b06c-dfd1-48bf-b383-f83cffa9411e-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"68e6b06c-dfd1-48bf-b383-f83cffa9411e","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["81317a48-2ebf-44ec-a6ee-7e6d7024e1a2"],"befores":[],"afters":[],"start":1750414464515,"stop":1750414464691} \ No newline at end of file diff --git a/hawkbit-core/allure-results/74aad84d-bfdd-4c01-aa36-f68b1c09a2fd-container.json b/hawkbit-core/allure-results/74aad84d-bfdd-4c01-aa36-f68b1c09a2fd-container.json deleted file mode 100644 index bf93677a2..000000000 --- a/hawkbit-core/allure-results/74aad84d-bfdd-4c01-aa36-f68b1c09a2fd-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"74aad84d-bfdd-4c01-aa36-f68b1c09a2fd","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["1f78aaf3-6314-4839-8931-32fd25ee40a2"],"befores":[],"afters":[],"start":1750414575045,"stop":1750414575231} \ No newline at end of file diff --git a/hawkbit-core/allure-results/81317a48-2ebf-44ec-a6ee-7e6d7024e1a2-result.json b/hawkbit-core/allure-results/81317a48-2ebf-44ec-a6ee-7e6d7024e1a2-result.json deleted file mode 100644 index 132fcdce3..000000000 --- a/hawkbit-core/allure-results/81317a48-2ebf-44ec-a6ee-7e6d7024e1a2-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"81317a48-2ebf-44ec-a6ee-7e6d7024e1a2","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25725@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414464529,"stop":1750414464672} \ No newline at end of file diff --git a/hawkbit-core/allure-results/85b10456-f9c4-476e-940e-1a4d6ae96684-container.json b/hawkbit-core/allure-results/85b10456-f9c4-476e-940e-1a4d6ae96684-container.json deleted file mode 100644 index 51dbe8333..000000000 --- a/hawkbit-core/allure-results/85b10456-f9c4-476e-940e-1a4d6ae96684-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"85b10456-f9c4-476e-940e-1a4d6ae96684","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["597ffb13-728c-4020-9afd-e776432afb0b"],"befores":[],"afters":[],"start":1750414146356,"stop":1750414146552} \ No newline at end of file diff --git a/hawkbit-core/allure-results/8ca7e456-37f2-4cae-a692-ccdda74fb1d1-container.json b/hawkbit-core/allure-results/8ca7e456-37f2-4cae-a692-ccdda74fb1d1-container.json deleted file mode 100644 index 9e4217e2f..000000000 --- a/hawkbit-core/allure-results/8ca7e456-37f2-4cae-a692-ccdda74fb1d1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8ca7e456-37f2-4cae-a692-ccdda74fb1d1","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd"],"befores":[],"afters":[],"start":1750414723338,"stop":1750414723502} \ No newline at end of file diff --git a/hawkbit-core/allure-results/913eecd1-1800-4cd4-9c59-5094f1221293-result.json b/hawkbit-core/allure-results/913eecd1-1800-4cd4-9c59-5094f1221293-result.json deleted file mode 100644 index 051d4f7cf..000000000 --- a/hawkbit-core/allure-results/913eecd1-1800-4cd4-9c59-5094f1221293-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"913eecd1-1800-4cd4-9c59-5094f1221293","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"23930@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414016543,"stop":1750414016696} \ No newline at end of file diff --git a/hawkbit-core/allure-results/92653284-976b-412e-a112-7e96c3901dee-container.json b/hawkbit-core/allure-results/92653284-976b-412e-a112-7e96c3901dee-container.json deleted file mode 100644 index c6643cc56..000000000 --- a/hawkbit-core/allure-results/92653284-976b-412e-a112-7e96c3901dee-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"92653284-976b-412e-a112-7e96c3901dee","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["9829198c-640d-4164-9557-cad7ac0832da"],"befores":[],"afters":[],"start":1750415144356,"stop":1750415144551} \ No newline at end of file diff --git a/hawkbit-core/allure-results/93fedcb9-ba6d-4b94-bb29-0e219c3f8604-container.json b/hawkbit-core/allure-results/93fedcb9-ba6d-4b94-bb29-0e219c3f8604-container.json deleted file mode 100644 index 0637bae2a..000000000 --- a/hawkbit-core/allure-results/93fedcb9-ba6d-4b94-bb29-0e219c3f8604-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"93fedcb9-ba6d-4b94-bb29-0e219c3f8604","name":"FileNameFieldsTest","children":["f8b39d47-6a59-4f21-a52c-7c190cb1dfab"],"befores":[],"afters":[],"start":1750414804626,"stop":1750414804826} \ No newline at end of file diff --git a/hawkbit-core/allure-results/9829198c-640d-4164-9557-cad7ac0832da-result.json b/hawkbit-core/allure-results/9829198c-640d-4164-9557-cad7ac0832da-result.json deleted file mode 100644 index dbede57ca..000000000 --- a/hawkbit-core/allure-results/9829198c-640d-4164-9557-cad7ac0832da-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"9829198c-640d-4164-9557-cad7ac0832da","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28593@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750415144374,"stop":1750415144530} \ No newline at end of file diff --git a/hawkbit-core/allure-results/b3d07773-b904-4e05-9b16-bdd986547be7-result.json b/hawkbit-core/allure-results/b3d07773-b904-4e05-9b16-bdd986547be7-result.json deleted file mode 100644 index c9aec1d29..000000000 --- a/hawkbit-core/allure-results/b3d07773-b904-4e05-9b16-bdd986547be7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b3d07773-b904-4e05-9b16-bdd986547be7","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31615@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750415892813,"stop":1750415893086} \ No newline at end of file diff --git a/hawkbit-core/allure-results/bbcef88f-a5d4-44a4-bbb0-71bbf92f66f5-container.json b/hawkbit-core/allure-results/bbcef88f-a5d4-44a4-bbb0-71bbf92f66f5-container.json deleted file mode 100644 index 682290700..000000000 --- a/hawkbit-core/allure-results/bbcef88f-a5d4-44a4-bbb0-71bbf92f66f5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bbcef88f-a5d4-44a4-bbb0-71bbf92f66f5","name":"FileNameFieldsTest","children":["9829198c-640d-4164-9557-cad7ac0832da"],"befores":[],"afters":[],"start":1750415144348,"stop":1750415144557} \ No newline at end of file diff --git a/hawkbit-core/allure-results/bd35f9eb-0abf-4693-a4ab-89a4ef475c03-container.json b/hawkbit-core/allure-results/bd35f9eb-0abf-4693-a4ab-89a4ef475c03-container.json deleted file mode 100644 index 95dc8e0e5..000000000 --- a/hawkbit-core/allure-results/bd35f9eb-0abf-4693-a4ab-89a4ef475c03-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bd35f9eb-0abf-4693-a4ab-89a4ef475c03","name":"FileNameFieldsTest","children":["913eecd1-1800-4cd4-9c59-5094f1221293"],"befores":[],"afters":[],"start":1750414016518,"stop":1750414016723} \ No newline at end of file diff --git a/hawkbit-core/allure-results/bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd-result.json b/hawkbit-core/allure-results/bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd-result.json deleted file mode 100644 index 907facabc..000000000 --- a/hawkbit-core/allure-results/bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bdfb9b69-24d2-4eff-ba3c-1ef30b0519fd","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26751@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414723352,"stop":1750414723483} \ No newline at end of file diff --git a/hawkbit-core/allure-results/c54916fe-169c-435f-9751-0ff0c0c3ede7-container.json b/hawkbit-core/allure-results/c54916fe-169c-435f-9751-0ff0c0c3ede7-container.json deleted file mode 100644 index 5848519f6..000000000 --- a/hawkbit-core/allure-results/c54916fe-169c-435f-9751-0ff0c0c3ede7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c54916fe-169c-435f-9751-0ff0c0c3ede7","name":"FileNameFieldsTest","children":["b3d07773-b904-4e05-9b16-bdd986547be7"],"befores":[],"afters":[],"start":1750415892794,"stop":1750415893127} \ No newline at end of file diff --git a/hawkbit-core/allure-results/c7d19de8-5368-401c-9297-8c6c7bbf830e-result.json b/hawkbit-core/allure-results/c7d19de8-5368-401c-9297-8c6c7bbf830e-result.json deleted file mode 100644 index 5f76c00f9..000000000 --- a/hawkbit-core/allure-results/c7d19de8-5368-401c-9297-8c6c7bbf830e-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c7d19de8-5368-401c-9297-8c6c7bbf830e","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28828@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750415195507,"stop":1750415195655} \ No newline at end of file diff --git a/hawkbit-core/allure-results/cabd9766-d959-4d7d-bb53-541eea388c17-container.json b/hawkbit-core/allure-results/cabd9766-d959-4d7d-bb53-541eea388c17-container.json deleted file mode 100644 index 112e19b9f..000000000 --- a/hawkbit-core/allure-results/cabd9766-d959-4d7d-bb53-541eea388c17-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"cabd9766-d959-4d7d-bb53-541eea388c17","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["e6bd41bd-a706-441a-ada6-e8d141013858"],"befores":[],"afters":[],"start":1750414269854,"stop":1750414270063} \ No newline at end of file diff --git a/hawkbit-core/allure-results/d701f914-7aff-400e-8230-a00f1339827c-result.json b/hawkbit-core/allure-results/d701f914-7aff-400e-8230-a00f1339827c-result.json deleted file mode 100644 index 7e93f239e..000000000 --- a/hawkbit-core/allure-results/d701f914-7aff-400e-8230-a00f1339827c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d701f914-7aff-400e-8230-a00f1339827c","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28442@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750415118850,"stop":1750415119008} \ No newline at end of file diff --git a/hawkbit-core/allure-results/e0062d7c-0b58-485e-a615-1caa49d50682-container.json b/hawkbit-core/allure-results/e0062d7c-0b58-485e-a615-1caa49d50682-container.json deleted file mode 100644 index 29867dbda..000000000 --- a/hawkbit-core/allure-results/e0062d7c-0b58-485e-a615-1caa49d50682-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e0062d7c-0b58-485e-a615-1caa49d50682","name":"FileNameFieldsTest","children":["e6bd41bd-a706-441a-ada6-e8d141013858"],"befores":[],"afters":[],"start":1750414269846,"stop":1750414270068} \ No newline at end of file diff --git a/hawkbit-core/allure-results/e6bd41bd-a706-441a-ada6-e8d141013858-result.json b/hawkbit-core/allure-results/e6bd41bd-a706-441a-ada6-e8d141013858-result.json deleted file mode 100644 index c287676a2..000000000 --- a/hawkbit-core/allure-results/e6bd41bd-a706-441a-ada6-e8d141013858-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e6bd41bd-a706-441a-ada6-e8d141013858","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"24854@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414269868,"stop":1750414270043} \ No newline at end of file diff --git a/hawkbit-core/allure-results/e82046fe-fd36-4dc0-981e-95e743b8d086-result.json b/hawkbit-core/allure-results/e82046fe-fd36-4dc0-981e-95e743b8d086-result.json deleted file mode 100644 index caab8b180..000000000 --- a/hawkbit-core/allure-results/e82046fe-fd36-4dc0-981e-95e743b8d086-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e82046fe-fd36-4dc0-981e-95e743b8d086","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25177@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414349135,"stop":1750414349278} \ No newline at end of file diff --git a/hawkbit-core/allure-results/ef752c83-c849-43f8-88f6-98fec388c199-container.json b/hawkbit-core/allure-results/ef752c83-c849-43f8-88f6-98fec388c199-container.json deleted file mode 100644 index 6cb299102..000000000 --- a/hawkbit-core/allure-results/ef752c83-c849-43f8-88f6-98fec388c199-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ef752c83-c849-43f8-88f6-98fec388c199","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["f8b39d47-6a59-4f21-a52c-7c190cb1dfab"],"befores":[],"afters":[],"start":1750414804633,"stop":1750414804821} \ No newline at end of file diff --git a/hawkbit-core/allure-results/f8b39d47-6a59-4f21-a52c-7c190cb1dfab-result.json b/hawkbit-core/allure-results/f8b39d47-6a59-4f21-a52c-7c190cb1dfab-result.json deleted file mode 100644 index ddeb0575f..000000000 --- a/hawkbit-core/allure-results/f8b39d47-6a59-4f21-a52c-7c190cb1dfab-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"f8b39d47-6a59-4f21-a52c-7c190cb1dfab","historyId":"fa14928b1c8c4668de3f864412a0b0ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]","testCaseName":"repositoryManagementMethodsArePreAuthorizedAnnotated()","fullName":"org.eclipse.hawkbit.repository.FileNameFieldsTest.repositoryManagementMethodsArePreAuthorizedAnnotated","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.repository.FileNameFieldsTest]/[method:repositoryManagementMethodsArePreAuthorizedAnnotated()]"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27237@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testClass","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"},{"name":"testMethod","value":"repositoryManagementMethodsArePreAuthorizedAnnotated"},{"name":"suite","value":"org.eclipse.hawkbit.repository.FileNameFieldsTest"}],"links":[],"name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","status":"passed","stage":"finished","description":"Verifies that fields classes are correctly implemented","steps":[],"attachments":[],"parameters":[],"start":1750414804649,"stop":1750414804801} \ No newline at end of file diff --git a/hawkbit-core/allure-results/fe17f3a0-aa11-4f29-97a0-423d009e546d-container.json b/hawkbit-core/allure-results/fe17f3a0-aa11-4f29-97a0-423d009e546d-container.json deleted file mode 100644 index 0c72cb3dc..000000000 --- a/hawkbit-core/allure-results/fe17f3a0-aa11-4f29-97a0-423d009e546d-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"fe17f3a0-aa11-4f29-97a0-423d009e546d","name":"repositoryManagementMethodsArePreAuthorizedAnnotated()","children":["d701f914-7aff-400e-8230-a00f1339827c"],"befores":[],"afters":[],"start":1750415118833,"stop":1750415119030} \ No newline at end of file diff --git a/hawkbit-core/src/test/java/org/eclipse/hawkbit/repository/FileNameFieldsTest.java b/hawkbit-core/src/test/java/org/eclipse/hawkbit/repository/FileNameFieldsTest.java index 14ca3a024..295cb098c 100644 --- a/hawkbit-core/src/test/java/org/eclipse/hawkbit/repository/FileNameFieldsTest.java +++ b/hawkbit-core/src/test/java/org/eclipse/hawkbit/repository/FileNameFieldsTest.java @@ -16,14 +16,14 @@ import java.util.List; import io.github.classgraph.ClassGraph; import io.github.classgraph.ClassInfo; import io.github.classgraph.ScanResult; -import io.qameta.allure.Description; import org.junit.jupiter.api.Test; class FileNameFieldsTest { - @Test - @Description("Verifies that fields classes are correctly implemented") - @SuppressWarnings("unchecked") + /** + * Verifies that fields classes are correctly implemented + */ + @Test @SuppressWarnings("unchecked") void repositoryManagementMethodsArePreAuthorizedAnnotated() { final String packageName = getClass().getPackage().getName(); try (final ScanResult scanResult = new ClassGraph().acceptPackages(packageName).scan()) { diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedbackTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedbackTest.java index 4743adc38..4417bec46 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedbackTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedbackTest.java @@ -19,23 +19,22 @@ import java.util.Collections; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serialization of DDI api model 'DdiActionFeedback' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serialization of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serialization of DDI api Models") class DdiActionFeedbackTest { private final ObjectMapper mapper = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model with minimal payload") - void shouldSerializeAndDeserializeObjectWithoutOptionalValues() throws IOException { + /** + * Verify the correct serialization and deserialization of the model with minimal payload + */ + @Test void shouldSerializeAndDeserializeObjectWithoutOptionalValues() throws IOException { // Setup final DdiStatus ddiStatus = new DdiStatus(DdiStatus.ExecutionStatus.CLOSED, null, null, Collections.emptyList()); final DdiActionFeedback ddiActionFeedback = new DdiActionFeedback(ddiStatus); @@ -48,9 +47,10 @@ class DdiActionFeedbackTest { assertThat(deserializedDdiActionFeedback.getStatus()).hasToString(ddiStatus.toString()); } - @Test - @Description("Verify the correct serialization and deserialization of the model with all values provided") - void shouldSerializeAndDeserializeObjectWithOptionalValues() throws IOException { + /** + * Verify the correct serialization and deserialization of the model with all values provided + */ + @Test void shouldSerializeAndDeserializeObjectWithOptionalValues() throws IOException { // Setup final Long timestamp = System.currentTimeMillis(); final DdiResult ddiResult = new DdiResult(DdiResult.FinalResult.SUCCESS, new DdiProgress(10, 10)); @@ -65,9 +65,10 @@ class DdiActionFeedbackTest { assertThat(deserializedDdiActionFeedback.getStatus()).hasToString(ddiStatus.toString()); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiActionFeedback = """ { @@ -83,9 +84,10 @@ class DdiActionFeedbackTest { () -> mapper.readValue(serializedDdiActionFeedback, DdiActionFeedback.class)); } - @Test - @Description("Verify that deserialization works if optional fields are not parsed") - void shouldConvertItWithoutOptionalFieldTimestamp() throws JsonProcessingException { + /** + * Verify that deserialization works if optional fields are not parsed + */ + @Test void shouldConvertItWithoutOptionalFieldTimestamp() throws JsonProcessingException { // Setup final String serializedDdiActionFeedback = """ { diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistoryTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistoryTest.java index 5693fefa1..49731cb7f 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistoryTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiActionHistoryTest.java @@ -19,23 +19,22 @@ import java.util.List; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiActionHistory' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiActionHistoryTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String actionStatus = "TestAction"; final List messages = Arrays.asList("Action status message 1", "Action status message 2"); @@ -48,9 +47,10 @@ class DdiActionHistoryTest { assertThat(deserializedDdiActionHistory.toString()).contains(actionStatus, messages.get(0), messages.get(1)); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiActionHistory = """ { @@ -64,9 +64,10 @@ class DdiActionHistoryTest { assertThat(ddiActionHistory.toString()).contains("SomeAction", "Some message"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiActionFeedback = """ { diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHashTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHashTest.java index ef771b992..eb3812665 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHashTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHashTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiArtifactHash' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiArtifactHashTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String sha1Hash = "11111"; final String md5Hash = "22222"; @@ -49,9 +48,10 @@ class DdiArtifactHashTest { assertThat(deserializedDdiArtifact.getSha256()).isEqualTo(sha256Hash); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiArtifact = "{\"sha1\": \"123\", \"md5\": \"456\", \"sha256\": \"789\", \"unknownProperty\": \"test\"}"; @@ -62,9 +62,10 @@ class DdiArtifactHashTest { assertThat(ddiArtifact.getSha256()).isEqualTo("789"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiArtifact = "{\"sha1\": [123], \"md5\": 456, \"sha256\": \"789\""; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactTest.java index d2e2a5d8e..29aed3ba3 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiArtifact' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiArtifactTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String filename = "testfile.txt"; final DdiArtifactHash hashes = new DdiArtifactHash("123", "456", "789"); @@ -52,9 +51,10 @@ class DdiArtifactTest { assertThat(deserializedDdiArtifact.getHashes().getSha256()).isEqualTo(hashes.getSha256()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiArtifact = "{\"filename\":\"test.file\",\"hashes\":{\"sha1\":\"123\",\"md5\":\"456\",\"sha256\":\"789\"},\"size\":111,\"links\":[],\"unknownProperty\": \"test\"}"; @@ -67,9 +67,10 @@ class DdiArtifactTest { assertThat(ddiArtifact.getHashes().getSha256()).isEqualTo("789"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiArtifact = "{\"filename\": [\"test.file\"],\"hashes\":{\"sha1\":\"123\",\"md5\":\"456\",\"sha256\":\"789\"},\"size\":111,\"links\":[]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStopTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStopTest.java index df1c6159a..431892a86 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStopTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStopTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiCancelActionToStop' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiCancelActionToStopTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String stopId = "1234"; final DdiCancelActionToStop ddiCancelActionToStop = new DdiCancelActionToStop(stopId); @@ -46,9 +45,10 @@ class DdiCancelActionToStopTest { assertThat(deserializedDdiCancelActionToStop.getStopId()).isEqualTo(stopId); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiCancelActionToStop = "{\"stopId\":\"12345\",\"unknownProperty\":\"test\"}"; @@ -58,9 +58,10 @@ class DdiCancelActionToStopTest { assertThat(ddiCancelActionToStop.getStopId()).contains("12345"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiCancelActionToStop = "{\"stopId\": [\"12345\"]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelTest.java index 7727cfbdc..d449089ff 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiArtifact' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiCancelTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String ddiCancelId = "1234"; final DdiCancelActionToStop ddiCancelActionToStop = new DdiCancelActionToStop("1234"); @@ -47,9 +46,10 @@ class DdiCancelTest { assertThat(deserializedDdiCancel.getCancelAction().getStopId()).isEqualTo(ddiCancelActionToStop.getStopId()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiCancel = "{\"id\":\"1234\",\"cancelAction\":{\"stopId\":\"1234\"}, \"unknownProperty\": \"test\"}"; @@ -59,9 +59,10 @@ class DdiCancelTest { assertThat(ddiCancel.getCancelAction().getStopId()).matches("1234"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiCancel = "{\"id\":[\"1234\"],\"cancelAction\":{\"stopId\":\"1234\"}}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiChunkTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiChunkTest.java index 82150a69e..7c636a9eb 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiChunkTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiChunkTest.java @@ -19,23 +19,22 @@ import java.util.List; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiChunk' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiChunkTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String part = "1234"; final String version = "1.0"; @@ -53,9 +52,10 @@ class DdiChunkTest { assertThat(deserializedDdiChunk.getArtifacts()).isEmpty(); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiChunk = "{\"part\":\"1234\",\"version\":\"1.0\",\"name\":\"Dummy-Artifact\",\"artifacts\":[],\"unknownProperty\":\"test\"}"; @@ -67,9 +67,10 @@ class DdiChunkTest { assertThat(ddiChunk.getArtifacts()).isEmpty(); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiChunk = "{\"part\":[\"1234\"],\"version\":\"1.0\",\"name\":\"Dummy-Artifact\",\"artifacts\":[]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigDataTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigDataTest.java index ab3f2eef6..dce0ca539 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigDataTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigDataTest.java @@ -19,23 +19,22 @@ import java.util.Map; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiConfigData' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiConfigDataTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final Map data = new HashMap<>(); data.put("test", "data"); @@ -48,9 +47,10 @@ class DdiConfigDataTest { assertThat(deserializedDdiConfigData.getMode()).isEqualTo(DdiUpdateMode.REPLACE); } - @Test - @Description("Verify the correct deserialization of a model with an additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with an additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiConfigData = "{\"data\":{\"test\":\"data\"},\"mode\":\"replace\",\"unknownProperty\":\"test\"}"; @@ -59,9 +59,10 @@ class DdiConfigDataTest { assertThat(ddiConfigData.getMode()).isEqualTo(DdiUpdateMode.REPLACE); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiConfigData = "{\"data\":{\"test\":\"data\"},\"mode\":[\"replace\"],\"unknownProperty\":\"test\"}"; @@ -70,9 +71,10 @@ class DdiConfigDataTest { .isThrownBy(() -> OBJECT_MAPPER.readValue(serializedDdiConfigData, DdiConfigData.class)); } - @Test - @Description("Verify the correct deserialization of a model with removed unused status property") - void shouldDeserializeObjectWithStatusProperty() throws IOException { + /** + * Verify the correct deserialization of a model with removed unused status property + */ + @Test void shouldDeserializeObjectWithStatusProperty() throws IOException { // We formerly falsely required a 'status' property object when using the // configData endpoint. It was removed as a requirement from code and // documentation, as it was unused. This test ensures we still behave correctly diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigTest.java index 1aff6c394..72d57e945 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiConfig' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiConfigTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiPolling ddiPolling = new DdiPolling("10"); final DdiConfig ddiConfig = new DdiConfig(ddiPolling); @@ -45,9 +44,10 @@ class DdiConfigTest { assertThat(deserializedDdiConfig.getPolling().getSleep()).isEqualTo("10"); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiConfig = "{\"polling\":{\"sleep\":\"123\"},\"unknownProperty\":\"test\"}"; @@ -56,9 +56,10 @@ class DdiConfigTest { assertThat(ddiConfig.getPolling().getSleep()).isEqualTo("123"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiConfig = "{\"polling\":{\"sleep\":[\"10\"]}}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseTest.java index a5a1dda62..c14897f41 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiConfirmationBaseTest.java @@ -22,23 +22,22 @@ import java.util.List; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiConfirmationBase' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: CHeck JSON serialization of DDI api confirmation models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("CHeck JSON serialization of DDI api confirmation models") class DdiConfirmationBaseTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String id = "1234"; final DdiDeployment ddiDeployment = new DdiDeployment(FORCED, ATTEMPT, Collections.emptyList(), AVAILABLE); @@ -63,9 +62,10 @@ class DdiConfirmationBaseTest { .hasToString(ddiActionHistory.toString()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiConfirmationBase = "{" + "\"id\":\"1234\",\"confirmation\":{\"download\":\"forced\"," + @@ -84,9 +84,10 @@ class DdiConfirmationBaseTest { .isEqualTo(AVAILABLE.getStatus()); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiConfirmationBase = "{" + "\"id\":[\"1234\"],\"confirmation\":{\"download\":\"forced\"," + diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBaseTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBaseTest.java index 800979c71..48591d637 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBaseTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiControllerBase' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiControllerBaseTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiPolling ddiPolling = new DdiPolling("10"); final DdiConfig ddiConfig = new DdiConfig(ddiPolling); @@ -46,9 +45,10 @@ class DdiControllerBaseTest { assertThat(deserializedDdiControllerBase.getConfig().getPolling().getSleep()).isEqualTo(ddiPolling.getSleep()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiControllerBase = "{\"config\":{\"polling\":{\"sleep\":\"123\"}},\"links\":[],\"unknownProperty\":\"test\"}"; @@ -57,9 +57,10 @@ class DdiControllerBaseTest { assertThat(ddiControllerBase.getConfig().getPolling().getSleep()).isEqualTo("123"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiControllerBase = "{\"config\":{\"polling\":{\"sleep\":[\"123\"]}},\"links\":[],\"unknownProperty\":\"test\"}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBaseTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBaseTest.java index 85bd32905..3fd1bd043 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBaseTest.java @@ -22,23 +22,22 @@ import java.util.List; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiDeploymentBase' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiDeploymentBaseTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String id = "1234"; final DdiDeployment ddiDeployment = new DdiDeployment(FORCED, ATTEMPT, Collections.emptyList(), AVAILABLE); @@ -57,9 +56,10 @@ class DdiDeploymentBaseTest { assertThat(deserializedDdiDeploymentBase.getActionHistory()).hasToString(ddiActionHistory.toString()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiDeploymentBase = "{\"id\":\"1234\",\"deployment\":{\"download\":\"forced\"," + "\"update\":\"attempt\",\"maintenanceWindow\":\"available\",\"chunks\":[]}," + @@ -73,9 +73,10 @@ class DdiDeploymentBaseTest { assertThat(ddiDeploymentBase.getDeployment().getMaintenanceWindow().getStatus()).isEqualTo(AVAILABLE.getStatus()); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiDeploymentBase = "{\"id\":[\"1234\"],\"deployment\":{\"download\":\"forced\"," + "\"update\":\"attempt\",\"maintenanceWindow\":\"available\",\"chunks\":[]}," + diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentTest.java index d88731c32..a870ab760 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentTest.java @@ -21,23 +21,22 @@ import java.util.Collections; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiDeployment' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiDeploymentTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiDeployment ddiDeployment = new DdiDeployment(FORCED, ATTEMPT, Collections.emptyList(), AVAILABLE); @@ -51,9 +50,10 @@ class DdiDeploymentTest { assertThat(deserializedDdiDeployment.getMaintenanceWindow().getStatus()).isEqualTo(ddiDeployment.getMaintenanceWindow().getStatus()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiDeployment = "{\"download\":\"forced\",\"update\":\"attempt\", " + "\"maintenanceWindow\":\"available\",\"chunks\":[],\"unknownProperty\":\"test\"}"; @@ -65,9 +65,10 @@ class DdiDeploymentTest { assertThat(ddiDeployment.getMaintenanceWindow().getStatus()).isEqualTo(AVAILABLE.getStatus()); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiDeployment = "{\"download\":[\"forced\"],\"update\":\"attempt\", " + "\"maintenanceWindow\":\"available\",\"chunks\":[]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadataTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadataTest.java index c1ce5009b..d3cf9542e 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadataTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiMetadataTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiMetadata' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiMetadataTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final String key = "testKey"; final String value = "testValue"; @@ -47,9 +46,10 @@ class DdiMetadataTest { assertThat(deserializedDdiMetadata.getValue()).isEqualTo(ddiMetadata.getValue()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiMetadata = "{\"key\":\"testKey\",\"value\":\"testValue\",\"unknownProperty\":\"test\"}"; @@ -59,9 +59,10 @@ class DdiMetadataTest { assertThat(ddiMetadata.getValue()).isEqualTo("testValue"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiMetadata = "{\"key\":[\"testKey\"],\"value\":\"testValue\"}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiPollingTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiPollingTest.java index 9e9cb029e..624a825a6 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiPollingTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiPollingTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiPolling' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiPollingTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiPolling ddiPolling = new DdiPolling("10"); @@ -44,9 +43,10 @@ class DdiPollingTest { assertThat(deserializedDdiPolling.getSleep()).isEqualTo(ddiPolling.getSleep()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiPolling = "{\"sleep\":\"10\",\"unknownProperty\":\"test\"}"; @@ -55,9 +55,10 @@ class DdiPollingTest { assertThat(ddiPolling.getSleep()).isEqualTo("10"); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiPolling = "{\"sleep\":[\"10\"]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiProgressTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiProgressTest.java index 68b8f648e..99a98a271 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiProgressTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiProgressTest.java @@ -17,23 +17,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiProgress' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiProgressTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiProgress ddiProgress = new DdiProgress(30, 100); @@ -45,9 +44,10 @@ class DdiProgressTest { assertThat(deserializedDdiProgress.getOf()).isEqualTo(ddiProgress.getOf()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiProgress = "{\"cnt\":30,\"of\":100,\"unknownProperty\":\"test\"}"; @@ -57,9 +57,10 @@ class DdiProgressTest { assertThat(ddiProgress.getOf()).isEqualTo(100); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiProgress = "{\"cnt\":[30],\"of\":100}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiResultTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiResultTest.java index be9f05a12..7e40ccb81 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiResultTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiResultTest.java @@ -18,23 +18,22 @@ import java.io.IOException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Test serializability of DDI api model 'DdiResult' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiResultTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @Test - @Description("Verify the correct serialization and deserialization of the model") - void shouldSerializeAndDeserializeObject() throws IOException { + /** + * Verify the correct serialization and deserialization of the model + */ + @Test void shouldSerializeAndDeserializeObject() throws IOException { // Setup final DdiProgress ddiProgress = new DdiProgress(30, 100); final DdiResult ddiResult = new DdiResult(NONE, ddiProgress); @@ -48,9 +47,10 @@ class DdiResultTest { assertThat(deserializedDdiResult.getProgress().getOf()).isEqualTo(ddiProgress.getOf()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiResult = "{\"finished\":\"none\",\"progress\":{\"cnt\":30,\"of\":100},\"unknownProperty\":\"test\"}"; @@ -61,9 +61,10 @@ class DdiResultTest { assertThat(ddiResult.getProgress().getOf()).isEqualTo(100); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiResult = "{\"finished\":[\"none\"],\"progress\":{\"cnt\":30,\"of\":100}}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiStatusTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiStatusTest.java index 27b5bf0d5..25c2715e6 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiStatusTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/DdiStatusTest.java @@ -21,9 +21,6 @@ import java.util.stream.Stream; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -31,16 +28,19 @@ import org.junit.jupiter.params.provider.MethodSource; /** * Test serializability of DDI api model 'DdiStatus' + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serializability of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serializability of DDI api Models") class DdiStatusTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + /** + * Verify the correct serialization and deserialization of the model + */ @ParameterizedTest @MethodSource("ddiStatusPossibilities") - @Description("Verify the correct serialization and deserialization of the model") void shouldSerializeAndDeserializeObject(final DdiResult ddiResult, final DdiStatus ddiStatus) throws IOException { // Test final String serializedDdiStatus = OBJECT_MAPPER.writeValueAsString(ddiStatus); @@ -54,9 +54,10 @@ class DdiStatusTest { assertThat(deserializedDdiStatus.getDetails()).isEqualTo(ddiStatus.getDetails()); } - @Test - @Description("Verify the correct deserialization of a model with a additional unknown property") - void shouldDeserializeObjectWithUnknownProperty() throws IOException { + /** + * Verify the correct deserialization of a model with a additional unknown property + */ + @Test void shouldDeserializeObjectWithUnknownProperty() throws IOException { // Setup final String serializedDdiStatus = "{\"execution\":\"proceeding\",\"result\":{\"finished\":\"none\"," + "\"progress\":{\"cnt\":30,\"of\":100}},\"details\":[],\"unknownProperty\":\"test\"}"; @@ -70,9 +71,10 @@ class DdiStatusTest { assertThat(ddiStatus.getResult().getProgress().getOf()).isEqualTo(100); } - @Test - @Description("Verify the correct deserialization of a model with a provided code (optional)") - void shouldDeserializeObjectWithOptionalCode() throws IOException { + /** + * Verify the correct deserialization of a model with a provided code (optional) + */ + @Test void shouldDeserializeObjectWithOptionalCode() throws IOException { // Setup final String serializedDdiStatus = "{\"execution\":\"proceeding\",\"result\":{\"finished\":\"none\"," + "\"progress\":{\"cnt\":30,\"of\":100}},\"code\": 12,\"details\":[]}"; @@ -86,9 +88,10 @@ class DdiStatusTest { assertThat(ddiStatus.getResult().getProgress().getOf()).isEqualTo(100); } - @Test - @Description("Verify that deserialization fails for known properties with a wrong datatype") - void shouldFailForObjectWithWrongDataTypes() { + /** + * Verify that deserialization fails for known properties with a wrong datatype + */ + @Test void shouldFailForObjectWithWrongDataTypes() { // Setup final String serializedDdiStatus = "{\"execution\":[\"proceeding\"],\"result\":{\"finished\":\"none\"," + "\"progress\":{\"cnt\":30,\"of\":100}},\"details\":[]}"; diff --git a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/JsonIgnorePropertiesAnnotationTest.java b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/JsonIgnorePropertiesAnnotationTest.java index fd4fbf631..2dd54aef0 100644 --- a/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/JsonIgnorePropertiesAnnotationTest.java +++ b/hawkbit-ddi/hawkbit-ddi-api/src/test/java/org/eclipse/hawkbit/ddi/json/model/JsonIgnorePropertiesAnnotationTest.java @@ -18,21 +18,20 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.github.classgraph.ClassGraph; import io.github.classgraph.ClassInfo; import io.github.classgraph.ScanResult; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; /** * Check DDI api model classes for '@JsonIgnoreProperties' annotation + *

+ * Feature: Unit Tests - Direct Device Integration API
+ * Story: Serialization of DDI api Models */ -@Feature("Unit Tests - Direct Device Integration API") -@Story("Serialization of DDI api Models") class JsonIgnorePropertiesAnnotationTest { - @Test - @Description("This test verifies that all model classes within the 'org.eclipse.hawkbit.ddi.json.model' package are annotated with '@JsonIgnoreProperties(ignoreUnknown = true)'") - void shouldCheckAnnotationsForAllModelClasses() { + /** + * This test verifies that all model classes within the 'org.eclipse.hawkbit.ddi.json.model' package are annotated with '@JsonIgnoreProperties(ignoreUnknown = true)' + */ + @Test void shouldCheckAnnotationsForAllModelClasses() { final String packageName = getClass().getPackage().getName(); try (final ScanResult scanResult = new ClassGraph().acceptPackages(packageName).scan()) { final List> matchingClasses = scanResult.getAllClasses() diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java index 4d8b4f9d5..03f0c147e 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java @@ -30,9 +30,6 @@ import java.util.List; import java.util.Locale; import java.util.TimeZone; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.rest.resource.DdiArtifactDownloadTest.DownloadTestConfiguration; import org.eclipse.hawkbit.repository.event.remote.DownloadProgressEvent; import org.eclipse.hawkbit.repository.model.Artifact; @@ -53,9 +50,10 @@ import org.springframework.test.web.servlet.MvcResult; /** * Test artifact downloads from the controller. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Artifact Download Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Artifact Download Resource") @SpringBootTest(classes = { DownloadTestConfiguration.class }) class DdiArtifactDownloadTest extends AbstractDDiApiIntegrationTest { @@ -69,9 +67,10 @@ class DdiArtifactDownloadTest extends AbstractDDiApiIntegrationTest { dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); } - @Test - @Description("Tests non allowed requests on the artifact ressource, e.g. invalid URI, wrong if-match, wrong command.") - void invalidRequestsOnArtifactResource() throws Exception { + /** + * Tests non allowed requests on the artifact ressource, e.g. invalid URI, wrong if-match, wrong command. + */ + @Test void invalidRequestsOnArtifactResource() throws Exception { // create target final Target target = testdataFactory.createTarget(); final List targets = Collections.singletonList(target); @@ -157,9 +156,11 @@ class DdiArtifactDownloadTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } + /** + * Tests valid downloads through the artifact resource by identifying the artifact not by ID but file name. + */ @Test @WithUser(principal = "4712", authorities = "ROLE_CONTROLLER", allSpPermissions = true) - @Description("Tests valid downloads through the artifact resource by identifying the artifact not by ID but file name.") void downloadArtifactThroughFileName() throws Exception { downloadProgress = 1; shippedBytes = 0; @@ -203,9 +204,10 @@ class DdiArtifactDownloadTest extends AbstractDDiApiIntegrationTest { assertThat(shippedBytes).isEqualTo(artifactSize); } - @Test - @Description("Tests valid MD5SUm file downloads through the artifact resource by identifying the artifact by ID.") - void downloadMd5sumThroughControllerApi() throws Exception { + /** + * Tests valid MD5SUm file downloads through the artifact resource by identifying the artifact by ID. + */ + @Test void downloadMd5sumThroughControllerApi() throws Exception { // create target final Target target = testdataFactory.createTarget(); @@ -233,9 +235,11 @@ class DdiArtifactDownloadTest extends AbstractDDiApiIntegrationTest { .isEqualTo((artifact.getMd5Hash() + " " + artifact.getFilename()).getBytes(StandardCharsets.US_ASCII)); } + /** + * Test various HTTP range requests for artifact download, e.g. chunk download or download resume. + */ @Test @WithUser(principal = TestdataFactory.DEFAULT_CONTROLLER_ID, authorities = "ROLE_CONTROLLER", allSpPermissions = true) - @Description("Test various HTTP range requests for artifact download, e.g. chunk download or download resume.") void rangeDownloadArtifact() throws Exception { // create target final Target target = testdataFactory.createTarget(); diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java index 691d152b5..fec7de98c 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java @@ -25,9 +25,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.json.model.DdiResult; import org.eclipse.hawkbit.ddi.json.model.DdiStatus; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; @@ -46,17 +43,19 @@ import org.springframework.integration.json.JsonPathUtils; /** * Test cancel action from the controller. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Cancel Action Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Cancel Action Resource") class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { @Autowired ActionStatusRepository actionStatusRepository; - @Test - @Description("Tests that the cancel action resource can be used with CBOR.") - void cancelActionCbor() throws Exception { + /** + * Tests that the cancel action resource can be used with CBOR. + */ + @Test void cancelActionCbor() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); testdataFactory.createTarget(); final Long actionId = getFirstAssignedActionId( @@ -87,9 +86,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("Test of the controller can continue a started update even after a cancel command if it so desires.") - void rootRsCancelActionButContinueAnyway() throws Exception { + /** + * Test of the controller can continue a started update even after a cancel command if it so desires. + */ + @Test void rootRsCancelActionButContinueAnyway() throws Exception { // prepare test data final DistributionSet ds = testdataFactory.createDistributionSet(""); final Target savedTarget = testdataFactory.createTarget(); @@ -147,9 +147,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { } - @Test - @Description("Test for cancel operation of a update action.") - void rootRsCancelAction() throws Exception { + /** + * Test for cancel operation of a update action. + */ + @Test void rootRsCancelAction() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); final Target savedTarget = testdataFactory.createTarget(); @@ -228,9 +229,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { } - @Test - @Description("Tests various bad requests and if the server handles them as expected.") - void badCancelAction() throws Exception { + /** + * Tests various bad requests and if the server handles them as expected. + */ + @Test void badCancelAction() throws Exception { // not allowed methods mvc.perform(post("/{tenant}/controller/v1/" + TestdataFactory.DEFAULT_CONTROLLER_ID + "/cancelAction/1", @@ -264,9 +266,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { } - @Test - @Description("Tests the feedback channel of the cancel operation.") - void rootRsCancelActionFeedback() throws Exception { + /** + * Tests the feedback channel of the cancel operation. + */ + @Test void rootRsCancelActionFeedback() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -344,9 +347,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget.getControllerId(), PAGE)).isEmpty(); } - @Test - @Description("Tests the feeback chanel of for multiple open cancel operations on the same target.") - void multipleCancelActionFeedback() throws Exception { + /** + * Tests the feeback chanel of for multiple open cancel operations on the same target. + */ + @Test void multipleCancelActionFeedback() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet("", true); final DistributionSet ds2 = testdataFactory.createDistributionSet("2", true); final DistributionSet ds3 = testdataFactory.createDistributionSet("3", true); @@ -475,9 +479,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { assertThat(deploymentManagement.countActionsByTarget(savedTarget.getControllerId())).isEqualTo(3); } - @Test - @Description("Tests the feeback channel closing for too many feedbacks, i.e. denial of service prevention.") - void tooMuchCancelActionFeedback() throws Exception { + /** + * Tests the feeback channel closing for too many feedbacks, i.e. denial of service prevention. + */ + @Test void tooMuchCancelActionFeedback() throws Exception { testdataFactory.createTarget(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -503,9 +508,10 @@ class DdiCancelActionTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isForbidden()); } - @Test - @Description("test the correct rejection of various invalid feedback requests") - void badCancelActionFeedback() throws Exception { + /** + * test the correct rejection of various invalid feedback requests + */ + @Test void badCancelActionFeedback() throws Exception { final Action cancelAction = createCancelAction(TestdataFactory.DEFAULT_CONTROLLER_ID); createCancelAction("4715"); diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java index c07377ddd..5d3189781 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java @@ -28,10 +28,6 @@ import java.util.HashMap; import java.util.Map; import java.util.NoSuchElementException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException; @@ -48,8 +44,10 @@ import org.springframework.test.context.ActiveProfiles; * Test config data from the controller. */ @ActiveProfiles({ "im", "test" }) -@Feature("Component Tests - Direct Device Integration API") -@Story("Config Data Resource") +/** + * Feature: Component Tests - Direct Device Integration API
+ * Story: Config Data Resource + */ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { private static final String TARGET1_ID = "4717"; @@ -57,9 +55,10 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { private static final String TARGET2_ID = "4718"; private static final String TARGET2_CONFIG_DATA_PATH = "/{tenant}/controller/v1/" + TARGET2_ID + "/configData"; - @Test - @Description("Verify that config data can be uploaded as CBOR") - void putConfigDataAsCbor() throws Exception { + /** + * Verify that config data can be uploaded as CBOR + */ + @Test void putConfigDataAsCbor() throws Exception { testdataFactory.createTarget(TARGET1_ID); final Map attributes = new HashMap<>(); @@ -73,9 +72,11 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { assertThat(targetManagement.getControllerAttributes(TARGET1_ID)).isEqualTo(attributes); } + @Test - @Description("We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) " + - "are requested only once from the device.") + /** + * We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) are requested only once from the device.") + */ @SuppressWarnings("squid:S2925") void requestConfigDataIfEmpty() throws Exception { final Target savedTarget = testdataFactory.createTarget("4712"); @@ -111,9 +112,11 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$._links.configData.href").doesNotExist()); } + /** + * We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) + * can be uploaded correctly by the controller. + */ @Test - @Description("We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) " + - "can be uploaded correctly by the controller.") void putConfigData() throws Exception { testdataFactory.createTarget(TARGET1_ID); @@ -136,10 +139,11 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { assertThat(targetManagement.getControllerAttributes(TARGET1_ID)).isEqualTo(attributes); } + /** + * We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) + * upload quota is enforced to protect the server from malicious attempts.""") + */ @Test - @Description(""" - We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) - upload quota is enforced to protect the server from malicious attempts.""") void putTooMuchConfigData() throws Exception { testdataFactory.createTarget(TARGET1_ID); @@ -161,9 +165,11 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_QUOTA_EXCEEDED.getKey()))); } + /** + * We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) + * resource behaves as expected in case of invalid request attempts. + */ @Test - @Description("We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) " - + "resource behaves as expected in case of invalid request attempts.") void badConfigData() throws Exception { testdataFactory.createTarget("4712"); @@ -200,18 +206,20 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Test - @Description("Verifies that invalid config data attributes are handled correctly.") - void putConfigDataWithInvalidAttributes() throws Exception { + /** + * Verifies that invalid config data attributes are handled correctly. + */ + @Test void putConfigDataWithInvalidAttributes() throws Exception { // create a target testdataFactory.createTarget(TARGET2_ID); putAndVerifyConfigDataWithKeyTooLong(); putAndVerifyConfigDataWithValueTooLong(); } - @Test - @Description("Verify that config data (device attributes) can be updated by the controller using different update modes (merge, replace, remove).") - void putConfigDataWithDifferentUpdateModes() throws Exception { + /** + * Verify that config data (device attributes) can be updated by the controller using different update modes (merge, replace, remove). + */ + @Test void putConfigDataWithDifferentUpdateModes() throws Exception { // create a target testdataFactory.createTarget(TARGET1_ID); @@ -231,7 +239,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { putConfigDataWithInvalidUpdateMode(); } - @Step private void putAndVerifyConfigDataWithKeyTooLong() throws Exception { final Map attributes = Collections.singletonMap(ATTRIBUTE_KEY_TOO_LONG, ATTRIBUTE_VALUE_VALID); mvc.perform(put(DdiConfigDataTest.TARGET2_CONFIG_DATA_PATH, tenantAware.getCurrentTenant()) @@ -241,7 +248,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_TARGET_ATTRIBUTES_INVALID.getKey()))); } - @Step private void putAndVerifyConfigDataWithValueTooLong() throws Exception { final Map attributes = Collections.singletonMap(ATTRIBUTE_KEY_VALID, ATTRIBUTE_VALUE_TOO_LONG); mvc.perform(put(DdiConfigDataTest.TARGET2_CONFIG_DATA_PATH, tenantAware.getCurrentTenant()) @@ -251,7 +257,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_TARGET_ATTRIBUTES_INVALID.getKey()))); } - @Step private void putConfigDataWithInvalidUpdateMode() throws Exception { // create some attriutes final Map attributes = Map.of( @@ -266,7 +271,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Step private void putConfigDataWithUpdateModeRemove() throws Exception { // get the current attributes final int previousSize = targetManagement.getControllerAttributes(DdiConfigDataTest.TARGET1_ID).size(); @@ -290,7 +294,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { } - @Step private void putConfigDataWithUpdateModeMerge() throws Exception { // get the current attributes final Map attributes = new HashMap<>(targetManagement.getControllerAttributes(DdiConfigDataTest.TARGET1_ID)); @@ -313,7 +316,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { attributes.keySet().forEach(assertThat(updatedAttributes)::containsKey); } - @Step private void putConfigDataWithUpdateModeReplace() throws Exception { // get the current attributes final Map attributes = new HashMap<>(targetManagement.getControllerAttributes(DdiConfigDataTest.TARGET1_ID)); @@ -337,7 +339,6 @@ class DdiConfigDataTest extends AbstractDDiApiIntegrationTest { attributes.entrySet().forEach(assertThat(updatedAttributes)::doesNotContain); } - @Step private void putConfigDataWithoutUpdateMode() throws Exception { // create some attributes final Map attributes = Map.of( diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfirmationBaseTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfirmationBaseTest.java index ad106f85f..1e7dc248a 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfirmationBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfirmationBaseTest.java @@ -23,10 +23,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.json.model.DdiActivateAutoConfirmation; import org.eclipse.hawkbit.ddi.json.model.DdiConfirmationFeedback; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; @@ -63,16 +59,18 @@ import org.springframework.test.web.servlet.ResultActions; /** * Test confirmation base from the controller. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Confirmation Action Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Confirmation Action Resource") class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { private static final String DEFAULT_CONTROLLER_ID = "4747"; - @Test - @Description("Forced deployment to a controller. Checks if the confirmation resource response payload for a given deployment is as expected.") - void verifyConfirmationReferencesInControllerBase(@Autowired ActionStatusRepository actionStatusRepository) throws Exception { + /** + * Forced deployment to a controller. Checks if the confirmation resource response payload for a given deployment is as expected. + */ + @Test void verifyConfirmationReferencesInControllerBase(@Autowired ActionStatusRepository actionStatusRepository) throws Exception { enableConfirmationFlow(); // Prepare test data final DistributionSet ds = testdataFactory.createDistributionSet("", true); @@ -134,9 +132,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .allMatch(status -> status.getStatus() == Action.Status.WAIT_FOR_CONFIRMATION); } - @Test - @Description("Ensure that the deployment resource is available as CBOR") - void confirmationResourceCbor() throws Exception { + /** + * Ensure that the deployment resource is available as CBOR + */ + @Test void confirmationResourceCbor() throws Exception { enableConfirmationFlow(); final Target target = testdataFactory.createTarget(); final DistributionSet distributionSet = testdataFactory.createDistributionSet(""); @@ -158,9 +157,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { String.valueOf(softwareModuleId)); } - @Test - @Description("Ensure that the confirmation endpoint is not available.") - void confirmationEndpointNotExposed() throws Exception { + /** + * Ensure that the confirmation endpoint is not available. + */ + @Test void confirmationEndpointNotExposed() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); Target savedTarget = testdataFactory.createTarget("988"); savedTarget = getFirstAssignedTarget(assignDistributionSet(ds.getId(), savedTarget.getControllerId())); @@ -179,9 +179,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Ensure that the deploymentBase endpoint is not available for action ins WFC state.") - void deploymentEndpointNotAccessibleForActionsWFC() throws Exception { + /** + * Ensure that the deploymentBase endpoint is not available for action ins WFC state. + */ + @Test void deploymentEndpointNotAccessibleForActionsWFC() throws Exception { enableConfirmationFlow(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -208,9 +209,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Ensure that the confirmation endpoints are still available after deactivating the confirmation flow.") - void verifyConfirmationBaseEndpointsArePresentAfterDisablingConfirmationFlow() throws Exception { + /** + * Ensure that the confirmation endpoints are still available after deactivating the confirmation flow. + */ + @Test void verifyConfirmationBaseEndpointsArePresentAfterDisablingConfirmationFlow() throws Exception { enableConfirmationFlow(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -244,9 +246,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { verifyActionInDeploymentBaseState(controllerId, savedAction.getId()); } - @Test - @Description("Controller sends a confirmed action state.") - @ExpectEvents({ + /** + * Controller sends a confirmed action state. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -279,9 +282,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { verifyActionInDeploymentBaseState(controllerId, savedAction.getId()); } - @Test - @Description("Confirmation base provides right values if auto-confirm not active.") - void getConfirmationBaseProvidesAutoConfirmStatusNotActive() throws Exception { + /** + * Confirmation base provides right values if auto-confirm not active. + */ + @Test void getConfirmationBaseProvidesAutoConfirmStatusNotActive() throws Exception { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget("989").getControllerId(); @@ -305,9 +309,11 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$._links.deactivateAutoConfirm").doesNotExist()); } + /** + * Confirmation base provides right values if auto-confirm is active. + */ @ParameterizedTest @MethodSource("possibleActiveStates") - @Description("Confirmation base provides right values if auto-confirm is active.") void getConfirmationBaseProvidesAutoConfirmStatusActive(final String initiator, final String remark) throws Exception { final String controllerId = testdataFactory.createTarget("988").getControllerId(); @@ -331,9 +337,11 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$._links.activateAutoConfirm").doesNotExist()); } + /** + * Verify auto-confirm activation is handled correctly. + */ @ParameterizedTest @MethodSource("possibleActiveStates") - @Description("Verify auto-confirm activation is handled correctly.") void activateAutoConfirmation(final String initiator, final String remark) throws Exception { final String controllerId = testdataFactory.createTarget("988").getControllerId(); @@ -351,9 +359,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { }); } - @Test - @Description("Verify auto-confirm deactivation is handled correctly.") - void deactivateAutoConfirmation() throws Exception { + /** + * Verify auto-confirm deactivation is handled correctly. + */ + @Test void deactivateAutoConfirmation() throws Exception { final String controllerId = testdataFactory.createTarget("988").getControllerId(); confirmationManagement.activateAutoConfirmation(controllerId, null, null); @@ -365,9 +374,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { assertThat(confirmationManagement.getStatus(controllerId)).isEmpty(); } - @Test - @Description("Controller sends a denied action state.") - @ExpectEvents({ + /** + * Controller sends a denied action state. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -410,9 +420,10 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerDeploymentActionFeedback endpoint.") - @ExpectEvents({ + /** + * Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerDeploymentActionFeedback endpoint. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -464,7 +475,6 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { Arguments.of(null, null)); } - @Step private void verifyActionInDeploymentBaseState(final String controllerId, final long actionId) throws Exception { final String expectedDeploymentBaseLink = String.format( "/%s/controller/v1/%s/deploymentBase/%d", @@ -482,7 +492,6 @@ class DdiConfirmationBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isOk()); } - @Step private void verifyActionInConfirmationBaseState(final String controllerId, final long actionId) throws Exception { mvc.perform(get(CONTROLLER_BASE, tenantAware.getCurrentTenant(), controllerId).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java index a0be82d09..1327ac456 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java @@ -26,9 +26,6 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.assertj.core.api.Condition; import org.eclipse.hawkbit.ddi.json.model.DdiResult; import org.eclipse.hawkbit.ddi.json.model.DdiStatus; @@ -70,9 +67,10 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; /** * Test deployment base from the controller. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Deployment Action Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Deployment Action Resource") class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { private static final String DEFAULT_CONTROLLER_ID = "4712"; @@ -82,9 +80,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { @Autowired private ActionStatusRepository actionStatusRepository; - @Test - @Description("Ensure that the deployment resource is available as CBOR") - void deploymentResourceCbor() throws Exception { + /** + * Ensure that the deployment resource is available as CBOR + */ + @Test void deploymentResourceCbor() throws Exception { final Target target = testdataFactory.createTarget(); final DistributionSet distributionSet = testdataFactory.createDistributionSet(""); @@ -109,17 +108,19 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { status().isOk()); } - @Test - @Description("Ensures that artifacts are not found, when software module does not exists.") - void artifactsNotFound() throws Exception { + /** + * Ensures that artifacts are not found, when software module does not exists. + */ + @Test void artifactsNotFound() throws Exception { final Target target = testdataFactory.createTarget(); performGet(SOFTWARE_MODULE_ARTIFACTS, MediaType.APPLICATION_JSON, status().isNotFound(), tenantAware.getCurrentTenant(), target.getControllerId(), "1"); } - @Test - @Description("Ensures that artifacts are found, when software module exists.") - void artifactsExists() throws Exception { + /** + * Ensures that artifacts are found, when software module exists. + */ + @Test void artifactsExists() throws Exception { final Target target = testdataFactory.createTarget(); final DistributionSet distributionSet = testdataFactory.createDistributionSet(""); @@ -136,9 +137,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.[?(@.filename=='filename2')]", hasSize(1))); } - @Test - @Description("Forced deployment to a controller. Checks if the resource response payload for a given deployment is as expected.") - void deploymentForceAction() throws Exception { + /** + * Forced deployment to a controller. Checks if the resource response payload for a given deployment is as expected. + */ + @Test void deploymentForceAction() throws Exception { // Prepare test data final DistributionSet ds = testdataFactory.createDistributionSet("", true); final DistributionSet ds2 = testdataFactory.createDistributionSet("2", true); @@ -193,9 +195,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertThat(actionStatusMessage.getStatus()).isEqualTo(Status.RETRIEVED); } - @Test - @Description("Checks that the deploymentBase URL changes when the action is switched from soft to forced in TIMEFORCED case.") - void changeEtagIfActionSwitchesFromSoftToForced() throws Exception { + /** + * Checks that the deploymentBase URL changes when the action is switched from soft to forced in TIMEFORCED case. + */ + @Test void changeEtagIfActionSwitchesFromSoftToForced() throws Exception { // Prepare test data final Target target = testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); final DistributionSet ds = testdataFactory.createDistributionSet("", true); @@ -229,9 +232,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .toString()).isNotEqualTo(urlBeforeSwitch); } - @Test - @Description("Attempt/soft deployment to a controller. Checks if the resource response payload for a given deployment is as expected.") - void deploymentAttemptAction() throws Exception { + /** + * Attempt/soft deployment to a controller. Checks if the resource response payload for a given deployment is as expected. + */ + @Test void deploymentAttemptAction() throws Exception { // Prepare test data final DistributionSet ds = testdataFactory.createDistributionSet("", true); final DistributionSet ds2 = testdataFactory.createDistributionSet("2", true); @@ -292,9 +296,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertThat(actionStatusMessage.getStatus()).isEqualTo(Status.RETRIEVED); } - @Test - @Description("Attempt/soft deployment to a controller including automated switch to hard. Checks if the resource response payload for a given deployment is as expected.") - void deploymentAutoForceAction() throws Exception { + /** + * Attempt/soft deployment to a controller including automated switch to hard. Checks if the resource response payload for a given deployment is as expected. + */ + @Test void deploymentAutoForceAction() throws Exception { // Prepare test data final DistributionSet ds = testdataFactory.createDistributionSet("", true); final DistributionSet ds2 = testdataFactory.createDistributionSet("2", true); @@ -350,9 +355,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertThat(actionStatusMessage.getStatus()).isEqualTo(Status.RETRIEVED); } - @Test - @Description("Test download-only (forced + skip) deployment to a controller. Checks if the resource response payload for a given deployment is as expected.") - void deploymentDownloadOnlyAction() throws Exception { + /** + * Test download-only (forced + skip) deployment to a controller. Checks if the resource response payload for a given deployment is as expected. + */ + @Test void deploymentDownloadOnlyAction() throws Exception { // Prepare test data final DistributionSet ds = testdataFactory.createDistributionSet("", true); final DistributionSet ds2 = testdataFactory.createDistributionSet("2", true); @@ -411,9 +417,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertThat(actionStatusMessage.getStatus()).isEqualTo(Status.RETRIEVED); } - @Test - @Description("Test various invalid access attempts to the deployment resource und the expected behaviour of the server.") - void badDeploymentAction() throws Exception { + /** + * Test various invalid access attempts to the deployment resource und the expected behaviour of the server. + */ + @Test void badDeploymentAction() throws Exception { final Target target = testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); // not allowed methods @@ -455,9 +462,11 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotAcceptable()); } + /** + * The server protects itself against to many feedback upload attempts. The test verifies that + * it is not possible to exceed the configured maximum number of feedback uploads. + */ @Test - @Description("The server protects itself against to many feedback upload attempts. The test verifies that " + - "it is not possible to exceed the configured maximum number of feedback uploads.") void tooMuchDeploymentActionFeedback() throws Exception { final Target target = testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -474,9 +483,11 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { postDeploymentFeedback(DEFAULT_CONTROLLER_ID, action.getId(), feedback, status().isForbidden()); } + /** + * The server protects itself against too large feedback bodies. The test verifies that + * it is not possible to exceed the configured maximum number of feedback details. + */ @Test - @Description("The server protects itself against too large feedback bodies. The test verifies that " + - "it is not possible to exceed the configured maximum number of feedback details.") void tooMuchDeploymentActionMessagesInFeedback() throws Exception { final Target target = testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -493,9 +504,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { postDeploymentFeedback(DEFAULT_CONTROLLER_ID, action.getId(), feedback, status().isForbidden()); } - @Test - @Description("Multiple uploads of deployment status feedback to the server.") - void multipleDeploymentActionFeedback() throws Exception { + /** + * Multiple uploads of deployment status feedback to the server. + */ + @Test void multipleDeploymentActionFeedback() throws Exception { testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); testdataFactory.createTarget("4713"); testdataFactory.createTarget("4714"); @@ -533,9 +545,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertStatusMessagesCount(6); } - @Test - @Description("Verifies that an update action is correctly set to error if the controller provides error feedback.") - void rootRsSingleDeploymentActionWithErrorFeedback() throws Exception { + /** + * Verifies that an update action is correctly set to error if the controller provides error feedback. + */ + @Test void rootRsSingleDeploymentActionWithErrorFeedback() throws Exception { DistributionSet ds = testdataFactory.createDistributionSet(""); final Target savedTarget = testdataFactory.createTarget(DEFAULT_CONTROLLER_ID); @@ -569,9 +582,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .haveAtLeast(1, new ActionStatusCondition(Status.FINISHED)); } - @Test - @Description("Verifies that the controller can provided as much feedback entries as necessary as long as it is in the configured limits.") - void rootRsSingleDeploymentActionFeedback() throws Exception { + /** + * Verifies that the controller can provided as much feedback entries as necessary as long as it is in the configured limits. + */ + @Test void rootRsSingleDeploymentActionFeedback() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); final Long actionId = getFirstAssignedActionId( assignDistributionSet(ds, @@ -609,9 +623,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { assertThat(targetManagement.findByAssignedDistributionSet(ds.getId(), PAGE)).hasSize(1); } - @Test - @Description("Various forbidden request attempts on the feedback resource. Ensures correct answering behaviour as expected to these kind of errors.") - void badDeploymentActionFeedback() throws Exception { + /** + * Various forbidden request attempts on the feedback resource. Ensures correct answering behaviour as expected to these kind of errors. + */ + @Test void badDeploymentActionFeedback() throws Exception { final DistributionSet savedSet = testdataFactory.createDistributionSet(""); final DistributionSet savedSet2 = testdataFactory.createDistributionSet("1"); @@ -647,9 +662,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Ensures that an invalid id in feedback body returns a bad request.") - @ExpectEvents({ + /** + * Ensures that an invalid id in feedback body returns a bad request. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -668,9 +684,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { postDeploymentFeedback("1080", action.getId(), invalidFeedback, status().isBadRequest()); } - @Test - @Description("Ensures that a missing feedback result in feedback body returns a bad request.") - @ExpectEvents({ + /** + * Ensures that a missing feedback result in feedback body returns a bad request. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -693,9 +710,10 @@ class DdiDeploymentBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.exceptionClass", equalTo(MessageNotReadableException.class.getName()))); } - @Test - @Description("Ensures that a missing finished result in feedback body returns a bad request.") - @ExpectEvents({ + /** + * Ensures that a missing finished result in feedback body returns a bad request. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiInstalledBaseTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiInstalledBaseTest.java index 894d20e23..fb1c37604 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiInstalledBaseTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiInstalledBaseTest.java @@ -27,9 +27,6 @@ import java.util.Collections; import java.util.List; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.json.model.DdiResult; import org.eclipse.hawkbit.ddi.json.model.DdiStatus; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; @@ -66,9 +63,10 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; /** * Test installed base from the controller. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Installed Base Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Installed Base Resource") class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { @Autowired @@ -76,9 +74,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { private static final int ARTIFACT_SIZE = 5 * 1024; private static final String CONTROLLER_ID = "4715"; - @Test - @Description("Ensure that the installed base resource is available as CBOR") - void installedBaseResourceCbor() throws Exception { + /** + * Ensure that the installed base resource is available as CBOR + */ + @Test void installedBaseResourceCbor() throws Exception { final Target target = testdataFactory.createTarget(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -98,9 +97,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { String.valueOf(softwareModuleId)); } - @Test - @Description("Ensure that assigned version is self assigned version") - void installedVersion() throws Exception { + /** + * Ensure that assigned version is self assigned version + */ + @Test void installedVersion() throws Exception { final Target target = createTargetAndAssertNoActiveActions(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -113,9 +113,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { putInstalledBase(target.getControllerId(), getJsonInstalledBase(ds.getName(), ds.getVersion()), status().isOk()); } - @Test - @Description("Ensure that installedVersion is version self assigned") - void installedVersionNotExist() throws Exception { + /** + * Ensure that installedVersion is version self assigned + */ + @Test void installedVersionNotExist() throws Exception { final Target target = createTargetAndAssertNoActiveActions(); final String dsName = "unknown"; final String dsVersion = "1.0.0"; @@ -126,9 +127,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { assertThat(deploymentManagement.getAssignedDistributionSet(target.getControllerId()).isEmpty()).isTrue(); } - @Test - @Description("Test several deployments to a controller. Checks that action is represented as installedBase after installation.") - void deploymentSeveralActionsInInstalledBase() throws Exception { + /** + * Test several deployments to a controller. Checks that action is represented as installedBase after installation. + */ + @Test void deploymentSeveralActionsInInstalledBase() throws Exception { // Prepare test data final Target target = createTargetAndAssertNoActiveActions(); @@ -194,9 +196,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { actionId1, ds1.findFirstModuleByType(osType).get().getId(), Action.ActionType.SOFT); } - @Test - @Description("Test several deployments of same ds to a controller. Checks that cancelled action in history is not linked as installedBase.") - void deploymentActionsOfSameDsWithCancelledActionInHistory() throws Exception { + /** + * Test several deployments of same ds to a controller. Checks that cancelled action in history is not linked as installedBase. + */ + @Test void deploymentActionsOfSameDsWithCancelledActionInHistory() throws Exception { // Prepare test data final Target target = createTargetAndAssertNoActiveActions(); @@ -250,9 +253,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Test several deployments of same ds to a controller. Checks that latest cancelled action does not override actual installed ds.") - void deploymentActionsOfSameDsWithCancelledAction() throws Exception { + /** + * Test several deployments of same ds to a controller. Checks that latest cancelled action does not override actual installed ds. + */ + @Test void deploymentActionsOfSameDsWithCancelledAction() throws Exception { // Prepare test data final Target target = createTargetAndAssertNoActiveActions(); @@ -307,9 +311,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Test several deployments of same ds to a controller. Checks that latest running action does not override actual installed ds.") - void deploymentActionsOfSameDsWithRunningAction() throws Exception { + /** + * Test several deployments of same ds to a controller. Checks that latest running action does not override actual installed ds. + */ + @Test void deploymentActionsOfSameDsWithRunningAction() throws Exception { // Prepare test data final Target target = createTargetAndAssertNoActiveActions(); @@ -360,9 +365,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Test open deployment to a controller. Checks that installedBase returns 404 for a pending action.") - void installedBaseReturns404ForPendingAction() throws Exception { + /** + * Test open deployment to a controller. Checks that installedBase returns 404 for a pending action. + */ + @Test void installedBaseReturns404ForPendingAction() throws Exception { // Prepare test data final Target target = createTargetAndAssertNoActiveActions(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -383,9 +389,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that artifacts are found, after the action was already closed.") - void artifactsOfInstalledActionExist() throws Exception { + /** + * Ensures that artifacts are found, after the action was already closed. + */ + @Test void artifactsOfInstalledActionExist() throws Exception { final Target target = createTargetAndAssertNoActiveActions(); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -404,9 +411,11 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.[?(@.filename=='filename2')]", hasSize(1))); } + /** + * Test forced deployment to a controller. Checks that action is represented as installedBase after installation. + */ @ParameterizedTest @MethodSource("org.eclipse.hawkbit.ddi.rest.resource.DdiInstalledBaseTest#actionTypeForDeployment") - @Description("Test forced deployment to a controller. Checks that action is represented as installedBase after installation.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -458,9 +467,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { assertThat(actionStatusMessage.getStatus()).isEqualTo(Action.Status.FINISHED); } - @Test - @Description("Test download-only deployment to a controller. Checks that download-only is not represented as installedBase.") - @ExpectEvents({ + /** + * Test download-only deployment to a controller. Checks that download-only is not represented as installedBase. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -498,9 +508,11 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$._links.installedBase.href").doesNotExist()); } + /** + * Test a failed deployment to a controller. Checks that closed action is not represented as installedBase. + */ @ParameterizedTest @MethodSource("org.eclipse.hawkbit.ddi.rest.resource.DdiInstalledBaseTest#actionTypeForDeployment") - @Description("Test a failed deployment to a controller. Checks that closed action is not represented as installedBase.") void deploymentActionFailedNotInInstalledBase(final Action.ActionType actionType) throws Exception { // Prepare test data final Target target = testdataFactory.createTarget(); @@ -532,9 +544,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$._links.installedBase.href").doesNotExist()); } - @Test - @Description("Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerInstalledAction endpoint.") - void testActionHistoryCount() throws Exception { + /** + * Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerInstalledAction endpoint. + */ + @Test void testActionHistoryCount() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); Target savedTarget = testdataFactory.createTarget("911"); savedTarget = getFirstAssignedTarget(assignDistributionSet(ds.getId(), savedTarget.getControllerId())); @@ -583,9 +596,10 @@ class DdiInstalledBaseTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.actionHistory.messages", hasItem(containsString("Installation scheduled")))); } - @Test - @Description("Test various invalid access attempts to the installed resource und the expected behaviour of the server.") - void badInstalledAction() throws Exception { + /** + * Test various invalid access attempts to the installed resource und the expected behaviour of the server. + */ + @Test void badInstalledAction() throws Exception { final Target target = testdataFactory.createTarget(CONTROLLER_ID); // not allowed methods diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java index 2abaddbcd..4fa97bd84 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java @@ -31,10 +31,6 @@ import java.util.Collections; import java.util.Map; import java.util.UUID; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ddi.json.model.DdiResult; import org.eclipse.hawkbit.ddi.json.model.DdiStatus; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; @@ -73,9 +69,10 @@ import org.springframework.test.web.servlet.ResultActions; /** * Test the root controller resources. + *

+ * Feature: Component Tests - Direct Device Integration API
+ * Story: Root Poll Resource */ -@Feature("Component Tests - Direct Device Integration API") -@Story("Root Poll Resource") class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { private static final String TARGET_COMPLETED_INSTALLATION_MSG = "Target completed installation."; @@ -85,18 +82,20 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { @Autowired private HawkbitSecurityProperties securityProperties; - @Test - @Description("Ensure that the root poll resource is available as CBOR") - void rootPollResourceCbor() throws Exception { + /** + * Ensure that the root poll resource is available as CBOR + */ + @Test void rootPollResourceCbor() throws Exception { mvc.perform(get(CONTROLLER_BASE, tenantAware.getCurrentTenant(), 4711).accept(DdiRestConstants.MEDIA_TYPE_CBOR)) .andDo(MockMvcResultPrinter.print()) .andExpect(content().contentType(DdiRestConstants.MEDIA_TYPE_CBOR)) .andExpect(status().isOk()); } - @Test - @Description("Ensures that the API returns JSON when no Accept header is specified by the client.") - void apiReturnsJSONByDefault() throws Exception { + /** + * Ensures that the API returns JSON when no Accept header is specified by the client. + */ + @Test void apiReturnsJSONByDefault() throws Exception { final MvcResult result = mvc.perform(get(CONTROLLER_BASE, tenantAware.getCurrentTenant(), 4711)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -107,9 +106,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertThat(result.getRequest().getHeader("Accept")).isNull(); } - @Test - @Description("Ensures that target poll request does not change audit data on the entity.") - @WithUser(principal = "knownPrincipal", authorities = { SpPermission.READ_TARGET, SpPermission.UPDATE_TARGET, SpPermission.CREATE_TARGET }) + /** + * Ensures that target poll request does not change audit data on the entity. + */ + @Test @WithUser(principal = "knownPrincipal", authorities = { SpPermission.READ_TARGET, SpPermission.UPDATE_TARGET, SpPermission.CREATE_TARGET }) @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1), @@ -139,18 +139,20 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertThat(targetVerify.getLastModifiedAt()).isEqualTo(findTargetByControllerID.getLastModifiedAt()); } - @Test - @Description("Ensures that server returns a not found response in case of empty controller ID.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Ensures that server returns a not found response in case of empty controller ID. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void rootRsWithoutId() throws Exception { mvc.perform(get("/controller/v1/")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that the system creates a new target in plug and play manner, i.e. target is authenticated but does not exist yet.") - @ExpectEvents({ + /** + * Ensures that the system creates a new target in plug and play manner, i.e. target is authenticated but does not exist yet. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) }) void rootRsPlugAndPlay() throws Exception { @@ -183,9 +185,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Ensures that tenant specific polling time, which is saved in the db, is delivered to the controller.") - @WithUser(principal = "knownpricipal", allSpPermissions = false) + /** + * Ensures that tenant specific polling time, which is saved in the db, is delivered to the controller. + */ + @Test @WithUser(principal = "knownpricipal", allSpPermissions = false) @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1), @@ -207,9 +210,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { }); } - @Test - @Description("Ensures that etag check results in not modified response if provided etag by client is identical to entity in repository.") - @ExpectEvents({ + /** + * Ensures that etag check results in not modified response if provided etag by client is identical to entity in repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 6), @Expect(type = TargetAssignDistributionSetEvent.class, count = 2), @@ -304,9 +308,11 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { } + /** + * Ensures that the target state machine of a precomissioned target switches from + * UNKNOWN to REGISTERED when the target polls for the first time. + */ @Test - @Description("Ensures that the target state machine of a precomissioned target switches from " - + "UNKNOWN to REGISTERED when the target polls for the first time.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1), @@ -333,9 +339,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .isEqualTo(TargetUpdateStatus.REGISTERED); } - @Test - @Description("Ensures that the source IP address of the polling target is correctly stored in repository") - @ExpectEvents({ + /** + * Ensures that the source IP address of the polling target is correctly stored in repository + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) }) void rootRsPlugAndPlayIpAddress() throws Exception { @@ -361,9 +368,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertThat(target.getLastModifiedAt()).isGreaterThanOrEqualTo(create); } - @Test - @Description("Ensures that the source IP address of the polling target is not stored in repository if disabled") - @ExpectEvents({ + /** + * Ensures that the source IP address of the polling target is not stored in repository if disabled + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) }) void rootRsIpAddressNotStoredIfDisabled() throws Exception { @@ -382,9 +390,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { securityProperties.getClients().setTrackRemoteIp(true); } - @Test - @Description("Controller trys to finish an update process after it has been finished by an error action status.") - @ExpectEvents({ + /** + * Controller trys to finish an update process after it has been finished by an error action status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -413,9 +422,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(status().isGone()); } - @Test - @Description("Controller sends attribute update request after device successfully closed software update.") - @ExpectEvents({ + /** + * Controller sends attribute update request after device successfully closed software update. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -443,9 +453,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertAttributesUpdateRequestedAfterSuccessfulDeployment(savedTarget, ds); } - @Test - @Description("Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerDeploymentActionFeedback endpoint.") - @ExpectEvents({ + /** + * Test to verify that only a specific count of messages are returned based on the input actionHistory for getControllerDeploymentActionFeedback endpoint. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -487,9 +498,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { not(hasItem(containsString(TARGET_SCHEDULED_INSTALLATION_MSG))))); } - @Test - @Description("Test to verify that a zero input value of actionHistory results in no action history appended for getControllerDeploymentActionFeedback endpoint.") - @ExpectEvents({ + /** + * Test to verify that a zero input value of actionHistory results in no action history appended for getControllerDeploymentActionFeedback endpoint. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -531,9 +543,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.actionHistory.messages").doesNotExist()); } - @Test - @Description("Test to verify that entire action history is returned if the input value for actionHistory is -1, for getControllerDeploymentActionFeedback endpoint.") - @ExpectEvents({ + /** + * Test to verify that entire action history is returned if the input value for actionHistory is -1, for getControllerDeploymentActionFeedback endpoint. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -575,9 +588,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { hasItem(containsString(TARGET_COMPLETED_INSTALLATION_MSG)))); } - @Test - @Description("Test the polling time based on different maintenance window start and end time.") - void sleepTimeResponseForDifferentMaintenanceWindowParameters() throws Exception { + /** + * Test the polling time based on different maintenance window start and end time. + */ + @Test void sleepTimeResponseForDifferentMaintenanceWindowParameters() throws Exception { final DistributionSet ds = testdataFactory.createDistributionSet(""); SecurityContextSwitch.runAs(SecurityContextSwitch.withUser("tenantadmin", TENANT_CONFIGURATION), @@ -625,9 +639,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.config.polling.sleep", equalTo("00:05:00"))); } - @Test - @Description("Test download and update values before maintenance window start time.") - void downloadAndUpdateStatusBeforeMaintenanceWindowStartTime() throws Exception { + /** + * Test download and update values before maintenance window start time. + */ + @Test void downloadAndUpdateStatusBeforeMaintenanceWindowStartTime() throws Exception { Target savedTarget = testdataFactory.createTarget("1911"); final DistributionSet ds = testdataFactory.createDistributionSet(""); savedTarget = getFirstAssignedTarget(assignDistributionSetWithMaintenanceWindow(ds.getId(), @@ -647,9 +662,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.deployment.maintenanceWindow", equalTo("unavailable"))); } - @Test - @Description("Test download and update values after maintenance window start time.") - void downloadAndUpdateStatusDuringMaintenanceWindow() throws Exception { + /** + * Test download and update values after maintenance window start time. + */ + @Test void downloadAndUpdateStatusDuringMaintenanceWindow() throws Exception { Target savedTarget = testdataFactory.createTarget("1911"); final DistributionSet ds = testdataFactory.createDistributionSet(""); savedTarget = getFirstAssignedTarget(assignDistributionSetWithMaintenanceWindow(ds.getId(), @@ -669,9 +685,10 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { .andExpect(jsonPath("$.deployment.maintenanceWindow", equalTo("available"))); } - @Test - @Description("Assign multiple DS in multi-assignment mode. The earliest active Action is exposed to the controller.") - void earliestActionIsExposedToControllerInMultiAssignMode() throws Exception { + /** + * Assign multiple DS in multi-assignment mode. The earliest active Action is exposed to the controller. + */ + @Test void earliestActionIsExposedToControllerInMultiAssignMode() throws Exception { enableMultiAssignments(); final Target target = testdataFactory.createTarget(); final DistributionSet ds1 = testdataFactory.createDistributionSet(UUID.randomUUID().toString()); @@ -684,15 +701,15 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertDeploymentActionIsExposedToTarget(target.getControllerId(), action2Id); } - @Test - @Description("The system should not create a new target because of a too long controller id.") - void rootRsWithInvalidControllerId() throws Exception { + /** + * The system should not create a new target because of a too long controller id. + */ + @Test void rootRsWithInvalidControllerId() throws Exception { final String invalidControllerId = randomString(Target.CONTROLLER_ID_MAX_SIZE + 1); mvc.perform(get(CONTROLLER_BASE, tenantAware.getCurrentTenant(), invalidControllerId)) .andExpect(status().isBadRequest()); } - @Step private void assertAttributesUpdateNotRequestedAfterFailedDeployment(Target target, final DistributionSet ds) throws Exception { target = getFirstAssignedTarget(assignDistributionSet(ds.getId(), target.getControllerId())); final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0); @@ -701,7 +718,6 @@ class DdiRootControllerTest extends AbstractDDiApiIntegrationTest { assertThatAttributesUpdateIsNotRequested(target.getControllerId()); } - @Step private void assertAttributesUpdateRequestedAfterSuccessfulDeployment(Target target, final DistributionSet ds) throws Exception { target = getFirstAssignedTarget(assignDistributionSet(ds.getId(), target.getControllerId())); final Action action = deploymentManagement.findActiveActionsByTarget(target.getControllerId(), PAGE).getContent().get(0); diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DosFilterTest.java b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DosFilterTest.java index 2ae56106f..06fb137eb 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DosFilterTest.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DosFilterTest.java @@ -17,9 +17,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.Collections; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; @@ -37,8 +34,10 @@ import org.springframework.web.context.WebApplicationContext; * Test potential DOS attack scenarios and check if the filter prevents them. */ @ActiveProfiles({ "test" }) -@Feature("Component Tests - REST Security") -@Story("Denial of Service protection filter") +/** + * Feature: Component Tests - REST Security
+ * Story: Denial of Service protection filter + */ class DosFilterTest extends AbstractDDiApiIntegrationTest { private static final String X_FORWARDED_FOR = HawkbitSecurityProperties.Clients.X_FORWARDED_FOR; @@ -49,17 +48,19 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { new DosFilter(null, 10, 10, "127\\.0\\.0\\.1|\\[0:0:0:0:0:0:0:1\\]", "(^192\\.168\\.)", "X-Forwarded-For")); } - @Test - @Description("Ensures that clients that are on the blacklist are forbidden") - void blackListedClientIsForbidden() throws Exception { + /** + * Ensures that clients that are on the blacklist are forbidden + */ + @Test void blackListedClientIsForbidden() throws Exception { mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()) .header(X_FORWARDED_FOR, "192.168.0.4 , 10.0.0.1 ")) .andExpect(status().isForbidden()); } - @Test - @Description("Ensures that a READ DoS attempt is blocked ") - void getFloodingAttackThatIsPrevented() throws Exception { + /** + * Ensures that a READ DoS attempt is blocked + */ + @Test void getFloodingAttackThatIsPrevented() throws Exception { int requests = 0; MvcResult result; do { @@ -76,9 +77,10 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { assertThat(requests).isGreaterThanOrEqualTo(10); } - @Test - @Description("Ensures that an assumed READ DoS attempt is not blocked as the client (with IPv4 address) is on a whitelist") - void unacceptableGetLoadButOnWhitelistIPv4() throws Exception { + /** + * Ensures that an assumed READ DoS attempt is not blocked as the client (with IPv4 address) is on a whitelist + */ + @Test void unacceptableGetLoadButOnWhitelistIPv4() throws Exception { for (int i = 0; i < 100; i++) { mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()) .header(X_FORWARDED_FOR, "127.0.0.1")) @@ -86,9 +88,10 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { } } - @Test - @Description("Ensures that an assumed READ DoS attempt is not blocked as the client (with IPv6 address) is on a whitelist") - void unacceptableGetLoadButOnWhitelistIPv6() throws Exception { + /** + * Ensures that an assumed READ DoS attempt is not blocked as the client (with IPv6 address) is on a whitelist + */ + @Test void unacceptableGetLoadButOnWhitelistIPv6() throws Exception { for (int i = 0; i < 100; i++) { mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()) .header(X_FORWARDED_FOR, "0:0:0:0:0:0:0:1")) @@ -96,9 +99,10 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { } } - @Test - @Description("Ensures that a relatively high number of READ requests is allowed if it is below the DoS detection threshold") - // No idea how to get rid of the Thread.sleep here + /** + * Ensures that a relatively high number of READ requests is allowed if it is below the DoS detection threshold + */ + @Test // No idea how to get rid of the Thread.sleep here @SuppressWarnings("squid:S2925") void acceptableGetLoad() throws Exception { for (int x = 0; x < 3; x++) { @@ -112,9 +116,10 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { } } - @Test - @Description("Ensures that a WRITE DoS attempt is blocked ") - void putPostFloddingAttackThatisPrevented() throws Exception { + /** + * Ensures that a WRITE DoS attempt is blocked + */ + @Test void putPostFloddingAttackThatisPrevented() throws Exception { final Long actionId = prepareDeploymentBase(); final String feedback = getJsonProceedingDeploymentActionFeedback(); @@ -135,9 +140,10 @@ class DosFilterTest extends AbstractDDiApiIntegrationTest { assertThat(requests).isGreaterThanOrEqualTo(10); } - @Test - @Description("Ensures that a relatively high number of WRITE requests is allowed if it is below the DoS detection threshold") - // No idea how to get rid of the Thread.sleep here + /** + * Ensures that a relatively high number of WRITE requests is allowed if it is below the DoS detection threshold + */ + @Test // No idea how to get rid of the Thread.sleep here @SuppressWarnings("squid:S2925") void acceptablePutPostLoad() throws Exception { final Long actionId = prepareDeploymentBase(); diff --git a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/GatewayTokenAuthenticatorTest.java b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/GatewayTokenAuthenticatorTest.java index ecea91e65..9c24ffb4c 100644 --- a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/GatewayTokenAuthenticatorTest.java +++ b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/GatewayTokenAuthenticatorTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.security.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; import org.eclipse.hawkbit.security.SecurityContextSerializer; @@ -28,8 +25,10 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -@Feature("Unit Tests - Security") -@Story("Gateway token authentication") +/** + * Feature: Unit Tests - Security
+ * Story: Gateway token authentication + */ @ExtendWith(MockitoExtension.class) class GatewayTokenAuthenticatorTest { @@ -61,9 +60,10 @@ class GatewayTokenAuthenticatorTest { new SystemSecurityContext(tenantAware)); } - @Test - @Description("Tests successful authentication with gateway token") - void testWithGwToken() { + /** + * Tests successful authentication with gateway token + */ + @Test void testWithGwToken() { final ControllerSecurityToken securityToken = prepareSecurityToken(GATEWAY_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, String.class)) @@ -77,9 +77,10 @@ class GatewayTokenAuthenticatorTest { .hasFieldOrPropertyWithValue("principal", CONTROLLER_ID); } - @Test - @Description("Tests that if gateway token doesn't match, the authentication fails") - void testWithBadGwToken() { + /** + * Tests that if gateway token doesn't match, the authentication fails + */ + @Test void testWithBadGwToken() { final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, String.class)) @@ -91,15 +92,17 @@ class GatewayTokenAuthenticatorTest { assertThat(authenticator.authenticate(securityToken)).isNull(); } - @Test - @Description("Tests that if gateway token miss, the authentication fails") - void testWithoutGwToken() { + /** + * Tests that if gateway token miss, the authentication fails + */ + @Test void testWithoutGwToken() { assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CONTROLLER_ID))).isNull(); } - @Test - @Description("Tests that if disabled, the authentication fails") - void testWithGwTokenButDisabled() { + /** + * Tests that if disabled, the authentication fails + */ + @Test void testWithGwTokenButDisabled() { final ControllerSecurityToken securityToken = prepareSecurityToken(GATEWAY_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, Boolean.class)) diff --git a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityHeaderAuthenticatorTest.java b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityHeaderAuthenticatorTest.java index 57a585bbf..b345e96ff 100644 --- a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityHeaderAuthenticatorTest.java +++ b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityHeaderAuthenticatorTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.security.controller; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; import org.eclipse.hawkbit.security.SecurityContextSerializer; @@ -28,8 +25,10 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -@Feature("Unit Tests - Security") -@Story("Security header authenticator") +/** + * Feature: Unit Tests - Security
+ * Story: Security header authenticator + */ @ExtendWith(MockitoExtension.class) class SecurityHeaderAuthenticatorTest { @@ -72,9 +71,10 @@ class SecurityHeaderAuthenticatorTest { ); } - @Test - @Description("Tests successful authentication with multiple a single hashes") - void testWithSingleKnownHash() { + /** + * Tests successful authentication with multiple a single hashes + */ + @Test void testWithSingleKnownHash() { final ControllerSecurityToken securityToken = prepareSecurityToken(SINGLE_HASH); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class)) @@ -88,9 +88,10 @@ class SecurityHeaderAuthenticatorTest { .hasFieldOrPropertyWithValue("principal", CA_COMMON_NAME_VALUE); } - @Test - @Description("Tests successful authentication with multiple hashes") - void testWithMultipleKnownHashes() { + /** + * Tests successful authentication with multiple hashes + */ + @Test void testWithMultipleKnownHashes() { when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class)) .thenReturn(CONFIG_VALUE_MULTI_HASH); @@ -109,9 +110,10 @@ class SecurityHeaderAuthenticatorTest { .hasFieldOrPropertyWithValue("principal", CA_COMMON_NAME_VALUE); } - @Test - @Description("Tests that if the hash is unknown, the authentication fails") - void testWithUnknownHash() { + /** + * Tests that if the hash is unknown, the authentication fails + */ + @Test void testWithUnknownHash() { final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_HASH); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME, String.class)) @@ -123,9 +125,10 @@ class SecurityHeaderAuthenticatorTest { assertThat(authenticator.authenticate(securityToken)).isNull(); } - @Test - @Description("Tests that if CN doesn't match the CN in the security token, the authentication fails") - void testWithNonMatchingCN() { + /** + * Tests that if CN doesn't match the CN in the security token, the authentication fails + */ + @Test void testWithNonMatchingCN() { final ControllerSecurityToken securityToken = new ControllerSecurityToken("DEFAULT", "otherControllerID"); securityToken.putHeader(CA_COMMON_NAME, CA_COMMON_NAME_VALUE); securityToken.putHeader(X_SSL_ISSUER_HASH_1, SINGLE_HASH); @@ -133,15 +136,17 @@ class SecurityHeaderAuthenticatorTest { assertThat(authenticator.authenticate(securityToken)).isNull(); } - @Test - @Description("Tests that if the hash miss, the authentication fails") - void testWithoutHash() { + /** + * Tests that if the hash miss, the authentication fails + */ + @Test void testWithoutHash() { assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CA_COMMON_NAME_VALUE))).isNull(); } - @Test - @Description("Tests that if disabled, the authentication fails") - void testWithSingleKnownHashButDisabled() { + /** + * Tests that if disabled, the authentication fails + */ + @Test void testWithSingleKnownHashButDisabled() { final ControllerSecurityToken securityToken = prepareSecurityToken(SINGLE_HASH); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED, Boolean.class)) diff --git a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityTokenAuthenticatorTest.java b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityTokenAuthenticatorTest.java index e8c739b86..971953eba 100644 --- a/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityTokenAuthenticatorTest.java +++ b/hawkbit-ddi/hawkbit-ddi-security/src/test/java/org/eclipse/hawkbit/security/controller/SecurityTokenAuthenticatorTest.java @@ -14,9 +14,6 @@ import static org.mockito.Mockito.when; import java.util.Optional; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.Target; @@ -33,8 +30,10 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -@Feature("Unit Tests - Security") -@Story("Gateway token authentication") +/** + * Feature: Unit Tests - Security
+ * Story: Gateway token authentication + */ @ExtendWith(MockitoExtension.class) class SecurityTokenAuthenticatorTest { @@ -66,9 +65,10 @@ class SecurityTokenAuthenticatorTest { new SystemSecurityContext(tenantAware), controllerManagementMock); } - @Test - @Description("Tests successful authentication with gateway token") - void testWithSecToken() { + /** + * Tests successful authentication with gateway token + */ + @Test void testWithSecToken() { final ControllerSecurityToken securityToken = prepareSecurityToken(SECURITY_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class)) @@ -84,9 +84,10 @@ class SecurityTokenAuthenticatorTest { .hasFieldOrPropertyWithValue("principal", CONTROLLER_ID); } - @Test - @Description("Tests that if gateway token doesn't match, the authentication fails") - void testWithBadSecToken() { + /** + * Tests that if gateway token doesn't match, the authentication fails + */ + @Test void testWithBadSecToken() { final ControllerSecurityToken securityToken = prepareSecurityToken(UNKNOWN_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class)) @@ -95,15 +96,17 @@ class SecurityTokenAuthenticatorTest { assertThat(authenticator.authenticate(securityToken)).isNull(); } - @Test - @Description("Tests that if gateway token miss, the authentication fails") - void testWithoutSecToken() { + /** + * Tests that if gateway token miss, the authentication fails + */ + @Test void testWithoutSecToken() { assertThat(authenticator.authenticate(new ControllerSecurityToken("DEFAULT", CONTROLLER_ID))).isNull(); } - @Test - @Description("Tests that if disabled, the authentication fails") - void testWithSecTokenButDisabled() { + /** + * Tests that if disabled, the authentication fails + */ + @Test void testWithSecTokenButDisabled() { final ControllerSecurityToken securityToken = prepareSecurityToken(SECURITY_TOKEN); when(tenantConfigurationManagementMock.getConfigurationValue( TenantConfigurationKey.AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED, Boolean.class)) diff --git a/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/AllowedHostNamesTest.java b/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/AllowedHostNamesTest.java index 3744fc34c..9993261d9 100644 --- a/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/AllowedHostNamesTest.java +++ b/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/AllowedHostNamesTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.app.ddi; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; import org.springframework.test.context.TestPropertySource; @@ -23,27 +20,32 @@ import org.springframework.test.context.TestPropertySource; "spring.flyway.enabled=true", // if hibernate is used there could be db inconsistencies when executing tests with and without flyway "hawkbit.server.security.allowedHostNames=localhost", "hawkbit.server.security.httpFirewallIgnoredPaths=/index.html" }) -@Feature("Integration Test - Security") -@Story("Allowed Host Names") +/** + * Feature: Integration Test - Security
+ * Story: Allowed Host Names + */ class AllowedHostNamesTest extends AbstractSecurityTest { - @Test - @Description("Tests whether a RequestRejectedException is thrown when not allowed host is used") - void allowedHostNameWithNotAllowedHost() throws Exception { + /** + * Tests whether a RequestRejectedException is thrown when not allowed host is used + */ + @Test void allowedHostNameWithNotAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "www.google.com")) .andExpect(status().isBadRequest()); } - @Test - @Description("Tests whether request is redirected when allowed host is used") - void allowedHostNameWithAllowedHost() throws Exception { + /** + * Tests whether request is redirected when allowed host is used + */ + @Test void allowedHostNameWithAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "localhost")) .andExpect(status().is3xxRedirection()); } - @Test - @Description("Tests whether request without allowed host name and with ignored path end up with a client error") - void notAllowedHostnameWithIgnoredPath() throws Exception { + /** + * Tests whether request without allowed host name and with ignored path end up with a client error + */ + @Test void notAllowedHostnameWithIgnoredPath() throws Exception { mvc.perform(get("/index.html").header(HttpHeaders.HOST, "www.google.com")) .andExpect(status().is4xxClientError()); } diff --git a/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/PreAuthorizeEnabledTest.java b/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/PreAuthorizeEnabledTest.java index d68472ba3..d6d87a0f4 100644 --- a/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/PreAuthorizeEnabledTest.java +++ b/hawkbit-ddi/hawkbit-ddi-server/src/test/java/org/eclipse/hawkbit/app/ddi/PreAuthorizeEnabledTest.java @@ -12,31 +12,32 @@ package org.eclipse.hawkbit.app.ddi; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; import org.springframework.test.context.TestPropertySource; -@Feature("Integration Test - Security") -@Story("PreAuthorized enabled") +/** + * Feature: Integration Test - Security
+ * Story: PreAuthorized enabled + */ @TestPropertySource(properties = { "spring.flyway.enabled=true" }) class PreAuthorizeEnabledTest extends AbstractSecurityTest { - @Test - @Description("Tests whether request fail if a role is forbidden for the user") - @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) + /** + * Tests whether request fail if a role is forbidden for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) void failIfNoRole() throws Exception { mvc.perform(get("/DEFAULT/controller/v1/controllerId")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.FORBIDDEN.value())); } - @Test - @Description("Tests whether request succeed if a role is granted for the user") - @WithUser(authorities = { SpPermission.SpringEvalExpressions.CONTROLLER_ROLE }, autoCreateTenant = false) + /** + * Tests whether request succeed if a role is granted for the user + */ + @Test @WithUser(authorities = { SpPermission.SpringEvalExpressions.CONTROLLER_ROLE }, autoCreateTenant = false) void successIfHasRole() throws Exception { mvc.perform(get("/DEFAULT/controller/v1/controllerId")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java index 6db5c295c..979f0a5f3 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java @@ -23,9 +23,6 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystem; import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; @@ -65,8 +62,10 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; @ActiveProfiles({ "test" }) -@Feature("Component Tests - Device Management Federation API") -@Story("AmqpMessage Dispatcher Service Test") +/** + * Feature: Component Tests - Device Management Federation API
+ * Story: AmqpMessage Dispatcher Service Test + */ @SpringBootTest(classes = { RepositoryApplicationConfiguration.class }, webEnvironment = SpringBootTest.WebEnvironment.NONE) class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { @@ -116,9 +115,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { return argumentCaptor.getValue(); } - @Test - @Description("Verifies that download and install event with 3 software modules and no artifacts works") - void testSendDownloadRequestWithSoftwareModulesAndNoArtifacts() { + /** + * Verifies that download and install event with 3 software modules and no artifacts works + */ + @Test void testSendDownloadRequestWithSoftwareModulesAndNoArtifacts() { final DistributionSet createDistributionSet = testdataFactory .createDistributionSet(UUID.randomUUID().toString()); testdataFactory.addSoftwareModuleMetadata(createDistributionSet); @@ -155,9 +155,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { } } - @Test - @Description("Verifies that download and install event with software modules and artifacts works") - void testSendDownloadRequest() { + /** + * Verifies that download and install event with software modules and artifacts works + */ + @Test void testSendDownloadRequest() { DistributionSet dsA = testdataFactory.createDistributionSet(UUID.randomUUID().toString()); SoftwareModule module = dsA.getModules().iterator().next(); final List receivedList = new ArrayList<>(); @@ -206,9 +207,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { } } - @Test - @Description("Verifies that sending update controller attributes event works.") - void sendUpdateAttributesRequest() { + /** + * Verifies that sending update controller attributes event works. + */ + @Test void sendUpdateAttributesRequest() { final String amqpUri = "amqp://anyhost"; final TargetAttributesRequestedEvent targetAttributesRequestedEvent = new TargetAttributesRequestedEvent(TENANT, 1L, CONTROLLER_ID, amqpUri, Target.class, serviceMatcher.getBusId()); @@ -219,9 +221,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { assertUpdateAttributesMessage(sendMessage); } - @Test - @Description("Verifies that send cancel event works") - void testSendCancelRequest() { + /** + * Verifies that send cancel event works + */ + @Test void testSendCancelRequest() { final Action action = mock(Action.class); when(action.getId()).thenReturn(1L); when(action.getTenant()).thenReturn(TENANT); @@ -235,9 +238,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { } - @Test - @Description("Verifies that sending a delete message when receiving a delete event works.") - void sendDeleteRequest() { + /** + * Verifies that sending a delete message when receiving a delete event works. + */ + @Test void sendDeleteRequest() { // setup final String amqpUri = "amqp://anyhost"; @@ -252,9 +256,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { assertDeleteMessage(sendMessage); } - @Test - @Description("Verifies that a delete message is not send if the address is not an amqp address.") - void sendDeleteRequestWithNoAmqpAddress() { + /** + * Verifies that a delete message is not send if the address is not an amqp address. + */ + @Test void sendDeleteRequestWithNoAmqpAddress() { // setup final String noAmqpUri = "http://anyhost"; @@ -268,9 +273,10 @@ class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTest { Mockito.verifyNoInteractions(senderService); } - @Test - @Description("Verifies that a delete message is not send if the address is null.") - void sendDeleteRequestWithNullAddress() { + /** + * Verifies that a delete message is not send if the address is null. + */ + @Test void sendDeleteRequestWithNullAddress() { // setup final String noAmqpUri = null; diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java index b95c02786..da25db311 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java @@ -26,10 +26,6 @@ import java.net.URI; import java.util.Map; import java.util.Optional; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey; import org.eclipse.hawkbit.dmf.amqp.api.MessageType; @@ -76,8 +72,10 @@ import org.springframework.amqp.support.converter.MessageConversionException; import org.springframework.amqp.support.converter.MessageConverter; @ExtendWith(MockitoExtension.class) -@Feature("Component Tests - Device Management Federation API") -@Story("AmqpMessage Handler Service Test") +/** + * Feature: Component Tests - Device Management Federation API
+ * Story: AmqpMessage Handler Service Test + */ class AmqpMessageHandlerServiceTest { private static final String FAIL_MESSAGE_AMQP_REJECT_REASON = AmqpRejectAndDontRequeueException.class @@ -144,9 +142,10 @@ class AmqpMessageHandlerServiceTest { confirmationManagementMock); } - @Test - @Description("Tests not allowed content-type in message") - void wrongContentType() { + /** + * Tests not allowed content-type in message + */ + @Test void wrongContentType() { final MessageProperties messageProperties = new MessageProperties(); messageProperties.setContentType("xml"); final Message message = new Message(new byte[0], messageProperties); @@ -157,9 +156,10 @@ class AmqpMessageHandlerServiceTest { VIRTUAL_HOST)); } - @Test - @Description("Tests the creation of a target/thing by calling the same method that incoming RabbitMQ messages would access.") - void createThing() { + /** + * Tests the creation of a target/thing by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThing() { final String knownThingId = "1"; processThingCreatedMessage(knownThingId, null); @@ -168,9 +168,10 @@ class AmqpMessageHandlerServiceTest { assertReplyToCapturedField("MyTest"); } - @Test - @Description("Tests the creation of a target/thing with specified name by calling the same method that incoming RabbitMQ messages would access.") - void createThingWithName() { + /** + * Tests the creation of a target/thing with specified name by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThingWithName() { final String knownThingId = "2"; final String knownThingName = "NonDefaultTargetName"; @@ -183,9 +184,10 @@ class AmqpMessageHandlerServiceTest { assertThingNameCapturedField(knownThingName); } - @Test - @Description("Tests the creation of a target/thing with specified type name by calling the same method that incoming RabbitMQ messages would access.") - void createThingWithType() { + /** + * Tests the creation of a target/thing with specified type name by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThingWithType() { final String knownThingId = "2"; final String knownThingTypeName = "TargetTypeName"; @@ -198,9 +200,10 @@ class AmqpMessageHandlerServiceTest { assertThingTypeCapturedField(knownThingTypeName); } - @Test - @Description("Tests not allowed body in message") - void createThingWithWrongBody() { + /** + * Tests not allowed body in message + */ + @Test void createThingWithWrongBody() { final Message message = createMessage("Not allowed Body".getBytes(), getThingCreatedMessageProperties("3")); final String type = MessageType.THING_CREATED.name(); assertThatExceptionOfType(MessageConversionException.class) @@ -208,9 +211,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests the creation of a target/thing with specified attributes by calling the same method that incoming RabbitMQ messages would access.") - void createThingWithAttributes() { + /** + * Tests the creation of a target/thing with specified attributes by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThingWithAttributes() { final String knownThingId = "4"; final DmfAttributeUpdate attributeUpdate = dmfAttributeUpdate(); @@ -224,9 +228,10 @@ class AmqpMessageHandlerServiceTest { assertThingAttributesCapturedField(attributeUpdate.getAttributes()); } - @Test - @Description("Tests the creation of a target/thing with specified name and attributes by calling the same method that incoming RabbitMQ messages would access.") - void createThingWithNameAndAttributes() { + /** + * Tests the creation of a target/thing with specified name and attributes by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThingWithNameAndAttributes() { final String knownThingId = "5"; final String knownThingName = "NonDefaultTargetName"; @@ -242,9 +247,10 @@ class AmqpMessageHandlerServiceTest { assertThingAttributesModeCapturedField(UpdateMode.REPLACE); } - @Test - @Description("Tests the target attribute update by calling the same method that incoming RabbitMQ messages would access.") - void updateAttributes() { + /** + * Tests the target attribute update by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void updateAttributes() { final String knownThingId = "1"; final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); messageProperties.setHeader(MessageHeaderKey.THING_ID, knownThingId); @@ -262,9 +268,10 @@ class AmqpMessageHandlerServiceTest { assertThingAttributesCapturedField(attributeUpdate.getAttributes()); } - @Test - @Description("Verifies that the update mode is retrieved from the UPDATE_ATTRIBUTES message and passed to the controller management.") - void attributeUpdateModes() { + /** + * Verifies that the update mode is retrieved from the UPDATE_ATTRIBUTES message and passed to the controller management. + */ + @Test void attributeUpdateModes() { final String knownThingId = "1"; final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); messageProperties.setHeader(MessageHeaderKey.THING_ID, knownThingId); @@ -312,9 +319,10 @@ class AmqpMessageHandlerServiceTest { Map.of("testKey1", "testValue1", "testKey2", "testValue2"), mode); } - @Test - @Description("Tests the creation of a thing without a 'reply to' header in message.") - void createThingWithoutReplyTo() { + /** + * Tests the creation of a thing without a 'reply to' header in message. + */ + @Test void createThingWithoutReplyTo() { final MessageProperties messageProperties = createMessageProperties(MessageType.THING_CREATED, null); messageProperties.setHeader(MessageHeaderKey.THING_ID, "1"); final Message message = createMessage("", messageProperties); @@ -324,9 +332,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests the creation of a target/thing without a thingID by calling the same method that incoming RabbitMQ messages would access.") - void createThingWithoutID() { + /** + * Tests the creation of a target/thing without a thingID by calling the same method that incoming RabbitMQ messages would access. + */ + @Test void createThingWithoutID() { final MessageProperties messageProperties = createMessageProperties(MessageType.THING_CREATED); final Message message = createMessage(new byte[0], messageProperties); final String type = MessageType.THING_CREATED.name(); @@ -335,9 +344,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests the call of the same method that incoming RabbitMQ messages would access with an unknown message type.") - void unknownMessageType() { + /** + * Tests the call of the same method that incoming RabbitMQ messages would access with an unknown message type. + */ + @Test void unknownMessageType() { final String type = "bumlux"; final MessageProperties messageProperties = createMessageProperties(MessageType.THING_CREATED); messageProperties.setHeader(MessageHeaderKey.THING_ID, ""); @@ -348,9 +358,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests a invalid message without event topic") - void invalidEventTopic() { + /** + * Tests a invalid message without event topic + */ + @Test void invalidEventTopic() { final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); final Message message = new Message(new byte[0], messageProperties); @@ -370,9 +381,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests the update of an action of a target without a exist action id") - void updateActionStatusWithoutActionId() { + /** + * Tests the update of an action of a target without a exist action id + */ + @Test void updateActionStatusWithoutActionId() { when(controllerManagementMock.findActionWithDetails(anyLong())).thenReturn(Optional.empty()); final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); messageProperties.setHeader(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name()); @@ -384,9 +396,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests the update of an action of a target without a exist action id") - void updateActionStatusWithoutExistActionId() { + /** + * Tests the update of an action of a target without a exist action id + */ + @Test void updateActionStatusWithoutExistActionId() { final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); messageProperties.setHeader(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name()); when(controllerManagementMock.findActionWithDetails(anyLong())).thenReturn(Optional.empty()); @@ -400,9 +413,10 @@ class AmqpMessageHandlerServiceTest { VIRTUAL_HOST)); } - @Test - @Description("Tests that messages which cause quota violations are not re-added to message queue so they would block other communication.") - void quotaExceeded() { + /** + * Tests that messages which cause quota violations are not re-added to message queue so they would block other communication. + */ + @Test void quotaExceeded() { final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); messageProperties.setHeader(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name()); @@ -425,9 +439,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Test next update is provided on finished action") - void lookupNextUpdateActionAfterFinished() throws IllegalAccessException { + /** + * Test next update is provided on finished action + */ + @Test void lookupNextUpdateActionAfterFinished() throws IllegalAccessException { // Mock final Action action = createActionWithTarget(22L); @@ -462,9 +477,10 @@ class AmqpMessageHandlerServiceTest { assertThat(actionProperties.getId()).as("event has wrong action id").isEqualTo(22L); } - @Test - @Description("Test feedback code is persisted in messages when provided with DmfActionUpdateStatus") - void feedBackCodeIsPersistedInMessages() throws IllegalAccessException { + /** + * Test feedback code is persisted in messages when provided with DmfActionUpdateStatus + */ + @Test void feedBackCodeIsPersistedInMessages() throws IllegalAccessException { // Mock final Action action = createActionWithTarget(22L); when(controllerManagementMock.findActionWithDetails(anyLong())).thenReturn(Optional.of(action)); @@ -496,9 +512,10 @@ class AmqpMessageHandlerServiceTest { .contains("Device reported status code: 12"); } - @Test - @Description("Tests the deletion of a target/thing, requested by the target itself.") - void deleteThing() { + /** + * Tests the deletion of a target/thing, requested by the target itself. + */ + @Test void deleteThing() { // prepare valid message final String knownThingId = "1"; final MessageProperties messageProperties = createMessageProperties(MessageType.THING_REMOVED); @@ -512,9 +529,10 @@ class AmqpMessageHandlerServiceTest { verify(controllerManagementMock).deleteExistingTarget(knownThingId); } - @Test - @Description("Tests the deletion of a target/thing with missing thingId") - void deleteThingWithoutThingId() { + /** + * Tests the deletion of a target/thing with missing thingId + */ + @Test void deleteThingWithoutThingId() { // prepare invalid message final MessageProperties messageProperties = createMessageProperties(MessageType.THING_REMOVED); final Message message = createMessage(new byte[0], messageProperties); @@ -525,9 +543,10 @@ class AmqpMessageHandlerServiceTest { .isThrownBy(() -> amqpMessageHandlerService.onMessage(message, type, TENANT, VIRTUAL_HOST)); } - @Test - @Description("Tests activating auto-confirmation on a target.") - void setAutoConfirmationStateActive() { + /** + * Tests activating auto-confirmation on a target. + */ + @Test void setAutoConfirmationStateActive() { final String knownThingId = "1"; final String initiator = "iAmTheInitiator"; final String remark = "remarkForTesting"; @@ -551,9 +570,10 @@ class AmqpMessageHandlerServiceTest { assertRemarkCapturedField(remark); } - @Test - @Description("Tests deactivating auto-confirmation on a target.") - void setAutoConfirmationStateDeactivated() { + /** + * Tests deactivating auto-confirmation on a target. + */ + @Test void setAutoConfirmationStateDeactivated() { final String knownThingId = "1"; final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT); @@ -571,7 +591,6 @@ class AmqpMessageHandlerServiceTest { assertThingIdCapturedField(knownThingId); } - @Step private void processThingCreatedMessage(final String thingId, final DmfCreateThing payload) { final MessageProperties messageProperties = getThingCreatedMessageProperties(thingId); final Message message = createMessage(payload != null ? payload : new byte[0], messageProperties); @@ -594,42 +613,34 @@ class AmqpMessageHandlerServiceTest { amqpMessageHandlerService.onMessage(message, MessageType.THING_CREATED.name(), TENANT, VIRTUAL_HOST); } - @Step private void assertThingIdCapturedField(final String thingId) { assertThat(targetIdCaptor.getValue()).as("Thing id is wrong").isEqualTo(thingId); } - @Step private void assertReplyToCapturedField(final String replyTo) { assertThat(uriCaptor.getValue()).as("Uri is not right").hasToString("amqp://" + VIRTUAL_HOST + "/" + replyTo); } - @Step private void assertInitiatorCapturedField(final String initiator) { assertThat(initiatorCaptor.getValue()).as("Initiator is wrong").isEqualTo(initiator); } - @Step private void assertRemarkCapturedField(final String remark) { assertThat(remarkCaptor.getValue()).as("Remark is wrong").isEqualTo(remark); } - @Step private void assertThingNameCapturedField(final String thingName) { assertThat(targetNameCaptor.getValue()).as("Thing name is wrong").isEqualTo(thingName); } - @Step private void assertThingTypeCapturedField(final String thingType) { assertThat(targetTypeNameCaptor.getValue()).as("Thing type is wrong").isEqualTo(thingType); } - @Step private void assertThingAttributesCapturedField(final Map attributes) { assertThat(attributesCaptor.getValue()).as("Attributes is not right").isEqualTo(attributes); } - @Step private void assertThingAttributesModeCapturedField(final UpdateMode attributesUpdateMode) { assertThat(modeCaptor.getValue()).as("Attributes update mode is not right").isEqualTo(attributesUpdateMode); } diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/BaseAmqpServiceTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/BaseAmqpServiceTest.java index 90a439cb7..75c533d49 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/BaseAmqpServiceTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/BaseAmqpServiceTest.java @@ -15,9 +15,6 @@ import static org.mockito.Mockito.when; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.dmf.json.model.DmfActionStatus; import org.eclipse.hawkbit.dmf.json.model.DmfActionUpdateStatus; import org.eclipse.hawkbit.repository.event.remote.entity.TargetCreatedEvent; @@ -35,8 +32,10 @@ import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; import org.springframework.amqp.support.converter.MessageConversionException; @ExtendWith(MockitoExtension.class) -@Feature("Component Tests - Device Management Federation API") -@Story("Base Amqp Service Test") +/** + * Feature: Component Tests - Device Management Federation API
+ * Story: Base Amqp Service Test + */ class BaseAmqpServiceTest { @Mock @@ -49,9 +48,10 @@ class BaseAmqpServiceTest { baseAmqpService = new BaseAmqpService(rabbitTemplate); } - @Test - @Description("Verify that the message conversion works") - void convertMessageTest() { + /** + * Verify that the message conversion works + */ + @Test void convertMessageTest() { final DmfActionUpdateStatus actionUpdateStatus = createActionStatus(); when(rabbitTemplate.getMessageConverter()).thenReturn(new Jackson2JsonMessageConverter()); @@ -60,18 +60,20 @@ class BaseAmqpServiceTest { assertThat(convertedActionUpdateStatus).usingRecursiveComparison().isEqualTo(actionUpdateStatus); } - @Test - @Description("Tests invalid null message content") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Tests invalid null message content + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void convertMessageWithNullContent() { assertThatExceptionOfType(IllegalArgumentException.class) .as("Expected IllegalArgumentException for invalid (null) JSON") .isThrownBy(() -> createMessage(null)); } - @Test - @Description("Tests invalid empty message content") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Tests invalid empty message content + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void updateActionStatusWithEmptyContent() { final Message message = createMessage("".getBytes()); assertThatExceptionOfType(MessageConversionException.class) @@ -79,9 +81,10 @@ class BaseAmqpServiceTest { .isThrownBy(() -> baseAmqpService.convertMessage(message, DmfActionUpdateStatus.class)); } - @Test - @Description("Tests invalid json message content") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Tests invalid json message content + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void updateActionStatusWithInvalidJsonContent() { final Message message = createMessage("Invalid Json".getBytes()); when(rabbitTemplate.getMessageConverter()).thenReturn(new Jackson2JsonMessageConverter()); diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/RequestExceptionStrategyTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/RequestExceptionStrategyTest.java index 442ac9d84..2fe131f8f 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/RequestExceptionStrategyTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/RequestExceptionStrategyTest.java @@ -13,45 +13,48 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.amqp.rabbit.listener.FatalExceptionStrategy; import org.springframework.amqp.support.converter.MessageConversionException; -@Feature("Unit Tests - Requeue Exception Strategy") -@Story("Requeue Exception Strategy") +/** + * Feature: Unit Tests - Requeue Exception Strategy
+ * Story: Requeue Exception Strategy + */ class RequestExceptionStrategyTest { private final FatalExceptionStrategy requeueExceptionStrategy = new RequeueExceptionStrategy( List.of(new RequeueExceptionStrategy.TypeBasedFatalExceptionStrategy( IllegalArgumentException.class, IndexOutOfBoundsException.class)), null); - @Test - @Description("Verifies that default handler is used if no handlers are defined for the specific exception.") - void verifyDefaultFatal() { + /** + * Verifies that default handler is used if no handlers are defined for the specific exception. + */ + @Test void verifyDefaultFatal() { assertThat(requeueExceptionStrategy.isFatal(new MessageConversionException("t"))).as("Non Fatal error").isTrue(); assertThat(requeueExceptionStrategy.isFatal(new Throwable(new MessageConversionException("t")))).as("Non Fatal error").isTrue(); } - @Test - @Description("Verifies additional fatal exception types are fatal.") - void verifyAdditionalFatal() { + /** + * Verifies additional fatal exception types are fatal. + */ + @Test void verifyAdditionalFatal() { assertThat(requeueExceptionStrategy.isFatal(new IllegalArgumentException())).isTrue(); assertThat(requeueExceptionStrategy.isFatal(new IndexOutOfBoundsException())).isTrue(); } - @Test - @Description("Verifies additional fatal exception types are fatal.") - void verifyAdditionalWrappedFatal() { + /** + * Verifies additional fatal exception types are fatal. + */ + @Test void verifyAdditionalWrappedFatal() { assertThat(requeueExceptionStrategy.isFatal(new Throwable(new IllegalArgumentException()))).isTrue(); assertThat(requeueExceptionStrategy.isFatal(new Throwable(new IndexOutOfBoundsException()))).isTrue(); } - @Test - @Description("Verifies that default handler is used if no handlers are defined for the specific exception.") - void verifyNonFatal() { + /** + * Verifies that default handler is used if no handlers are defined for the specific exception. + */ + @Test void verifyNonFatal() { assertThat(requeueExceptionStrategy.isFatal(new NullPointerException())).isFalse(); assertThat(requeueExceptionStrategy.isFatal(new Throwable(new NullPointerException()))).isFalse(); } diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AbstractAmqpServiceIntegrationTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AbstractAmqpServiceIntegrationTest.java index dfe699d70..71fd994d4 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AbstractAmqpServiceIntegrationTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AbstractAmqpServiceIntegrationTest.java @@ -22,7 +22,6 @@ import java.util.UUID; import java.util.concurrent.Callable; import com.cronutils.utils.StringUtils; -import io.qameta.allure.Step; import org.assertj.core.api.HamcrestCondition; import org.eclipse.hawkbit.amqp.DmfApiConfiguration; import org.eclipse.hawkbit.dmf.amqp.api.AmqpSettings; @@ -254,7 +253,6 @@ abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpIntegratio return replyMessage; } - @Step protected void registerAndAssertTargetWithExistingTenant(final String controllerId) { registerAndAssertTargetWithExistingTenant(controllerId, 1); } @@ -372,7 +370,6 @@ abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpIntegratio } - @Step protected void assertUpdateAttributes(final String controllerId, final Map attributes) { waitUntilIsPresent(() -> controllerManagement.getByControllerId(controllerId)); @@ -393,7 +390,6 @@ abstract class AbstractAmqpServiceIntegrationTest extends AbstractAmqpIntegratio return AmqpSettings.DMF_EXCHANGE; } - @Step protected DistributionSet createTargetAndDistributionSetAndAssign(final String controllerId, final Action.ActionType actionType) { registerAndAssertTargetWithExistingTenant(controllerId); diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageDispatcherServiceIntegrationTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageDispatcherServiceIntegrationTest.java index fcf7e1bf0..394012a07 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageDispatcherServiceIntegrationTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageDispatcherServiceIntegrationTest.java @@ -30,9 +30,6 @@ import java.util.UUID; import java.util.concurrent.Callable; import java.util.stream.Collectors; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey; import org.eclipse.hawkbit.dmf.json.model.DmfActionRequest; @@ -83,15 +80,18 @@ import org.junit.jupiter.params.provider.EnumSource; import org.mockito.Mockito; import org.springframework.amqp.core.Message; -@Feature("Component Tests - Device Management Federation API") -@Story("Amqp Message Dispatcher Service") +/** + * Feature: Component Tests - Device Management Federation API
+ * Story: Amqp Message Dispatcher Service + */ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceIntegrationTest { private static final String TARGET_PREFIX = "Dmf_disp_"; - @Test - @Description("Verify that a distribution assignment send a download and install message.") - @ExpectEvents({ + /** + * Verify that a distribution assignment send a download and install message. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -109,9 +109,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDownloadAndInstallMessage(getDistributionSet().getModules(), controllerId); } - @Test - @Description("Verify that a distribution assignment sends a download message with window configured but before maintenance window start time.") - @ExpectEvents({ + /** + * Verify that a distribution assignment sends a download message with window configured but before maintenance window start time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -134,9 +135,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDownloadMessage(distributionSet.getModules(), controllerId); } - @Test - @Description("Verify that a distribution assignment sends a download and install message with window configured and during maintenance window start time.") - @ExpectEvents({ + /** + * Verify that a distribution assignment sends a download and install message with window configured and during maintenance window start time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -159,9 +161,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDownloadAndInstallMessage(distributionSet.getModules(), controllerId); } - @Test - @Description("Verify that a distribution assignment multiple times send cancel and assign events with right softwaremodules") - @ExpectEvents({ + /** + * Verify that a distribution assignment multiple times send cancel and assign events with right softwaremodules + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 2), @Expect(type = CancelTargetAssignmentEvent.class, count = 1), @@ -205,9 +208,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDownloadAndInstallMessage(distributionSet2.getModules(), controllerId); } - @Test - @Description("If multi assignment is enabled multi-action messages are sent.") - @ExpectEvents({ + /** + * If multi assignment is enabled multi-action messages are sent. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = MultiActionAssignEvent.class, count = 2), @Expect(type = TargetAssignDistributionSetEvent.class, count = 0), @@ -237,9 +241,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessage(controllerId, Arrays.asList(action1Install, action2Install)); } - @Test - @Description("Verify payload of multi action messages.") - void assertMultiActionMessagePayloads() { + /** + * Verify payload of multi action messages. + */ + @Test void assertMultiActionMessagePayloads() { final int expectedWeightIfNotSet = 1000; final int weight1 = 600; final String controllerId = UUID.randomUUID().toString(); @@ -286,9 +291,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt controllerId); } - @Test - @Description("Handle cancelation process of an action in multi assignment mode.") - @ExpectEvents({ + /** + * Handle cancelation process of an action in multi assignment mode. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1), @@ -325,9 +331,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessage(controllerId, Collections.singletonList(action2Install)); } - @Test - @Description("Handle finishing an action in multi assignment mode.") - @ExpectEvents({ + /** + * Handle finishing an action in multi assignment mode. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = MultiActionAssignEvent.class, count = 2), @Expect(type = TargetAttributesRequestedEvent.class, count = 1), @@ -358,9 +365,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessage(controllerId, Collections.singletonList(action2Install)); } - @Test - @Description("If multi assignment is enabled assigning a DS multiple times creates a new action every time.") - @ExpectEvents({ + /** + * If multi assignment is enabled assigning a DS multiple times creates a new action every time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = MultiActionAssignEvent.class, count = 2), @Expect(type = TargetAssignDistributionSetEvent.class, count = 0), @@ -390,9 +398,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessage(controllerId, Arrays.asList(action1Install, action2Install)); } - @Test - @Description("If multi assignment is enabled multiple rollouts with the same DS lead to multiple actions.") - @ExpectEvents({ + /** + * If multi assignment is enabled multiple rollouts with the same DS lead to multiple actions. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = MultiActionAssignEvent.class, count = 2), @Expect(type = TargetAssignDistributionSetEvent.class, count = 0), @@ -428,9 +437,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessageContainsInstallMessages(controllerId, Arrays.asList(smIds, smIds)); } - @Test - @Description("If multi assignment is enabled finishing one rollout does not affect other rollouts of the target.") - @ExpectEvents({ + /** + * If multi assignment is enabled finishing one rollout does not affect other rollouts of the target. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = MultiActionAssignEvent.class, count = 3), @Expect(type = ActionCreatedEvent.class, count = 3), @@ -479,9 +489,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertLatestMultiActionMessageContainsInstallMessages(controllerId, Collections.singletonList(smIds1)); } - @Test - @Description("Verify that a cancel assignment send a cancel message.") - @ExpectEvents({ + /** + * Verify that a cancel assignment send a cancel message. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = CancelTargetAssignmentEvent.class, count = 1), @@ -503,9 +514,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertCancelActionMessage(actionId, controllerId); } - @Test - @Description("Verify that when a target is deleted a target delete message is send.") - @ExpectEvents({ + /** + * Verify that when a target is deleted a target delete message is send. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1), @Expect(type = TargetDeletedEvent.class, count = 1) }) @@ -517,9 +529,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDeleteMessage(controllerId); } - @Test - @Description("Verify that attribute update is requested after device successfully closed software update.") - @ExpectEvents({ + /** + * Verify that attribute update is requested after device successfully closed software update. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 2), @Expect(type = ActionUpdatedEvent.class, count = 2), @@ -546,9 +559,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertRequestAttributesUpdateMessage(controllerId); } - @Test - @Description("Tests the download_only assignment: asserts correct dmf Message topic, and assigned DS") - @ExpectEvents({ + /** + * Tests the download_only assignment: asserts correct dmf Message topic, and assigned DS + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -580,15 +594,17 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertThat(assignedDistributionSet.getId()).isEqualTo(distributionSet.getId()); } - @Test - @Description("Verify payload of batch assignment download and install message.") - void assertBatchAssignmentsDownloadAndInstall() { + /** + * Verify payload of batch assignment download and install message. + */ + @Test void assertBatchAssignmentsDownloadAndInstall() { assertBatchAssignmentsMessagePayload(BATCH_DOWNLOAD_AND_INSTALL); } - @Test - @Description("Verify payload of batch assignments download only message.") - void assertBatchAssignmentsDownloadOnly() { + /** + * Verify payload of batch assignments download only message. + */ + @Test void assertBatchAssignmentsDownloadOnly() { assertBatchAssignmentsMessagePayload(BATCH_DOWNLOAD); } @@ -616,9 +632,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertThat(replyToListener.getLatestEventMessage(eventTopic)).isNull(); } - @Test - @Description("Verify that batch and multi-assignments can't be activated at the same time.") - void assertBatchAndMultiAssignmentsNotCompatible() { + /** + * Verify that batch and multi-assignments can't be activated at the same time. + */ + @Test void assertBatchAndMultiAssignmentsNotCompatible() { enableBatchAssignments(); assertThatExceptionOfType(TenantConfigurationValueChangeNotAllowedException.class) .isThrownBy(() -> enableMultiAssignments()); @@ -629,9 +646,11 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt .isThrownBy(() -> enableBatchAssignments()); } + /** + * Verify payload of batch assignments. + */ @ParameterizedTest @EnumSource(names = { "BATCH_DOWNLOAD_AND_INSTALL", "BATCH_DOWNLOAD" }) - @Description("Verify payload of batch assignments.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 3), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @@ -672,9 +691,10 @@ class AmqpMessageDispatcherServiceIntegrationTest extends AbstractAmqpServiceInt assertDmfBatchDownloadAndUpdateRequest(batchRequest, ds.getModules(), targets); } - @Test - @Description("Verify that a distribution assignment send a confirm message.") - @ExpectEvents({ + /** + * Verify that a distribution assignment send a confirm message. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageHandlerServiceIntegrationTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageHandlerServiceIntegrationTest.java index 3a7e4dd14..e2fb76931 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageHandlerServiceIntegrationTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageHandlerServiceIntegrationTest.java @@ -27,10 +27,6 @@ import java.util.UUID; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.amqp.AmqpMessageHandlerService; import org.eclipse.hawkbit.amqp.AmqpProperties; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; @@ -78,8 +74,10 @@ import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.core.RabbitAdmin; import org.springframework.beans.factory.annotation.Autowired; -@Feature("Component Tests - Device Management Federation API") -@Story("Amqp Message Handler Service") +/** + * Feature: Component Tests - Device Management Federation API
+ * Story: Amqp Message Handler Service + */ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegrationTest { static final String DMF_REGISTER_TEST_CONTROLLER_ID = "Dmf_hand_registerTargets_1"; @@ -93,9 +91,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr @Autowired private AmqpMessageHandlerService amqpMessageHandlerService; - @Test - @Description("Tests DMF PING request and expected response.") - void pingDmfInterface() { + /** + * Tests DMF PING request and expected response. + */ + @Test void pingDmfInterface() { final Message pingMessage = createPingMessage(CORRELATION_ID, TENANT_EXIST); getDmfClient().send(pingMessage); @@ -104,9 +103,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Tests register target") - @ExpectEvents({ + /** + * Tests register target + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 3) }) void registerTargets() { @@ -120,9 +120,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Tests register target with name") - @ExpectEvents({ + /** + * Tests register target with name + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) }) @@ -138,9 +139,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Tests register target with attributes") - @ExpectEvents({ + /** + * Tests register target with attributes + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 2) }) @@ -159,9 +161,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Tests register target with name and attributes") - @ExpectEvents({ + /** + * Tests register target with name and attributes + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 3), @Expect(type = TargetPollEvent.class, count = 2) }) @@ -183,9 +186,11 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } @ParameterizedTest + /** + * Tests register invalid target with empty controller id. + */ @ValueSource(strings = { "", "Invalid Invalid" }) @NullSource - @Description("Tests register invalid target with empty controller id.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void shouldNotRegisterTargetsWithInvalidControllerIds(String controllerId) { createAndSendThingCreated(controllerId); @@ -193,18 +198,20 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Tests register invalid target with too long controller id") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests register invalid target with too long controller id + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void registerInvalidTargetWithTooLongControllerId() { createAndSendThingCreated(randomString(Target.CONTROLLER_ID_MAX_SIZE + 1)); assertAllTargetsCount(0); verifyOneDeadLetterMessage(); } - @Test - @Description("Tests null reply to property in message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests null reply to property in message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void missingReplyToProperty() { final String controllerId = TARGET_PREFIX + "missingReplyToProperty"; final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST); @@ -215,9 +222,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests missing reply to property in message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests missing reply to property in message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void emptyReplyToProperty() { final String controllerId = TARGET_PREFIX + "emptyReplyToProperty"; final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST); @@ -228,9 +236,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests missing thing id property in message. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests missing thing id property in message. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void missingThingIdProperty() { final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST); createTargetMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.THING_ID); @@ -240,9 +249,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests null thing id property in message. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests null thing id property in message. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void nullThingIdProperty() { final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST); getDmfClient().send(createTargetMessage); @@ -251,9 +261,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests missing tenant message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests missing tenant message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void missingTenantHeader() { final String controllerId = TARGET_PREFIX + "missingTenantHeader"; final Message createTargetMessage = createTargetMessage(controllerId, TENANT_EXIST); @@ -264,9 +275,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests null tenant message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests null tenant message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void nullTenantHeader() { final String controllerId = TARGET_PREFIX + "nullTenantHeader"; final Message createTargetMessage = createTargetMessage(controllerId, null); @@ -276,9 +288,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests empty tenant message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests empty tenant message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void emptyTenantHeader() { final String controllerId = TARGET_PREFIX + "emptyTenantHeader"; final Message createTargetMessage = createTargetMessage(controllerId, ""); @@ -288,9 +301,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertAllTargetsCount(0); } - @Test - @Description("Tests missing type message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests missing type message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void missingTypeHeader() { final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST); createTargetMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.TYPE); @@ -301,9 +315,11 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } @ParameterizedTest + /** + * Tests null type message header. This message should forwarded to the deadletter queue + */ @ValueSource(strings = { "", "NotExist" }) @NullSource - @Description("Tests null type message header. This message should forwarded to the deadletter queue") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void shouldNotCreateTargetsWithInvalidTypeInHeader(String type) { final Message createTargetMessage = createTargetMessage(null, TENANT_EXIST); @@ -315,9 +331,11 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } @ParameterizedTest + /** + * Tests null topic message header. This message should forwarded to the deadletter queue + */ @ValueSource(strings = { "", "NotExist" }) @NullSource - @Description("Tests null topic message header. This message should forwarded to the deadletter queue") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void shouldNotSendMessagesWithInvalidTopic(String topic) { final Message eventMessage = createUpdateActionEventMessage(""); @@ -327,9 +345,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Tests missing topic message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests missing topic message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void missingTopicHeader() { final Message eventMessage = createUpdateActionEventMessage(""); eventMessage.getMessageProperties().getHeaders().remove(MessageHeaderKey.TOPIC); @@ -339,9 +358,11 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } @ParameterizedTest + /** + * Tests invalid null message content. This message should forwarded to the deadletter queue + */ @ValueSource(strings = { "", "Invalid Content" }) @NullSource - @Description("Tests invalid null message content. This message should forwarded to the deadletter queue") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void shouldMoveUpdateActionStatusWithInvalidPayloadIntoDeadLetter(String payload) { final Message eventMessage = createUpdateActionEventMessage(payload); @@ -349,9 +370,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Tests invalid topic message header. This message should forwarded to the deadletter queue") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) + /** + * Tests invalid topic message header. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void updateActionStatusWithInvalidActionId() { final DmfActionUpdateStatus actionUpdateStatus = new DmfActionUpdateStatus(1L, DmfActionStatus.RUNNING); final Message eventMessage = createUpdateActionEventMessage(actionUpdateStatus); @@ -359,9 +381,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Tests register target and send finished message") - @ExpectEvents({ + /** + * Tests register target and send finished message + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -378,9 +401,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.FINISHED, Status.FINISHED, controllerId); } - @Test - @Description("Register a target and send a update action status (running). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (running). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class), @@ -396,9 +420,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.RUNNING, Status.RUNNING, controllerId); } - @Test - @Description("Register a target and send an update action status (downloaded). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send an update action status (downloaded). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class), @@ -414,9 +439,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.DOWNLOADED, Status.DOWNLOADED, controllerId); } - @Test - @Description("Register a target and send a update action status (download). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (download). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -431,9 +457,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.DOWNLOAD, Status.DOWNLOAD, controllerId); } - @Test - @Description("Register a target and send a update action status (error). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (error). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -449,9 +476,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.ERROR, Status.ERROR, controllerId); } - @Test - @Description("Register a target and send a update action status (warning). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (warning). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -466,9 +494,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.WARNING, Status.WARNING, controllerId); } - @Test - @Description("Register a target and send a update action status (retrieved). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (retrieved). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -483,9 +512,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr registerTargetAndSendAndAssertUpdateActionStatus(DmfActionStatus.RETRIEVED, Status.RETRIEVED, controllerId); } - @Test - @Description("Register a target and send a invalid update action status (cancel). This message should forwarded to the deadletter queue") - @ExpectEvents({ + /** + * Register a target and send a invalid update action status (cancel). This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -501,9 +531,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Verify receiving a download and install message if a deployment is done before the target has polled the first time.") - @ExpectEvents({ + /** + * Verify receiving a download and install message if a deployment is done before the target has polled the first time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -530,9 +561,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Verify receiving a download message if a deployment is done with window configured but before maintenance window start time.") - @ExpectEvents({ + /** + * Verify receiving a download message if a deployment is done with window configured but before maintenance window start time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -560,9 +592,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Verify receiving a download_and_install message if a deployment is done with window configured and during maintenance window start time.") - @ExpectEvents({ + /** + * Verify receiving a download_and_install message if a deployment is done with window configured and during maintenance window start time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -590,9 +623,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Verify receiving a cancel update message if a deployment is canceled before the target has polled the first time.") - @ExpectEvents({ + /** + * Verify receiving a cancel update message if a deployment is canceled before the target has polled the first time. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -622,9 +656,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr Mockito.verifyNoInteractions(getDeadletterListener()); } - @Test - @Description("Register a target and send a invalid update action status (canceled). The current status (pending) is not a canceling state. This message should forwarded to the deadletter queue") - @ExpectEvents({ + /** + * Register a target and send a invalid update action status (canceled). The current status (pending) is not a canceling state. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -646,9 +681,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Register a target and send a invalid update action status (cancel_rejected). This message should forwarded to the deadletter queue") - @ExpectEvents({ + /** + * Register a target and send a invalid update action status (cancel_rejected). This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionCreatedEvent.class, count = 1), @@ -664,9 +700,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Register a target and send a valid update action status (cancel_rejected). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a valid update action status (cancel_rejected). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = CancelTargetAssignmentEvent.class, count = 1), @@ -692,9 +729,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } - @Test - @Description("Verify that sending an update controller attribute message to an existing target works. Verify that different update modes (merge, replace, remove) can be used.") - @ExpectEvents({ + /** + * Verify that sending an update controller attribute message to an existing target works. Verify that different update modes (merge, replace, remove) can be used. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = TargetPollEvent.class, count = 1) }) @@ -718,9 +756,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } - @Test - @Description("Verify that sending an update controller attribute message with no thingid header to an existing target does not work.") - @ExpectEvents({ + /** + * Verify that sending an update controller attribute message with no thingid header to an existing target does not work. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class), @Expect(type = TargetPollEvent.class, count = 1) }) @@ -744,9 +783,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertUpdateAttributes(controllerId, controllerAttributeEmpty.getAttributes()); } - @Test - @Description("Verify that sending an update controller attribute message with invalid body to an existing target does not work.") - @ExpectEvents({ + /** + * Verify that sending an update controller attribute message with invalid body to an existing target does not work. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class), @Expect(type = TargetPollEvent.class, count = 1) }) @@ -762,9 +802,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyOneDeadLetterMessage(); } - @Test - @Description("Verifies that sending an UPDATE_ATTRIBUTES message with invalid attributes is handled correctly.") - void updateAttributesWithInvalidValues() { + /** + * Verifies that sending an UPDATE_ATTRIBUTES message with invalid attributes is handled correctly. + */ + @Test void updateAttributesWithInvalidValues() { registerAndAssertTargetWithExistingTenant(UPDATE_ATTR_TEST_CONTROLLER_ID); sendUpdateAttributesMessageWithGivenAttributes(TargetTestData.ATTRIBUTE_KEY_TOO_LONG, TargetTestData.ATTRIBUTE_VALUE_VALID); @@ -774,9 +815,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyNumberOfDeadLetterMessages(3); } - @Test - @Description("Tests the download_only assignment: tests the handling of a target reporting DOWNLOADED") - @ExpectEvents({ + /** + * Tests the download_only assignment: tests the handling of a target reporting DOWNLOADED + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -808,9 +850,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyAssignedDsAndInstalledDs(distributionSet.getId(), null); } - @Test - @Description("Tests the download_only assignment: tests the handling of a target reporting FINISHED") - @ExpectEvents({ + /** + * Tests the download_only assignment: tests the handling of a target reporting FINISHED + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 2), @@ -850,9 +893,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr verifyAssignedDsAndInstalledDs(distributionSet.getId(), distributionSet.getId()); } - @Test - @Description("Messages that result into certain exceptions being raised should not be requeued. This message should forwarded to the deadletter queue") - @ExpectEvents({ + /** + * Messages that result into certain exceptions being raised should not be requeued. This message should forwarded to the deadletter queue + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void ignoredExceptionTypesShouldNotBeRequeued() { final ControllerManagement mockedControllerManagement = Mockito.mock(ControllerManagement.class); @@ -875,9 +919,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr } } - @Test - @Description("Register a target and send a update action status (confirmed). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (confirmed). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -903,9 +948,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertDownloadAndInstallMessage(assignmentResult.getDistributionSet().getModules(), controllerId); } - @Test - @Description("Verify the DMF confirmed feedback can be provided if confirmation flow is disabled") - @ExpectEvents({ + /** + * Verify the DMF confirmed feedback can be provided if confirmation flow is disabled + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 1), @@ -937,9 +983,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertDownloadAndInstallMessage(assignmentResult.getDistributionSet().getModules(), controllerId); } - @Test - @Description("Verify the DMF confirmed feedback can be provided if confirmation flow is disabled") - @ExpectEvents({ + /** + * Verify the DMF confirmed feedback can be provided if confirmation flow is disabled + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class, count = 0), @@ -967,9 +1014,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertActionStatusList(actionId, 2, Status.WAIT_FOR_CONFIRMATION); } - @Test - @Description("Verify the DMF download and install message is send directly if auto-confirmation is active") - @ExpectEvents({ + /** + * Verify the DMF download and install message is send directly if auto-confirmation is active + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 2), @Expect(type = TargetPollEvent.class, count = 1), @@ -1001,9 +1049,10 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertDownloadAndInstallMessage(assignmentResult.getDistributionSet().getModules(), controllerId); } - @Test - @Description("Register a target and send a update action status (denied). Verify if the updated action status is correct.") - @ExpectEvents({ + /** + * Register a target and send a update action status (denied). Verify if the updated action status is correct. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = ActionUpdatedEvent.class), @@ -1032,7 +1081,6 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr return node.get("actionId").asText(); } - @Step private void updateAttributesWithUpdateModeRemove() { // assemble the expected attributes @@ -1053,7 +1101,6 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertUpdateAttributes(DMF_ATTR_TEST_CONTROLLER_ID, expectedAttributes); } - @Step private void updateAttributesWithUpdateModeMerge() { // get the current attributes final Map attributes = new HashMap<>( @@ -1074,7 +1121,6 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertUpdateAttributes(DMF_ATTR_TEST_CONTROLLER_ID, expectedAttributes); } - @Step private void updateAttributesWithUpdateModeReplace() { // send an update message with update mode REPLACE final Map expectedAttributes = new HashMap<>(); @@ -1089,7 +1135,6 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertUpdateAttributes(DMF_ATTR_TEST_CONTROLLER_ID, expectedAttributes); } - @Step private void updateAttributesWithoutUpdateMode() { // send an update message which does not specify an update mode final Map expectedAttributes = new HashMap<>(); @@ -1103,7 +1148,6 @@ class AmqpMessageHandlerServiceIntegrationTest extends AbstractAmqpServiceIntegr assertUpdateAttributes(DMF_ATTR_TEST_CONTROLLER_ID, expectedAttributes); } - @Step private void verifyAssignedDsAndInstalledDs(final Long assignedDsId, final Long installedDsId) { final Optional target = controllerManagement.getByControllerId(DMF_REGISTER_TEST_CONTROLLER_ID); assertThat(target).isPresent(); diff --git a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/AuditFieldSerializationTest.java b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/AuditFieldSerializationTest.java index 6c2a8f1b3..ca8c6fa8e 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/AuditFieldSerializationTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/AuditFieldSerializationTest.java @@ -13,13 +13,13 @@ import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Management API") -@Story("Serialization") +/** + * Feature: Unit Tests - Management API
+ * Story: Serialization + */ class AuditFieldSerializationTest { @Test diff --git a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java index a9d074ecb..d250668bb 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java @@ -15,25 +15,26 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.ArrayList; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Management API") -@Story("Paged List Handling") +/** + * Feature: Unit Tests - Management API
+ * Story: Paged List Handling + */ class PagedListTest { - @Test - @Description("Ensures that a null payload entity throws an exception.") - void createListWithNullContentThrowsException() { + /** + * Ensures that a null payload entity throws an exception. + */ + @Test void createListWithNullContentThrowsException() { assertThatThrownBy(() -> new PagedList<>(null, 0)) .isInstanceOf(NullPointerException.class); } - @Test - @Description("Create list with payload and verify content.") - void createListWithContent() { + /** + * Create list with payload and verify content. + */ + @Test void createListWithContent() { final long knownTotal = 2; final List knownContentList = new ArrayList<>(); knownContentList.add("content1"); @@ -42,9 +43,10 @@ class PagedListTest { assertListSize(knownTotal, knownContentList); } - @Test - @Description("Create list with payload and verify size values.") - void createListWithSmallerTotalThanContentSizeIsOk() { + /** + * Create list with payload and verify size values. + */ + @Test void createListWithSmallerTotalThanContentSizeIsOk() { final long knownTotal = 0; final List knownContentList = new ArrayList<>(); knownContentList.add("content1"); diff --git a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBodyTest.java b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBodyTest.java index 9eec3bbef..fdb767421 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBodyTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBodyTest.java @@ -17,21 +17,23 @@ import java.util.List; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Description; -@Story("Retrieve all open action ids") -@Description("Tests for the MgmtTargetAssignmentResponseBody") +/** + * Feature: Tests for the MgmtTargetAssignmentResponseBody
+ * Story: Retrieve all open action ids + */ class MgmtTargetAssignmentResponseBodyTest { private static final List ASSIGNED_ACTIONS = Arrays.asList(4L, 5L, 6L); private static final int ALREADY_ASSIGNED_COUNT = 3; private static final String CONTROLLER_ID = "target"; - @Test - @Description("Tests that the ActionIds are serialized correctly in MgmtTargetAssignmentResponseBody") - void testActionIdsSerialization() throws IOException { + /** + * Tests that the ActionIds are serialized correctly in MgmtTargetAssignmentResponseBody + */ + @Test void testActionIdsSerialization() throws IOException { final MgmtTargetAssignmentResponseBody responseBody = generateResponseBody(); final ObjectMapper objectMapper = new ObjectMapper(); final String responseBodyAsString = objectMapper.writeValueAsString(responseBody); diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtActionResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtActionResourceTest.java index 2897139aa..6390cf18d 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtActionResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtActionResourceTest.java @@ -26,10 +26,6 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.TimeUnit; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.mgmt.rest.api.MgmtActionRestApi; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRepresentationMode; @@ -46,9 +42,10 @@ import org.springframework.test.web.servlet.ResultActions; /** * Integration test for the {@link MgmtActionRestApi}. + *

+ * Feature: Component Tests - Management API
+ * Story: Action Resource */ -@Feature("Component Tests - Management API") -@Story("Action Resource") class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { private static final String JSON_PATH_ROOT = "$"; @@ -64,21 +61,24 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { private static final String JSON_PATH_ACTION_ID = JSON_PATH_ROOT + JSON_PATH_FIELD_ID; - @Test - @Description("Handles the GET request of retrieving a specific action.") - public void getAction() throws Exception { + /** + * Handles the GET request of retrieving a specific action. + */ + @Test public void getAction() throws Exception { getAction(false); } - @Test - @Description("Handles the GET request of retrieving a specific action with external reference.") - public void getActionExtRef() throws Exception { + /** + * Handles the GET request of retrieving a specific action with external reference. + */ + @Test public void getActionExtRef() throws Exception { getAction(true); } - @Test - @Description("Verifies that actions can be filtered based on action status.") - void filterActionsByStatus() throws Exception { + /** + * Verifies that actions can be filtered based on action status. + */ + @Test void filterActionsByStatus() throws Exception { // prepare test final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -113,9 +113,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Verifies that actions can be filtered based on the detailed action status.") - void filterActionsByDetailStatus() throws Exception { + /** + * Verifies that actions can be filtered based on the detailed action status. + */ + @Test void filterActionsByDetailStatus() throws Exception { // prepare test final DistributionSet dsA = testdataFactory.createDistributionSet(""); assignDistributionSet(dsA, Collections.singletonList(testdataFactory.createTarget("knownTargetId"))); @@ -150,9 +151,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0].status", equalTo("pending"))); } - @Test - @Description("Verifies that actions can be filtered based on extRef.") - void filterActionsByExternalRef() throws Exception { + /** + * Verifies that actions can be filtered based on extRef. + */ + @Test void filterActionsByExternalRef() throws Exception { // prepare test final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -193,9 +195,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("size", equalTo(0))); } - @Test - @Description("Verifies that actions can be filtered based on the action status code that was reported last.") - void filterActionsByLastStatusCode() throws Exception { + /** + * Verifies that actions can be filtered based on the action status code that was reported last. + */ + @Test void filterActionsByLastStatusCode() throws Exception { // assign a distribution set to three targets final DistributionSet dsA = testdataFactory.createDistributionSet(""); final DistributionSetAssignmentResult assignmentResult = assignDistributionSet(dsA, @@ -228,9 +231,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("size", equalTo(0))); } - @Test - @Description("Verifies that actions can be filtered based on distribution set fields.") - void filterActionsByDistributionSet() throws Exception { + /** + * Verifies that actions can be filtered based on distribution set fields. + */ + @Test void filterActionsByDistributionSet() throws Exception { // prepare test final DistributionSet ds = testdataFactory.createDistributionSet(""); assignDistributionSet(ds, Collections.singletonList(testdataFactory.createTarget("knownTargetId"))); @@ -273,9 +277,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("size", equalTo(1))); } - @Test - @Description("Verifies that actions can be filtered based on rollout fields.") - void filterActionsByRollout() throws Exception { + /** + * Verifies that actions can be filtered based on rollout fields. + */ + @Test void filterActionsByRollout() throws Exception { // prepare test final DistributionSet ds = testdataFactory.createDistributionSet(); final Target target0 = testdataFactory.createTarget("t0"); @@ -314,9 +319,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { "content.[0]._links.distributionset.name", equalTo(ds.getName() + ":" + ds.getVersion()))); } - @Test - @Description("Verifies that actions can be filtered based on target fields.") - void filterActionsByTargetProperties() throws Exception { + /** + * Verifies that actions can be filtered based on target fields. + */ + @Test void filterActionsByTargetProperties() throws Exception { // prepare test final Target target = testdataFactory.createTarget("knownTargetId", "knownTargetName", "http://0.0.0.0"); final DistributionSet ds = testdataFactory.createDistributionSet(""); @@ -328,21 +334,24 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { verifyResultsByTargetPropertyFilter(target, ds, "target.address==http://0.0.0.0"); } - @Test - @Description("Verifies that all available actions are returned if the complete collection is requested.") - void getActions() throws Exception { + /** + * Verifies that all available actions are returned if the complete collection is requested. + */ + @Test void getActions() throws Exception { getActions(false); } - @Test - @Description("Verifies that all available actions (whit ext refs) are returned if the complete collection is requested.") - void getActionsExtRef() throws Exception { + /** + * Verifies that all available actions (whit ext refs) are returned if the complete collection is requested. + */ + @Test void getActionsExtRef() throws Exception { getActions(true); } - @Test - @Description("Verifies that a full representation of all actions is returned if the collection is requested for representation mode 'full'.") - void getActionsFullRepresentation() throws Exception { + /** + * Verifies that a full representation of all actions is returned if the collection is requested for representation mode 'full'. + */ + @Test void getActionsFullRepresentation() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -382,9 +391,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); } - @Test - @Description("Verifies that the get request for actions returns an empty collection if no assignments have been done yet.") - void getActionsWithEmptyResult() throws Exception { + /** + * Verifies that the get request for actions returns an empty collection if no assignments have been done yet. + */ + @Test void getActionsWithEmptyResult() throws Exception { mvc.perform(get(MgmtRestConstants.ACTION_V1_REQUEST_MAPPING)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -393,9 +403,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("total", equalTo(0))); } - @Test - @Description("Verifies paging is respected as expected.") - void getMultipleActionsWithPagingLimitRequestParameter() throws Exception { + /** + * Verifies paging is respected as expected. + */ + @Test void getMultipleActionsWithPagingLimitRequestParameter() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -444,9 +455,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies that the actions resource is read-only.") - void invalidRequestsOnActionResource() throws Exception { + /** + * Verifies that the actions resource is read-only. + */ + @Test void invalidRequestsOnActionResource() throws Exception { final String knownTargetId = "targetId"; generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -463,9 +475,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Verifies that the correct action is returned") - void shouldRetrieveCorrectActionById() throws Exception { + /** + * Verifies that the correct action is returned + */ + @Test void shouldRetrieveCorrectActionById() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -477,9 +490,10 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_ACTION_ID, equalTo(actionId.intValue()))); } - @Test - @Description("Verifies that NOT_FOUND is returned when there is no such action.") - void requestActionThatDoesNotExistsLeadsToNotFound() throws Exception { + /** + * Verifies that NOT_FOUND is returned when there is no such action. + */ + @Test void requestActionThatDoesNotExistsLeadsToNotFound() throws Exception { mvc.perform(get(MgmtRestConstants.ACTION_V1_REQUEST_MAPPING + "/" + 101)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); @@ -499,7 +513,6 @@ class MgmtActionResourceTest extends AbstractManagementApiIntegrationTest { + action.getDistributionSet().getId(); } - @Step private void verifyResultsByTargetPropertyFilter(final Target target, final DistributionSet ds, final String rsqlTargetFilter) throws Exception { // pending status one result diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtBasicAuthResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtBasicAuthResourceTest.java index e6d681b3e..05d0568b2 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtBasicAuthResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtBasicAuthResourceTest.java @@ -19,9 +19,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.Base64; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.jpa.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.repository.test.TestConfiguration; @@ -74,8 +71,10 @@ import org.springframework.web.context.WebApplicationContext; @ContextConfiguration(classes = { MgmtApiConfiguration.class, RestConfiguration.class, RepositoryApplicationConfiguration.class, TestConfiguration.class }) @Import(TestChannelBinderConfiguration.class) -@Feature("Component Tests - Management API") -@Story("Basic auth Userinfo Resource") +/** + * Feature: Component Tests - Management API
+ * Story: Basic auth Userinfo Resource + */ class MgmtBasicAuthResourceTest { @Autowired @@ -85,9 +84,10 @@ class MgmtBasicAuthResourceTest { private static final String DEFAULT_TENANT = "DEFAULT"; private static final String TEST_USER = "testUser"; - @Test - @Description("Test of userinfo api with basic auth validation") - @WithUser(principal = TEST_USER, authorities = {"READ", "WRITE", "DELETE"}) + /** + * Test of userinfo api with basic auth validation + */ + @Test @WithUser(principal = TEST_USER, authorities = {"READ", "WRITE", "DELETE"}) void validateBasicAuthWithUserDetails() throws Exception { withSecurityMock().perform(get(MgmtRestConstants.AUTH_V1_REQUEST_MAPPING)) .andDo(MockMvcResultPrinter.print()) @@ -100,9 +100,10 @@ class MgmtBasicAuthResourceTest { .andExpect(jsonPath("$.permissions", hasItems("READ", "WRITE", "DELETE"))); } - @Test - @Description("Test of userinfo api with invalid basic auth fails") - void validateBasicAuthFailsWithInvalidCredentials() throws Exception { + /** + * Test of userinfo api with invalid basic auth fails + */ + @Test void validateBasicAuthFailsWithInvalidCredentials() throws Exception { defaultMock.perform(get(MgmtRestConstants.AUTH_V1_REQUEST_MAPPING) .header(HttpHeaders.AUTHORIZATION, getBasicAuth("wrongUser", "wrongSecret"))) .andDo(MockMvcResultPrinter.print()) diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtContentTypeTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtContentTypeTest.java index fe62242be..7a1d9ecf6 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtContentTypeTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtContentTypeTest.java @@ -18,9 +18,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.Collections; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.rest.util.JsonBuilder; @@ -41,8 +38,10 @@ import org.springframework.test.web.servlet.MvcResult; */ @SpringBootTest(properties = { "server.servlet.encoding.charset=UTF-8", "server.servlet.encoding.force=true" }) @Import(HttpEncodingAutoConfiguration.class) -@Feature("Component Tests - Management API") -@Story("Response Content-Type") +/** + * Feature: Component Tests - Management API
+ * Story: Response Content-Type + */ @SuppressWarnings("java:S1874") // TODO for compatibility, to be checked if we really want to do that public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { @@ -54,9 +53,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { ds = testdataFactory.generateDistributionSet(dsName); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJsonUtf8_woAccept() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJsonUtf8_woAccept() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -69,9 +69,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaTypes.HAL_JSON_VALUE + ";charset=UTF-8", getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJsonUtf8_wAcceptJson() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJsonUtf8_wAcceptJson() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -84,9 +85,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJsonUtf8_wAcceptJsonUtf8() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJsonUtf8_wAcceptJsonUtf8() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -99,9 +101,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJsonUtf8_wAcceptHalJson() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJsonUtf8_wAcceptHalJson() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -114,9 +117,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaTypes.HAL_JSON_VALUE + ";charset=UTF-8", getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJson_woAccept() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJson_woAccept() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -129,9 +133,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaTypes.HAL_JSON_VALUE + ";charset=UTF-8", getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJson_wAcceptJson() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJson_wAcceptJson() throws Exception { final MvcResult result = mvc.perform( post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).content(JsonBuilder.distributionSets( Collections.singletonList(ds))) @@ -144,9 +149,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJson_wAcceptJsonUtf8() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJson_wAcceptJsonUtf8() throws Exception { final MvcResult result = mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) .content(JsonBuilder.distributionSets(Collections.singletonList(ds))).contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON_UTF8)) @@ -158,9 +164,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a POST request shall contain charset=utf-8") - public void postDistributionSet_ContentTypeJson_wAcceptHalJson() throws Exception { + /** + * The response of a POST request shall contain charset=utf-8 + */ + @Test public void postDistributionSet_ContentTypeJson_wAcceptHalJson() throws Exception { final MvcResult result = mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) .content(JsonBuilder.distributionSets(Collections.singletonList(ds))).contentType(MediaType.APPLICATION_JSON) .accept(MediaTypes.HAL_JSON)) @@ -172,9 +179,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaTypes.HAL_JSON_VALUE + ";charset=UTF-8", getResponseHeaderContentType(result)); } - @Test - @Description("The response of a GET request shall contain charset=utf-8") - public void getDistributionSet_woAccept() throws Exception { + /** + * The response of a GET request shall contain charset=utf-8 + */ + @Test public void getDistributionSet_woAccept() throws Exception { final MvcResult result = mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -183,9 +191,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaTypes.HAL_JSON_VALUE + ";charset=UTF-8", getResponseHeaderContentType(result)); } - @Test - @Description("The response of a GET request shall contain charset=utf-8") - public void getDistributionSet_wAcceptJson() throws Exception { + /** + * The response of a GET request shall contain charset=utf-8 + */ + @Test public void getDistributionSet_wAcceptJson() throws Exception { final MvcResult result = mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -194,9 +203,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a GET request shall contain charset=utf-8") - public void getDistributionSet_wAcceptJsonUtf8() throws Exception { + /** + * The response of a GET request shall contain charset=utf-8 + */ + @Test public void getDistributionSet_wAcceptJsonUtf8() throws Exception { final MvcResult result = mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).accept(MediaType.APPLICATION_JSON_UTF8)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -205,9 +215,10 @@ public class MgmtContentTypeTest extends AbstractManagementApiIntegrationTest { assertEquals(MediaType.APPLICATION_JSON_UTF8_VALUE, getResponseHeaderContentType(result)); } - @Test - @Description("The response of a GET request shall contain charset=utf-8") - public void getDistributionSet_wAcceptHalJson() throws Exception { + /** + * The response of a GET request shall contain charset=utf-8 + */ + @Test public void getDistributionSet_wAcceptHalJson() throws Exception { final MvcResult result = mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING).accept(MediaTypes.HAL_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java index f15d6b3e4..ea724d1db 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java @@ -37,10 +37,6 @@ import java.util.stream.IntStream; import java.util.stream.Stream; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -79,16 +75,19 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; import org.springframework.util.Assert; -@Feature("Component Tests - Management API") -@Story("Distribution Set Resource") +/** + * Feature: Component Tests - Management API
+ * Story: Distribution Set Resource + */ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTest { @Autowired ActionRepository actionRepository; - @Test - @Description("This test verifies the call of all Software Modules that are assigned to a Distribution Set through the RESTful API.") - void getSoftwareModules() throws Exception { + /** + * This test verifies the call of all Software Modules that are assigned to a Distribution Set through the RESTful API. + */ + @Test void getSoftwareModules() throws Exception { // Create DistributionSet with three software modules final DistributionSet set = testdataFactory.createDistributionSet("SMTest"); mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) @@ -97,9 +96,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.size", equalTo(set.getModules().size()))); } - @Test - @Description("Handles the GET request of retrieving assigned software modules of a single distribution set within SP with given page size and offset including sorting by version descending and filter down to all sets which name starts with 'one'.") - void getSoftwareModulesWithParameters() throws Exception { + /** + * Handles the GET request of retrieving assigned software modules of a single distribution set within SP with given page size and offset including sorting by version descending and filter down to all sets which name starts with 'one'. + */ + @Test void getSoftwareModulesWithParameters() throws Exception { final DistributionSet set = testdataFactory.createUpdatedDistributionSet(); // post assignment @@ -111,9 +111,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } - @Test - @Description("This test verifies the deletion of a assigned Software Module of a Distribution Set can not be achieved when that Distribution Set has been assigned or installed to a target.") - void deleteFailureWhenDistributionSetInUse() throws Exception { + /** + * This test verifies the deletion of a assigned Software Module of a Distribution Set can not be achieved when that Distribution Set has been assigned or installed to a target. + */ + @Test void deleteFailureWhenDistributionSetInUse() throws Exception { // create DisSet final DistributionSet disSet = testdataFactory.createDistributionSetWithNoSoftwareModules("Eris", "560a"); final List smIDs = new ArrayList<>(); @@ -155,9 +156,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_REPO_ENTITY_READ_ONLY.getKey()))); } - @Test - @Description("This test verifies that the assignment of a Software Module to a Distribution Set can not be achieved when that Distribution Set has been assigned or installed to a target.") - void assignmentFailureWhenAssigningToUsedDistributionSet() throws Exception { + /** + * This test verifies that the assignment of a Software Module to a Distribution Set can not be achieved when that Distribution Set has been assigned or installed to a target. + */ + @Test void assignmentFailureWhenAssigningToUsedDistributionSet() throws Exception { // create DisSet final DistributionSet disSet = testdataFactory.createDistributionSetWithNoSoftwareModules("Mars", "686,980"); final List smIDs = new ArrayList<>(); @@ -198,9 +200,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_REPO_ENTITY_READ_ONLY.getKey()))); } - @Test - @Description("This test verifies the assignment of Software Modules to a Distribution Set through the RESTful API.") - void assignSoftwareModuleToDistributionSet() throws Exception { + /** + * This test verifies the assignment of Software Modules to a Distribution Set through the RESTful API. + */ + @Test void assignSoftwareModuleToDistributionSet() throws Exception { // create DisSet final DistributionSet disSet = testdataFactory.createDistributionSetWithNoSoftwareModules("Jupiter", "398,88"); // Test if size is 0 @@ -269,9 +272,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } - @Test - @Description("This test verifies the removal of Software Modules of a Distribution Set through the RESTful API.") - void unassignSoftwareModuleFromDistributionSet() throws Exception { + /** + * This test verifies the removal of Software Modules of a Distribution Set through the RESTful API. + */ + @Test void unassignSoftwareModuleFromDistributionSet() throws Exception { // Create DistributionSet with three software modules final DistributionSet set = testdataFactory.createDistributionSet("Venus"); int amountOfSM = set.getModules().size(); @@ -292,9 +296,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } } - @Test - @Description("Ensures that multi target assignment through API is reflected by the repository.") - void assignMultipleTargetsToDistributionSet() throws Exception { + /** + * Ensures that multi target assignment through API is reflected by the repository. + */ + @Test void assignMultipleTargetsToDistributionSet() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -315,9 +320,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .as("Five targets in repository have DS assigned").hasSize(5); } - @Test - @Description("Ensures that targets can be assigned even if the specified controller IDs are in different case (e.g. 'TARGET1' instead of 'target1'.") - void assignTargetsToDistributionSetIgnoreCase() throws Exception { + /** + * Ensures that targets can be assigned even if the specified controller IDs are in different case (e.g. 'TARGET1' instead of 'target1'. + */ + @Test void assignTargetsToDistributionSetIgnoreCase() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -338,9 +344,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe // we just need to make sure that no error 500 is returned } - @Test - @Description("Trying to create a DS from already marked as deleted type - should get as response 400 Bad Request") - void createDsFromAlreadyMarkedAsDeletedType() throws Exception { + /** + * Trying to create a DS from already marked as deleted type - should get as response 400 Bad Request + */ + @Test void createDsFromAlreadyMarkedAsDeletedType() throws Exception { final SoftwareModule softwareModule = testdataFactory.createSoftwareModule("exampleKey"); final DistributionSetType type = testdataFactory.findOrCreateDistributionSetType( "testKey", "testType", Collections.singletonList(softwareModule.getType()), @@ -378,9 +385,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertTrue(exceptionInfo.getMessage().contains("Distribution Set Type already deleted")); } - @Test - @Description("Ensures that multi target assignment is protected by our getMaxTargetDistributionSetAssignmentsPerManualAssignment quota.") - void assignMultipleTargetsToDistributionSetUntilQuotaIsExceeded() throws Exception { + /** + * Ensures that multi target assignment is protected by our getMaxTargetDistributionSetAssignmentsPerManualAssignment quota. + */ + @Test void assignMultipleTargetsToDistributionSetUntilQuotaIsExceeded() throws Exception { final int maxActions = quotaManagement.getMaxTargetDistributionSetAssignmentsPerManualAssignment(); final List targets = testdataFactory.createTargets(maxActions + 1); final DistributionSet ds = testdataFactory.createDistributionSet(); @@ -401,9 +409,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(targetManagement.findByAssignedDistributionSet(ds.getId(), PAGE).getContent()).isEmpty(); } - @Test - @Description("Ensures that the 'max actions per target' quota is enforced if the distribution set assignment of a target is changed permanently") - void changeDistributionSetAssignmentForTargetUntilQuotaIsExceeded() throws Exception { + /** + * Ensures that the 'max actions per target' quota is enforced if the distribution set assignment of a target is changed permanently + */ + @Test void changeDistributionSetAssignmentForTargetUntilQuotaIsExceeded() throws Exception { // create one target final Target testTarget = testdataFactory.createTarget("trg1"); @@ -427,9 +436,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isForbidden()); } - @Test - @Description("Ensures that offline reported multi target assignment through API is reflected by the repository.") - void offlineAssignmentOfMultipleTargetsToDistributionSet() throws Exception { + /** + * Ensures that offline reported multi target assignment through API is reflected by the repository. + */ + @Test void offlineAssignmentOfMultipleTargetsToDistributionSet() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); final List targets = testdataFactory.createTargets(5); final JSONArray list = new JSONArray(); @@ -457,9 +467,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(targetManagement.findByInstalledDistributionSet(createdDs.getId(), PAGE).getContent()).hasSize(4); } - @Test - @Description("Assigns multiple targets to distribution set with only maintenance schedule.") - void assignMultipleTargetsToDistributionSetWithMaintenanceWindowStartOnly() throws Exception { + /** + * Assigns multiple targets to distribution set with only maintenance schedule. + */ + @Test void assignMultipleTargetsToDistributionSetWithMaintenanceWindowStartOnly() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -474,9 +485,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isBadRequest()); } - @Test - @Description("Assigns multiple targets to distribution set with only maintenance window duration.") - void assignMultipleTargetsToDistributionSetWithMaintenanceWindowEndOnly() throws Exception { + /** + * Assigns multiple targets to distribution set with only maintenance window duration. + */ + @Test void assignMultipleTargetsToDistributionSetWithMaintenanceWindowEndOnly() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -491,9 +503,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isBadRequest()); } - @Test - @Description("Assigns multiple targets to distribution set with valid maintenance window.") - void assignMultipleTargetsToDistributionSetWithValidMaintenanceWindow() throws Exception { + /** + * Assigns multiple targets to distribution set with valid maintenance window. + */ + @Test void assignMultipleTargetsToDistributionSetWithValidMaintenanceWindow() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -509,9 +522,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isOk()); } - @Test - @Description("Assigns multiple targets to distribution set with last maintenance window scheduled before current time.") - void assignMultipleTargetsToDistributionSetWithMaintenanceWindowEndTimeBeforeStartTime() throws Exception { + /** + * Assigns multiple targets to distribution set with last maintenance window scheduled before current time. + */ + @Test void assignMultipleTargetsToDistributionSetWithMaintenanceWindowEndTimeBeforeStartTime() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -527,9 +541,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isBadRequest()); } - @Test - @Description("Assigns multiple targets to distribution set with and without maintenance window.") - void assignMultipleTargetsToDistributionSetWithAndWithoutMaintenanceWindow() throws Exception { + /** + * Assigns multiple targets to distribution set with and without maintenance window. + */ + @Test void assignMultipleTargetsToDistributionSetWithAndWithoutMaintenanceWindow() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); // prepare targets @@ -554,9 +569,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isOk()); } - @Test - @Description("Assigning distribution set to the list of targets with a non-existing one leads to successful assignment of valid targets, while not found targets are silently ignored.") - void assignNotExistingTargetToDistributionSet() throws Exception { + /** + * Assigning distribution set to the list of targets with a non-existing one leads to successful assignment of valid targets, while not found targets are silently ignored. + */ + @Test void assignNotExistingTargetToDistributionSet() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); final String[] knownTargetIds = new String[] { "1", "2", "3" }; @@ -574,9 +590,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.total", equalTo(3))); } - @Test - @Description("Ensures that assigned targets of DS are returned as reflected by the repository.") - void getAssignedTargetsOfDistributionSet() throws Exception { + /** + * Ensures that assigned targets of DS are returned as reflected by the repository. + */ + @Test void getAssignedTargetsOfDistributionSet() throws Exception { // prepare distribution set final String knownTargetId = "knownTargetId1"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -589,9 +606,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.content[0].controllerId", equalTo(knownTargetId))); } - @Test - @Description("Handles the GET request for retrieving assigned targets of a single distribution set with a defined page size and offset, sorted by name in descending order and filtered down to all targets which controllerID starts with 'target'.") - void getAssignedTargetsOfDistributionSetWithParameters() throws Exception { + /** + * Handles the GET request for retrieving assigned targets of a single distribution set with a defined page size and offset, sorted by name in descending order and filtered down to all targets which controllerID starts with 'target'. + */ + @Test void getAssignedTargetsOfDistributionSetWithParameters() throws Exception { final DistributionSet set = testdataFactory.createUpdatedDistributionSet(); assignDistributionSet(set, testdataFactory.createTargets(5, "targetMisc", "Test targets for query")) @@ -606,9 +624,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } - @Test - @Description("Ensures that assigned targets of DS are returned as persisted in the repository.") - void getAssignedTargetsOfDistributionSetIsEmpty() throws Exception { + /** + * Ensures that assigned targets of DS are returned as persisted in the repository. + */ + @Test void getAssignedTargetsOfDistributionSetIsEmpty() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); mvc.perform(get( MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets")) @@ -617,9 +636,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.total", equalTo(0))); } - @Test - @Description("Ensures that installed targets of DS are returned as persisted in the repository.") - void getInstalledTargetsOfDistributionSet() throws Exception { + /** + * Ensures that installed targets of DS are returned as persisted in the repository. + */ + @Test void getInstalledTargetsOfDistributionSet() throws Exception { // prepare distribution set final String knownTargetId = "knownTargetId1"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -640,9 +660,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.content[0].controllerId", equalTo(knownTargetId))); } - @Test - @Description("Handles the GET request for retrieving installed targets of a single distribution set with a defined page size and offset, sortet by name in descending order and filtered down to all targets which controllerID starts with 'target'.") - void getInstalledTargetsOfDistributionSetWithParameters() throws Exception { + /** + * Handles the GET request for retrieving installed targets of a single distribution set with a defined page size and offset, sortet by name in descending order and filtered down to all targets which controllerID starts with 'target'. + */ + @Test void getInstalledTargetsOfDistributionSetWithParameters() throws Exception { final DistributionSet set = testdataFactory.createUpdatedDistributionSet(); final List targets = assignDistributionSet(set, @@ -658,9 +679,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(content().contentType(MediaType.APPLICATION_JSON)); } - @Test - @Description("Ensures that target filters with auto assign DS are returned as persisted in the repository.") - void getAutoAssignTargetFiltersOfDistributionSet() throws Exception { + /** + * Ensures that target filters with auto assign DS are returned as persisted in the repository. + */ + @Test void getAutoAssignTargetFiltersOfDistributionSet() throws Exception { // prepare distribution set final String knownFilterName = "a"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -679,9 +701,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.content[0].name", equalTo(knownFilterName))); } - @Test - @Description("Handles the GET request for retrieving assigned target filter queries of a single distribution set with a defined page size and offset, sorted by name in descending order and filtered down to all targets with a name that ends with '1'.") - void ggetAutoAssignTargetFiltersOfDistributionSetWithParameters() throws Exception { + /** + * Handles the GET request for retrieving assigned target filter queries of a single distribution set with a defined page size and offset, sorted by name in descending order and filtered down to all targets with a name that ends with '1'. + */ + @Test void ggetAutoAssignTargetFiltersOfDistributionSetWithParameters() throws Exception { final DistributionSet set = testdataFactory.createUpdatedDistributionSet(); targetFilterQueryManagement.create(entityFactory.targetFilterQuery().create().name("filter1").query("name==a") .autoAssignDistributionSet(set)); @@ -695,9 +718,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } - @Test - @Description("Ensures that an error is returned when the query is invalid.") - void getAutoAssignTargetFiltersOfDSWithInvalidFilter() throws Exception { + /** + * Ensures that an error is returned when the query is invalid. + */ + @Test void getAutoAssignTargetFiltersOfDSWithInvalidFilter() throws Exception { // prepare distribution set final DistributionSet createdDs = testdataFactory.createDistributionSet(); final String invalidQuery = "unknownField=le=42"; @@ -707,9 +731,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isBadRequest()); } - @Test - @Description("Ensures that target filters with auto assign DS are returned according to the query.") - void getMultipleAutoAssignTargetFiltersOfDistributionSet() throws Exception { + /** + * Ensures that target filters with auto assign DS are returned according to the query. + */ + @Test void getMultipleAutoAssignTargetFiltersOfDistributionSet() throws Exception { final String filterNamePrefix = "filter-"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); final String query = "name==" + filterNamePrefix + "*"; @@ -724,9 +749,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.content[1].name", equalTo(filterNamePrefix + "2"))); } - @Test - @Description("Ensures that no target filters are returned according to the non matching query.") - void getEmptyAutoAssignTargetFiltersOfDistributionSet() throws Exception { + /** + * Ensures that no target filters are returned according to the non matching query. + */ + @Test void getEmptyAutoAssignTargetFiltersOfDistributionSet() throws Exception { final String filterNamePrefix = "filter-"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); final String query = "name==doesNotExist"; @@ -739,9 +765,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("$.size", equalTo(0))); } - @Test - @Description("Ensures that DS in repository are listed with proper paging properties.") - void getDistributionSetsWithoutAdditionalRequestParameters() throws Exception { + /** + * Ensures that DS in repository are listed with proper paging properties. + */ + @Test void getDistributionSetsWithoutAdditionalRequestParameters() throws Exception { final int sets = 5; createDistributionSetsAlphabetical(sets); mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)) @@ -752,9 +779,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(sets))); } - @Test - @Description("Ensures that DS in repository are listed with proper paging results with paging limit parameter.") - void getDistributionSetsWithPagingLimitRequestParameter() throws Exception { + /** + * Ensures that DS in repository are listed with proper paging results with paging limit parameter. + */ + @Test void getDistributionSetsWithPagingLimitRequestParameter() throws Exception { final int sets = 5; final int limitSize = 1; createDistributionSetsAlphabetical(sets); @@ -767,9 +795,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Ensures that DS in repository are listed with proper paging results with paging limit and offset parameter.") - void getDistributionSetsWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Ensures that DS in repository are listed with proper paging results with paging limit and offset parameter. + */ + @Test void getDistributionSetsWithPagingLimitAndOffsetRequestParameter() throws Exception { final int sets = 5; final int offsetParam = 2; final int expectedSize = sets - offsetParam; @@ -784,9 +813,11 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } + /** + * Ensures that multiple DS requested are listed with expected payload. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Ensures that multiple DS requested are listed with expected payload.") void getDistributionSets() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -826,9 +857,11 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe contains(getOsModule(set).intValue()))); } + /** + * Ensures that single DS requested by ID is listed with expected payload. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Ensures that single DS requested by ID is listed with expected payload.") void getDistributionSet() throws Exception { final DistributionSet set = testdataFactory.createUpdatedDistributionSet(); @@ -860,9 +893,11 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } + /** + * Ensures that multipe DS posted to API are created in the repository. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Ensures that multipe DS posted to API are created in the repository.") void createDistributionSets() throws Exception { assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); final SoftwareModule ah = testdataFactory.createSoftwareModule(TestdataFactory.SM_TYPE_APP); @@ -917,9 +952,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(three.getCreatedAt()).isGreaterThanOrEqualTo(current); } - @Test - @Description("Ensures that DS deletion request to API is reflected by the repository.") - void deleteUnassignedistributionSet() throws Exception { + /** + * Ensures that DS deletion request to API is reflected by the repository. + */ + @Test void deleteUnassignedistributionSet() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -937,17 +973,19 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.count()).isZero(); } - @Test - @Description("Ensures that DS deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteDistributionSetThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that DS deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteDistributionSetThatDoesNotExistLeadsToNotFound() throws Exception { mvc.perform(delete("/rest/v1/distributionsets/1234")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that assigned DS deletion request to API is reflected by the repository by means of deleted flag set.") - void deleteAssignedDistributionSet() throws Exception { + /** + * Ensures that assigned DS deletion request to API is reflected by the repository by means of deleted flag set. + */ + @Test void deleteAssignedDistributionSet() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -975,9 +1013,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); } - @Test - @Description("Ensures that DS property update request to API is reflected by the repository.") - void updateDistributionSet() throws Exception { + /** + * Ensures that DS property update request to API is reflected by the repository. + */ + @Test void updateDistributionSet() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -1004,9 +1043,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(setupdated.isDeleted()).isFalse(); } - @Test - @Description("Ensures that DS property update on requiredMigrationStep fails if DS is assigned to a target.") - void updateRequiredMigrationStepFailsIfDistributionSetisInUse() throws Exception { + /** + * Ensures that DS property update on requiredMigrationStep fails if DS is assigned to a target. + */ + @Test void updateRequiredMigrationStepFailsIfDistributionSetisInUse() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -1029,9 +1069,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(setupdated.getName()).isEqualTo(set.getName()); } - @Test - @Description("Ensures that the server reacts properly to invalid requests (URI, Media Type, Methods) with correct reponses.") - void invalidRequestsOnDistributionSetsResource() throws Exception { + /** + * Ensures that the server reacts properly to invalid requests (URI, Media Type, Methods) with correct reponses. + */ + @Test void invalidRequestsOnDistributionSetsResource() throws Exception { final DistributionSet set = testdataFactory.createDistributionSet("one"); final List sets = new ArrayList<>(); @@ -1090,9 +1131,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } - @Test - @Description("Ensures that the metadata creation through API is reflected by the repository.") - void createMetadata() throws Exception { + /** + * Ensures that the metadata creation through API is reflected by the repository. + */ + @Test void createMetadata() throws Exception { final DistributionSet testDS = testdataFactory.createDistributionSet("one"); final String knownKey1 = "known.key.1.1"; @@ -1132,9 +1174,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.getMetadata(testDS.getId())).hasSize(metaData1.length()); } - @Test - @Description("Ensures that a metadata update through API is reflected by the repository.") - void updateMetadata() throws Exception { + /** + * Ensures that a metadata update through API is reflected by the repository. + */ + @Test void updateMetadata() throws Exception { // prepare and create metadata for update final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1153,9 +1196,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.getMetadata(testDS.getId()).get(knownKey)).isEqualTo(updateValue); } - @Test - @Description("Ensures that a metadata entry deletion through API is reflected by the repository.") - void deleteMetadata() throws Exception { + /** + * Ensures that a metadata entry deletion through API is reflected by the repository. + */ + @Test void deleteMetadata() throws Exception { // prepare and create metadata for deletion final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1175,9 +1219,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.getMetadata(testDS.getId()).get(knownKey)).isNull(); } - @Test - @Description("Ensures that DS metadata deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteMetadataThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that DS metadata deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteMetadataThatDoesNotExistLeadsToNotFound() throws Exception { // prepare and create metadata for deletion final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1195,9 +1240,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(distributionSetManagement.getMetadata(testDS.getId()).get(knownKey)).isNotNull(); } - @Test - @Description("Ensures that a metadata entry selection through API reflects the repository content.") - void getMetadataKey() throws Exception { + /** + * Ensures that a metadata entry selection through API reflects the repository content. + */ + @Test void getMetadataKey() throws Exception { // prepare and create metadata final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1211,9 +1257,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("value", equalTo(knownValue))); } - @Test - @Description("Get a paged list of meta data for a distribution set with standard page size.") - void getMetadata() throws Exception { + /** + * Get a paged list of meta data for a distribution set with standard page size. + */ + @Test void getMetadata() throws Exception { final int totalMetadata = 4; final String knownKeyPrefix = "knownKey"; final String knownValuePrefix = "knownValue"; @@ -1228,9 +1275,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(content().contentType(MediaTypes.HAL_JSON)); } - @Test - @Description("Ensures that a DS search with query parameters returns the expected result.") - void searchDistributionSetRsql() throws Exception { + /** + * Ensures that a DS search with query parameters returns the expected result. + */ + @Test void searchDistributionSetRsql() throws Exception { final String dsSuffix = "test"; final int amount = 10; testdataFactory.createDistributionSets(dsSuffix, amount); @@ -1249,9 +1297,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } - @Test - @Description("Ensures that a DS search with complete==true parameter returns only DS that are actually completely filled with mandatory modules.") - void filterDistributionSetComplete() throws Exception { + /** + * Ensures that a DS search with complete==true parameter returns only DS that are actually completely filled with mandatory modules. + */ + @Test void filterDistributionSetComplete() throws Exception { final int amount = 10; testdataFactory.createDistributionSets(amount); distributionSetManagement @@ -1266,9 +1315,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("total", equalTo(10))); } - @Test - @Description("Ensures that a DS assigned target search with controllerId==1 parameter returns only the target with the given ID.") - void searchDistributionSetAssignedTargetsRsql() throws Exception { + /** + * Ensures that a DS assigned target search with controllerId==1 parameter returns only the target with the given ID. + */ + @Test void searchDistributionSetAssignedTargetsRsql() throws Exception { // prepare distribution set final Set createDistributionSetsAlphabetical = createDistributionSetsAlphabetical(1); final DistributionSet createdDs = createDistributionSetsAlphabetical.iterator().next(); @@ -1291,9 +1341,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("content[0].controllerId", equalTo("1"))); } + /** + * Ensures that multi target assignment through API is reflected by the repository in the case of DOWNLOAD_ONLY. + */ @Test - @Description("Ensures that multi target assignment through API is reflected by the repository in the case of " - + "DOWNLOAD_ONLY.") void assignMultipleTargetsToDistributionSetAsDownloadOnly() throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -1314,9 +1365,11 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .as("Five targets in repository have DS assigned").hasSize(5); } + /** + * Ensures that confirmation option is considered in assignment request. + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Ensures that confirmation option is considered in assignment request.") void assignTargetsToDistributionSetWithConfirmationOptions(final boolean confirmationFlowActive, final Boolean confirmationRequired) throws Exception { final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -1349,9 +1402,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe }); } - @Test - @Description("A request for assigning a target multiple times results in a Bad Request when multiassignment is disabled.") - void multiAssignmentRequestNotAllowedIfDisabled() throws Exception { + /** + * A request for assigning a target multiple times results in a Bad Request when multiassignment is disabled. + */ + @Test void multiAssignmentRequestNotAllowedIfDisabled() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -1365,9 +1419,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(status().isBadRequest()); } - @Test - @Description("Identical assignments in a single request are removed when multiassignment is disabled.") - void identicalAssignmentInRequestAreRemovedIfMultiassignmentsDisabled() throws Exception { + /** + * Identical assignments in a single request are removed when multiassignment is disabled. + */ + @Test void identicalAssignmentInRequestAreRemovedIfMultiassignmentsDisabled() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -1382,9 +1437,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("total", equalTo(1))); } - @Test - @Description("Assigning targets multiple times to a DS in one request works in multiassignment mode.") - void multiAssignment() throws Exception { + /** + * Assigning targets multiple times to a DS in one request works in multiassignment mode. + */ + @Test void multiAssignment() throws Exception { final List targetIds = testdataFactory.createTargets(2).stream().map(Target::getControllerId) .toList(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -1403,9 +1459,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("total", equalTo(body.length()))); } - @Test - @Description("An assignment request containing a weight is only accepted when weight is valide and multi assignment is on.") - void weightValidation() throws Exception { + /** + * An assignment request containing a weight is only accepted when weight is valide and multi assignment is on. + */ + @Test void weightValidation() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); final int weight = 78; @@ -1434,9 +1491,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(actions.get(0).getWeight()).get().isEqualTo(weight); } - @Test - @Description("Request to get the count of all Rollouts by status for specific Distribution set") - void statisticsForRolloutsCountByStatus() throws Exception { + /** + * Request to get the count of all Rollouts by status for specific Distribution set + */ + @Test void statisticsForRolloutsCountByStatus() throws Exception { testdataFactory.createTargets("targets", 4); DistributionSet ds1 = testdataFactory.createDistributionSet("DS1"); DistributionSet ds2 = testdataFactory.createDistributionSet("DS2"); @@ -1467,9 +1525,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("totalAutoAssignments").doesNotExist()); } - @Test - @Description("Request to get the count of all Actions by status for specific Distribution set") - void statisticsForActionsCountByStatus() throws Exception { + /** + * Request to get the count of all Actions by status for specific Distribution set + */ + @Test void statisticsForActionsCountByStatus() throws Exception { testdataFactory.createTargets("targets", 4); DistributionSet ds1 = testdataFactory.createDistributionSet("DS1"); @@ -1498,9 +1557,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("totalAutoAssignments").doesNotExist()); } - @Test - @Description("Request to get the count of all Auto Assignments for specific Distribution set") - void statisticsForAutoAssignmentsCount() throws Exception { + /** + * Request to get the count of all Auto Assignments for specific Distribution set + */ + @Test void statisticsForAutoAssignmentsCount() throws Exception { testdataFactory.createTargets("targets", 4); DistributionSet ds1 = testdataFactory.createDistributionSet("DS1"); DistributionSet ds2 = testdataFactory.createDistributionSet("DS2"); @@ -1530,9 +1590,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("totalAutoAssignments").doesNotExist()); } - @Test - @Description("Request to get full Statistics for specific Distribution set") - void statisticsForDistributionSet() throws Exception { + /** + * Request to get full Statistics for specific Distribution set + */ + @Test void statisticsForDistributionSet() throws Exception { testdataFactory.createTargets("targets", 4); testdataFactory.createTargets("autoAssignments", 4); DistributionSet ds1 = testdataFactory.createDistributionSet("DS1"); @@ -1566,9 +1627,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .andExpect(jsonPath("totalAutoAssignments").doesNotExist()); } - @Test - @Description("Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and cancels assignments") - void invalidateDistributionSet() throws Exception { + /** + * Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and cancels assignments + */ + @Test void invalidateDistributionSet() throws Exception { final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final List targets = testdataFactory.createTargets(5, "invalidateDistributionSet"); assignDistributionSet(distributionSet, targets); @@ -1600,9 +1662,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe } } - @Test - @Description("Tests the lock. It is verified that the distribution set can be marked as locked through update operation.") - void lockDistributionSet() throws Exception { + /** + * Tests the lock. It is verified that the distribution set can be marked as locked through update operation. + */ + @Test void lockDistributionSet() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -1622,9 +1685,10 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe assertThat(updatedSet.isLocked()).isTrue(); } - @Test - @Description("Tests the unlock.") - void unlockDistributionSet() throws Exception { + /** + * Tests the unlock. + */ + @Test void unlockDistributionSet() throws Exception { // prepare test data assertThat(distributionSetManagement.findByCompleted(true, PAGE)).isEmpty(); @@ -1699,7 +1763,6 @@ class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegrationTe .create(entityFactory.targetFilterQuery().create().name(filterNamePrefix + "c").query("name==y")); } - @Step private MvcResult executeMgmtTargetPost(final DistributionSet one, final DistributionSet two, final DistributionSet three) throws Exception { return mvc diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResourceTest.java index 46ae4940f..f7bc2d55d 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResourceTest.java @@ -27,9 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.mgmt.rest.resource.util.ResourceUtility; import org.eclipse.hawkbit.repository.event.remote.DistributionSetTagDeletedEvent; @@ -51,16 +48,19 @@ import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.ResultActions; -@Feature("Component Tests - Management API") -@Story("Distribution Set Tag Resource") +/** + * Feature: Component Tests - Management API
+ * Story: Distribution Set Tag Resource + */ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegrationTest { private static final String DISTRIBUTIONSETTAGS_ROOT = "http://localhost" + MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "/"; private static final Random RND = new Random(); - @Test - @Description("Verifies that a paged result list of DS tags reflects the content on the repository side.") - @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that a paged result list of DS tags reflects the content on the repository side. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) void getDistributionSetTags() throws Exception { final List tags = testdataFactory.createDistributionSetTags(2); final DistributionSetTag assigned = tags.get(0); @@ -79,18 +79,20 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); } - @Test - @Description("Handles the GET request of retrieving all distribution set tags based by parameter") - void getDistributionSetTagsWithParameters() throws Exception { + /** + * Handles the GET request of retrieving all distribution set tags based by parameter + */ + @Test void getDistributionSetTagsWithParameters() throws Exception { testdataFactory.createDistributionSetTags(2); mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==DsTag")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); } - @Test - @Description("Verifies that a paged result list of DS tags reflects the content on the repository side when filtered by distribution set id.") - void getDistributionSetTagsByDistributionSetId() throws Exception { + /** + * Verifies that a paged result list of DS tags reflects the content on the repository side when filtered by distribution set id. + */ + @Test void getDistributionSetTagsByDistributionSetId() throws Exception { final List tags = testdataFactory.createDistributionSetTags(2); final DistributionSetTag tag1 = tags.get(0); final DistributionSetTag tag2 = tags.get(1); @@ -127,9 +129,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies that a paged result list of DS tags reflects the content on the repository side when filtered by distribution set id field AND tag field.") - void getDistributionSetTagsByDistributionSetIdAndTagDescription() throws Exception { + /** + * Verifies that a paged result list of DS tags reflects the content on the repository side when filtered by distribution set id field AND tag field. + */ + @Test void getDistributionSetTagsByDistributionSetIdAndTagDescription() throws Exception { final List tags = testdataFactory.createDistributionSetTags(2); final DistributionSetTag tag1 = tags.get(0); final DistributionSetTag tag2 = tags.get(1); @@ -155,9 +158,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies that a single result of a DS tag reflects the content on the repository side.") - @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that a single result of a DS tag reflects the content on the repository side. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) void getDistributionSetTag() throws Exception { final List tags = testdataFactory.createDistributionSetTags(2); final DistributionSetTag assigned = tags.get(0); @@ -173,9 +177,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio equalTo(DISTRIBUTIONSETTAGS_ROOT + assigned.getId() + "/assigned?offset=0&limit=50"))); } - @Test - @Description("Verifies that created DS tags are stored in the repository as send to the API.") - @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that created DS tags are stored in the repository as send to the API. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 2) }) void createDistributionSetTags() throws Exception { final Tag tagOne = entityFactory.tag().create().colour("testcol1").description("its a test1").name("thetest1") .build(); @@ -203,9 +208,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(applyTagMatcherOnArrayResult(createdTwo)); } - @Test - @Description("Verifies that an updated DS tag is stored in the repository as send to the API.") - @ExpectEvents({ + /** + * Verifies that an updated DS tag is stored in the repository as send to the API. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetTagUpdatedEvent.class, count = 1) }) void updateDistributionSetTag() throws Exception { @@ -232,9 +238,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(applyTagMatcherOnArrayResult(updated)); } - @Test - @Description("Verifies that the delete call is reflected by the repository.") - @ExpectEvents({ + /** + * Verifies that the delete call is reflected by the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetTagDeletedEvent.class, count = 1) }) void deleteDistributionSetTag() throws Exception { @@ -248,9 +255,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio assertThat(distributionSetTagManagement.get(original.getId())).isNotPresent(); } - @Test - @Description("Ensures that assigned DS to tag in repository are listed with proper paging results.") - @ExpectEvents({ + /** + * Ensures that assigned DS to tag in repository are listed with proper paging results. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 5), @Expect(type = DistributionSetUpdatedEvent.class, count = 5) }) @@ -268,9 +276,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(setsAssigned))); } - @Test - @Description("Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit parameter.") - @ExpectEvents({ + /** + * Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit parameter. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 5), @Expect(type = DistributionSetUpdatedEvent.class, count = 5) }) @@ -290,9 +299,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit and offset parameter.") - @ExpectEvents({ + /** + * Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit and offset parameter. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 5), @Expect(type = DistributionSetUpdatedEvent.class, count = 5) }) @@ -315,9 +325,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } - @Test - @Description("Verifies that tag assignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = DistributionSetUpdatedEvent.class, count = 1) }) @@ -334,9 +345,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio assertThat(updated.stream().map(DistributionSet::getId).toList()).containsOnly(set.getId()); } - @Test - @Description("Verifies that tag assignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 2), @Expect(type = DistributionSetUpdatedEvent.class, count = 2) }) @@ -355,9 +367,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .containsAll(sets.stream().map(DistributionSet::getId).toList()); } - @Test - @Description("Verifies that tag unassignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag unassignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 2), @Expect(type = DistributionSetUpdatedEvent.class, count = 3) }) @@ -380,9 +393,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .containsOnly(assigned.getId()); } - @Test - @Description("Verifies that tag unassignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag unassignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 3), @Expect(type = DistributionSetUpdatedEvent.class, count = 5) }) @@ -406,9 +420,10 @@ class MgmtDistributionSetTagResourceTest extends AbstractManagementApiIntegratio .containsOnly(assigned.getId()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 2) }) void assignDistributionSetsNotFound() throws Exception { diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java index 96f740495..1dce4c056 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java @@ -29,10 +29,6 @@ import java.util.Collections; import java.util.List; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.builder.SoftwareModuleTypeCreate; @@ -50,14 +46,17 @@ import org.springframework.test.web.servlet.MvcResult; /** * Test for {@link MgmtDistributionSetTypeResource}. + *

+ * Feature: Component Tests - Management API
+ * Story: Distribution Set Type Resource */ -@Feature("Component Tests - Management API") -@Story("Distribution Set Type Resource") class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrationTest { + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests.") void getDistributionSetTypes() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create( entityFactory.distributionSetType().create() @@ -93,9 +92,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.total", equalTo(5))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with sorting by KEY. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with sorting by KEY.") void getDistributionSetTypesSortedByKey() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create( entityFactory.distributionSetType().create() @@ -142,17 +143,21 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.total", equalTo(DEFAULT_DS_TYPES + 1))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes POST requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes POST requests.") void createDistributionSetTypes() throws Exception { final MvcResult mvcResult = runPostDistributionSetType(createTestDistributionSetTestTypes()); verifyCreatedDistributionSetTypes(mvcResult); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes POST requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes POST requests.") void addMandatoryModuleToDistributionSetType() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create( entityFactory.distributionSetType().create() @@ -173,9 +178,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(testType.getOptionalModuleTypes()).isEmpty(); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes POST requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes POST requests.") void addOptionalModuleToDistributionSetType() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create( entityFactory.distributionSetType().create() @@ -196,9 +203,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(testType.getMandatoryModuleTypes()).isEmpty(); } + /** + * Verifies quota enforcement for /rest/v1/distributionsettypes/{ID}/optionalmoduletypes POST requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Verifies quota enforcement for /rest/v1/distributionsettypes/{ID}/optionalmoduletypes POST requests.") void assignModuleTypesToDistributionSetTypeUntilQuotaExceeded() throws Exception { // create software module types final int maxSoftwareModuleTypes = quotaManagement.getMaxSoftwareModuleTypesPerDistributionSetType(); @@ -252,9 +261,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_QUOTA_EXCEEDED.getKey()))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes GET requests.") void getMandatoryModulesOfDistributionSetType() throws Exception { final DistributionSetType testType = generateTestType(); @@ -269,9 +280,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("[0].key", equalTo("os"))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes GET requests.") void getOptionalModulesOfDistributionSetType() throws Exception { final DistributionSetType testType = generateTestType(); @@ -286,9 +299,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("[0].key", equalTo("application"))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes/{ID} GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes/{ID} GET requests.") void getMandatoryModuleOfDistributionSetType() throws Exception { final DistributionSetType testType = generateTestType(); @@ -305,9 +320,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.lastModifiedAt", equalTo(osType.getLastModifiedAt()))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes/{ID} GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes/{ID} GET requests.") void getOptionalModuleOfDistributionSetType() throws Exception { final DistributionSetType testType = generateTestType(); @@ -324,9 +341,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.lastModifiedAt", equalTo(appType.getLastModifiedAt()))); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes/{ID} DELETE requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/mandatorymoduletypes/{ID} DELETE requests.") void removeMandatoryModuleToDistributionSetType() throws Exception { DistributionSetType testType = generateTestType(); @@ -341,9 +360,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(testType.getMandatoryModuleTypes()).isEmpty(); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes/{ID} DELETE requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID}/optionalmoduletypes/{ID} DELETE requests.") void removeOptionalModuleToDistributionSetType() throws Exception { DistributionSetType testType = generateTestType(); @@ -358,9 +379,11 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(testType.getMandatoryModuleTypes()).containsExactly(osType); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} GET requests.") void getDistributionSetType() throws Exception { DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType().create() .key("test123").name("TestName123").description("Desc123")); @@ -380,18 +403,21 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.deleted", equalTo(testType.isDeleted()))); } - @Test - @Description("Handles the GET request of retrieving all distribution set types within SP based on parameter.") - void getDistributionSetTypesWithParameter() throws Exception { + /** + * Handles the GET request of retrieving all distribution set types within SP based on parameter. + */ + @Test void getDistributionSetTypesWithParameter() throws Exception { mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==a")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); } + /** + * Checks the correct behaviour of /rest/v1/DistributionSetTypes/{ID} DELETE requests (hard delete scenario). + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/DistributionSetTypes/{ID} DELETE requests (hard delete scenario).") void deleteDistributionSetTypeUnused() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() .create().key("test123").name("TestName123").description("Desc123").colour("col12")); @@ -405,17 +431,20 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES); } - @Test - @Description("Ensures that DS type deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteDistributionSetTypeThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that DS type deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteDistributionSetTypeThatDoesNotExistLeadsToNotFound() throws Exception { mvc.perform(delete("/rest/v1/distributionsettypes/1234")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } + /** + * Checks the correct behaviour of /rest/v1/DistributionSetTypes/{ID} DELETE requests (soft delete scenario). + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/DistributionSetTypes/{ID} DELETE requests (soft delete scenario).") void deleteDistributionSetTypeUsed() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() .create().key("test123").name("TestName123").description("Desc123").colour("col12")); @@ -444,9 +473,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES); } - @Test - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} PUT requests.") - void updateDistributionSetTypeColourDescriptionAndNameUntouched() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} PUT requests. + */ + @Test void updateDistributionSetTypeColourDescriptionAndNameUntouched() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.create(entityFactory.distributionSetType() .create().key("test123").name("TestName123").description("Desc123").colour("col")); @@ -465,9 +495,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andReturn(); } - @Test - @Description("Handles the PUT request for a single distribution set type within SP.") - void updateDistributionSetTypeDescriptionAndColor() throws Exception { + /** + * Handles the PUT request for a single distribution set type within SP. + */ + @Test void updateDistributionSetTypeDescriptionAndColor() throws Exception { final DistributionSetType testType = distributionSetTypeManagement.update(entityFactory.distributionSetType() .update(testdataFactory.createDistributionSet().getType().getId()).description("Desc1234")); final String body = new JSONObject() @@ -481,9 +512,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(status().isOk()); } - @Test - @Description("Tests the update of the deletion flag. It is verfied that the distribution set type can't be marked as deleted through update operation.") - void updateDistributionSetTypeDeletedFlag() throws Exception { + /** + * Tests the update of the deletion flag. It is verfied that the distribution set type can't be marked as deleted through update operation. + */ + @Test void updateDistributionSetTypeDeletedFlag() throws Exception { final DistributionSetType testType = distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("test123").name("TestName123").colour("col")); @@ -497,9 +529,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("$.deleted", equalTo(false))); } - @Test - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.") - void getDistributionSetTypesWithoutAddtionalRequestParameters() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging. + */ + @Test void getDistributionSetTypesWithoutAddtionalRequestParameters() throws Exception { // 4 types overall (3 hawkbit tenant default, 1 test default final int types = 4; @@ -511,9 +544,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); } - @Test - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.") - void getDistributionSetTypesWithPagingLimitRequestParameter() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging. + */ + @Test void getDistributionSetTypesWithPagingLimitRequestParameter() throws Exception { final int types = DEFAULT_DS_TYPES; final int limitSize = 1; @@ -526,9 +560,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.") - void getDistributionSetTypesWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging. + */ + @Test void getDistributionSetTypesWithPagingLimitAndOffsetRequestParameter() throws Exception { final int types = DEFAULT_DS_TYPES; final int offsetParam = 2; final int expectedSize = types - offsetParam; @@ -542,9 +577,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } - @Test - @Description("Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.).") - void invalidRequestsOnDistributionSetTypesResource() throws Exception { + /** + * Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.). + */ + @Test void invalidRequestsOnDistributionSetTypesResource() throws Exception { final SoftwareModuleType testSmType = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("test123").name("TestName123")); @@ -655,9 +691,10 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Search erquest of software module types.") - void searchDistributionSetTypeRsql() throws Exception { + /** + * Search erquest of software module types. + */ + @Test void searchDistributionSetTypeRsql() throws Exception { distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("test123").name("TestName123")); distributionSetTypeManagement @@ -674,7 +711,6 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andExpect(jsonPath("content[1].name", equalTo("TestName1234"))); } - @Step private void verifyCreatedDistributionSetTypes(final MvcResult mvcResult) throws UnsupportedEncodingException { final DistributionSetType created1 = distributionSetTypeManagement.findByKey("testKey1").get(); final DistributionSetType created2 = distributionSetTypeManagement.findByKey("testKey2").get(); @@ -695,7 +731,6 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati assertThat(distributionSetTypeManagement.count()).isEqualTo(7); } - @Step private MvcResult runPostDistributionSetType(final List types) throws Exception { return mvc .perform(post("/rest/v1/distributionsettypes").content(JsonBuilder.distributionSetTypes(types)) @@ -720,7 +755,6 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati .andReturn(); } - @Step private List createTestDistributionSetTestTypes() { assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES); diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java index 5fce771ae..df5f8c0a8 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java @@ -33,10 +33,6 @@ import java.util.NoSuchElementException; import java.util.Optional; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.im.authentication.SpPermission; @@ -78,9 +74,10 @@ import org.springframework.test.web.servlet.ResultMatcher; /** * Tests for covering the {@link MgmtRolloutResource}. + *

+ * Feature: Component Tests - Management API
+ * Story: Rollout Resource */ -@Feature("Component Tests - Management API") -@Story("Rollout Resource") @TestPropertySource(locations = "classpath:/mgmt-test.properties", properties = { "hawkbit.server.repository.dynamicRolloutsMinInvolvePeriodMS=-1" }) class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { @@ -94,9 +91,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { @Autowired private RolloutTestApprovalStrategy approvalStrategy; - @Test - @Description("Handles the GET request of retrieving a single rollout.") - public void getRollout() throws Exception { + /** + * Handles the GET request of retrieving a single rollout. + */ + @Test public void getRollout() throws Exception { enableMultiAssignments(); approvalStrategy.setApprovalNeeded(true); try { @@ -129,9 +127,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } } - @Test - @Description("Handles the GET request of retrieving a all targets of a specific deploy group of a rollout.") - public void getRolloutDeployGroupTargetsWithParameters() throws Exception { + /** + * Handles the GET request of retrieving a all targets of a specific deploy group of a rollout. + */ + @Test public void getRolloutDeployGroupTargetsWithParameters() throws Exception { testdataFactory.createTargets(4, "rollout", "description"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); final Rollout rollout = createRollout("rollout1", 2, dsA.getId(), "controllerId==rollout*"); @@ -147,9 +146,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(content().contentType(MediaTypes.HAL_JSON)); } - @Test - @Description("Handles the POST request of approving a rollout.") - public void approveRollout() throws Exception { + /** + * Handles the POST request of approving a rollout. + */ + @Test public void approveRollout() throws Exception { approvalStrategy.setApprovalNeeded(true); try { testdataFactory.createTargets(4, "rollout", "description"); @@ -164,8 +164,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } } + /** + * Handles the POST request of denying a rollout. Required Permission: APPROVE_ROLLOUT + */ @Test - @Description("Handles the POST request of denying a rollout. Required Permission: " + SpPermission.APPROVE_ROLLOUT) public void denyRollout() throws Exception { approvalStrategy.setApprovalNeeded(true); try { @@ -181,9 +183,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } } - @Test - @Description("Check if approvalDecidedBy and approvalRemark are present when rollout is approved") - public void validateIfApprovalFieldsArePresentAfterApproval() throws Exception { + /** + * Check if approvalDecidedBy and approvalRemark are present when rollout is approved + */ + @Test public void validateIfApprovalFieldsArePresentAfterApproval() throws Exception { approvalStrategy.setApprovalNeeded(true); approvalStrategy.setApproveDecidedBy("testUser"); final int amountTargets = 2; @@ -212,9 +215,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { approvalStrategy.setApprovalNeeded(false); } - @Test - @Description("Retry rollout test scenario") - public void retryRolloutTest() throws Exception { + /** + * Retry rollout test scenario + */ + @Test public void retryRolloutTest() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); final List successTargets = testdataFactory.createTargets("retryRolloutTargetSuccess-", 6); @@ -281,9 +285,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } } - @Test - @Description("Retrying a running rollout should not be allowed.") - public void retryNotFinishedRolloutShouldNotBeAllowed() throws Exception { + /** + * Retrying a running rollout should not be allowed. + */ + @Test public void retryNotFinishedRolloutShouldNotBeAllowed() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); testdataFactory.createTargets("retryRolloutTarget-", 10); postRollout("rolloutToBeRetried", 1, dsA.getId(), "id==retryRolloutTarget*", 10, Action.ActionType.FORCED); @@ -299,17 +304,19 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Test - @Description("Retrying a non-existing rollout should lead to NOT FOUND.") - public void retryNonExistingRolloutShouldLeadToNotFound() throws Exception { + /** + * Retrying a non-existing rollout should lead to NOT FOUND. + */ + @Test public void retryNonExistingRolloutShouldLeadToNotFound() throws Exception { mvc.perform(post("/rest/v1/rollouts/{rolloutId}/retry", 6782623)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } - @Test - @Description("Testing that creating rollout with wrong body returns bad request") - void createRolloutWithInvalidBodyReturnsBadRequest() throws Exception { + /** + * Testing that creating rollout with wrong body returns bad request + */ + @Test void createRolloutWithInvalidBodyReturnsBadRequest() throws Exception { mvc.perform(post("/rest/v1/rollouts").content("invalid body").contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) @@ -317,9 +324,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("errorCode", equalTo("hawkbit.server.error.rest.body.notReadable"))); } - @Test - @Description("Testing that creating rollout with insufficient permission returns forbidden") - @WithUser(allSpPermissions = true, removeFromAllPermission = "CREATE_ROLLOUT") + /** + * Testing that creating rollout with insufficient permission returns forbidden + */ + @Test @WithUser(allSpPermissions = true, removeFromAllPermission = "CREATE_ROLLOUT") void createRolloutWithInsufficientPermissionReturnsForbidden() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); mvc.perform(post("/rest/v1/rollouts") @@ -330,9 +338,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andReturn(); } - @Test - @Description("Testing that creating rollout with not existing distribution set returns not found") - void createRolloutWithNotExistingDistributionSetReturnsNotFound() throws Exception { + /** + * Testing that creating rollout with not existing distribution set returns not found + */ + @Test void createRolloutWithNotExistingDistributionSetReturnsNotFound() throws Exception { mvc.perform(post("/rest/v1/rollouts").content(JsonBuilder.rollout("name", "desc", 10, 1234, "name==test", null)) .contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) @@ -340,9 +349,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andReturn(); } - @Test - @Description("Testing that creating rollout with not valid formed target filter query returns bad request") - void createRolloutWithNotWellFormedFilterReturnsBadRequest() throws Exception { + /** + * Testing that creating rollout with not valid formed target filter query returns bad request + */ + @Test void createRolloutWithNotWellFormedFilterReturnsBadRequest() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); mvc.perform(post("/rest/v1/rollouts") .content(JsonBuilder.rollout("name", "desc", 5, dsA.getId(), "name=test", null)) @@ -353,9 +363,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andReturn(); } - @Test - @Description("Ensures that the repository refuses to create rollout without a defined target filter set.") - void missingTargetFilterQueryInRollout() throws Exception { + /** + * Ensures that the repository refuses to create rollout without a defined target filter set. + */ + @Test void missingTargetFilterQueryInRollout() throws Exception { final String targetFilterQuery = null; @@ -370,18 +381,20 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that rollout can be created") - void createRollout() throws Exception { + /** + * Testing that rollout can be created + */ + @Test void createRollout() throws Exception { testdataFactory.createTargets(20, "target", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); postRollout("rollout1", 5, dsA.getId(), "id==target*", 20, Action.ActionType.FORCED); } - @Test - @Description("Verifies that rollout cannot be created if too many rollout groups are specified.") - void createRolloutWithTooManyRolloutGroups() throws Exception { + /** + * Verifies that rollout cannot be created if too many rollout groups are specified. + */ + @Test void createRolloutWithTooManyRolloutGroups() throws Exception { final int maxGroups = quotaManagement.getMaxRolloutGroupsPerRollout(); testdataFactory.createTargets(20, "target", "rollout"); @@ -398,9 +411,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Verifies that rollout cannot be created if the 'max targets per rollout group' quota would be violated for one of the groups.") - void createRolloutFailsIfRolloutGroupQuotaIsViolated() throws Exception { + /** + * Verifies that rollout cannot be created if the 'max targets per rollout group' quota would be violated for one of the groups. + */ + @Test void createRolloutFailsIfRolloutGroupQuotaIsViolated() throws Exception { final int maxTargets = quotaManagement.getMaxTargetsPerRolloutGroup(); testdataFactory.createTargets(maxTargets + 1, "target", "rollout"); @@ -417,9 +431,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that rollout can be created with groups") - void createRolloutWithGroupDefinitions() throws Exception { + /** + * Testing that rollout can be created with groups + */ + @Test void createRolloutWithGroupDefinitions() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet("ro"); final int amountTargets = 10; @@ -446,9 +461,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing dynamic rollouts with default dynamic group definition") - void createDynamicRolloutWithDefaultDynamicGroupDefinition() throws Exception { + /** + * Testing dynamic rollouts with default dynamic group definition + */ + @Test void createDynamicRolloutWithDefaultDynamicGroupDefinition() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet("ro"); final int amountTargets = 10; @@ -529,9 +545,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0]._links.self.href", startsWith(HREF_ROLLOUT_PREFIX))); } - @Test - @Description("Testing that no rollout with groups that have illegal percentages can be created") - void createRolloutWithTooLowPercentage() throws Exception { + /** + * Testing that no rollout with groups that have illegal percentages can be created + */ + @Test void createRolloutWithTooLowPercentage() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet("ro2"); final int amountTargets = 10; @@ -555,9 +572,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that no rollout with groups that have illegal percentages can be created") - void createRolloutWithTooHighPercentage() throws Exception { + /** + * Testing that no rollout with groups that have illegal percentages can be created + */ + @Test void createRolloutWithTooHighPercentage() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet("ro2"); final int amountTargets = 10; @@ -581,9 +599,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that rollout can be updated") - void updateRollout() throws Exception { + /** + * Testing that rollout can be updated + */ + @Test void updateRollout() throws Exception { testdataFactory.createTargets(4, "rollout", "description"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); // create a running rollout for the created targets @@ -607,9 +626,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.description", equalTo("newDesc"))); } - @Test - @Description("Testing the empty list is returned if no rollout exists") - void noRolloutReturnsEmptyList() throws Exception { + /** + * Testing the empty list is returned if no rollout exists + */ + @Test void noRolloutReturnsEmptyList() throws Exception { mvc.perform(get("/rest/v1/rollouts").accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -618,9 +638,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.total", equalTo(0))); } - @Test - @Description("Retrieves single rollout from management API including extra data that is delivered only for single rollout access.") - void retrieveSingleRollout() throws Exception { + /** + * Retrieves single rollout from management API including extra data that is delivered only for single rollout access. + */ + @Test void retrieveSingleRollout() throws Exception { testdataFactory.createTargets(20, "rollout", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -637,9 +658,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { retrieveAndVerifyRolloutInRunning(rollout); } - @Test - @Description("Retrieves the list of rollouts with representation mode 'full'.") - void retrieveRolloutListFullRepresentation() throws Exception { + /** + * Retrieves the list of rollouts with representation mode 'full'. + */ + @Test void retrieveRolloutListFullRepresentation() throws Exception { testdataFactory.createTargets(20, "rollout", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -679,9 +701,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0]._links.self.href", startsWith(HREF_ROLLOUT_PREFIX))); } - @Test - @Description("Retrieves the list of rollouts with representation mode 'full'.") - void retrieveRolloutListFullRepresentationWithFilter() throws Exception { + /** + * Retrieves the list of rollouts with representation mode 'full'. + */ + @Test void retrieveRolloutListFullRepresentationWithFilter() throws Exception { testdataFactory.createTargets(20, "rollout", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -727,9 +750,11 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0]._links.self.href", startsWith(HREF_ROLLOUT_PREFIX))); } + /** + * Verify the confirmation required flag is not part of the rollout parent entity + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verify the confirmation required flag is not part of the rollout parent entity") void verifyConfirmationFlagIsNeverPartOfRolloutEntity(final boolean confirmationFlowActive) throws Exception { testdataFactory.createTargets(20, "rollout", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -753,9 +778,11 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.confirmationRequired").doesNotExist()); } + /** + * Verify the confirmation required flag will be set based on the feature state + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verify the confirmation required flag will be set based on the feature state") void verifyConfirmationStateIfNotProvided(final boolean confirmationFlowActive) throws Exception { if (confirmationFlowActive) { enableConfirmationFlow(); @@ -774,9 +801,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { }); } - @Test - @Description("Confirmation required flag will be read from the Rollout, if specified.") - void verifyRolloutGroupWillUseRolloutPropertyFirst() throws Exception { + /** + * Confirmation required flag will be read from the Rollout, if specified. + */ + @Test void verifyRolloutGroupWillUseRolloutPropertyFirst() throws Exception { enableConfirmationFlow(); final DistributionSet dsA = testdataFactory.createDistributionSet("ro"); @@ -817,9 +845,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { }); } - @Test - @Description("Confirmation required flag will be read from the tenant config (confirmation flow state), if never specified.") - void verifyRolloutGroupWillUseConfigIfNotProvidedWithRollout() throws Exception { + /** + * Confirmation required flag will be read from the tenant config (confirmation flow state), if never specified. + */ + @Test void verifyRolloutGroupWillUseConfigIfNotProvidedWithRollout() throws Exception { enableConfirmationFlow(); final DistributionSet dsA = testdataFactory.createDistributionSet("ro"); @@ -860,9 +889,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { }); } - @Test - @Description("Testing that rollout paged list contains rollouts") - void rolloutPagedListContainsAllRollouts() throws Exception { + /** + * Testing that rollout paged list contains rollouts + */ + @Test void rolloutPagedListContainsAllRollouts() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); testdataFactory.createTargets(20, "target", "rollout"); @@ -922,9 +952,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { retrieveAndCompareRolloutsContent(dsA, "/rest/v1/rollouts?representation=full", true, true, startAt, forcetime); } - @Test - @Description("Testing representation mode of rollout paged list") - void rolloutPagedListRepresentationMode() throws Exception { + /** + * Testing representation mode of rollout paged list + */ + @Test void rolloutPagedListRepresentationMode() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); testdataFactory.createTargets(20, "target", "rollout"); @@ -940,9 +971,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { retrieveAndCompareRolloutsContent(dsA, "/rest/v1/rollouts?representation=full", true); } - @Test - @Description("Testing that rollout paged list is limited by the query param limit") - void rolloutPagedListIsLimitedToQueryParam() throws Exception { + /** + * Testing that rollout paged list is limited by the query param limit + */ + @Test void rolloutPagedListIsLimitedToQueryParam() throws Exception { final DistributionSet dsA = testdataFactory.createDistributionSet(""); testdataFactory.createTargets(20, "target", "rollout"); @@ -962,9 +994,11 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.total", equalTo(2))); } + /** + * Testing that rollout paged list is limited by the query param limit + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Testing that rollout paged list is limited by the query param limit") void retrieveRolloutGroupsForSpecificRollout(final boolean confirmationFlowEnabled, final boolean confirmationRequired) throws Exception { // setup @@ -1006,9 +1040,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { : jsonPath("confirmationRequired").doesNotExist()); } - @Test - @Description("The relation between deploy group and rollout should be validated.") - void deployGroupsShouldValidateRelationWithRollout() throws Exception { + /** + * The relation between deploy group and rollout should be validated. + */ + @Test void deployGroupsShouldValidateRelationWithRollout() throws Exception { // setup final int amountTargets = 8; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1035,9 +1070,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Testing that starting the rollout switches the state to starting and then to running") - void startingRolloutSwitchesIntoRunningState() throws Exception { + /** + * Testing that starting the rollout switches the state to starting and then to running + */ + @Test void startingRolloutSwitchesIntoRunningState() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1071,9 +1107,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("status", equalTo("running"))); } - @Test - @Description("Testing that pausing the rollout switches the state to paused") - void pausingRolloutSwitchesIntoPausedState() throws Exception { + /** + * Testing that pausing the rollout switches the state to paused + */ + @Test void pausingRolloutSwitchesIntoPausedState() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1104,9 +1141,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("status", equalTo("paused"))); } - @Test - @Description("Testing that resuming the rollout switches the state to running") - void resumingRolloutSwitchesIntoRunningState() throws Exception { + /** + * Testing that resuming the rollout switches the state to running + */ + @Test void resumingRolloutSwitchesIntoRunningState() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1142,9 +1180,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("status", equalTo("running"))); } - @Test - @Description("Testing that an already started rollout cannot be started again and returns bad request") - void startingAlreadyStartedRolloutReturnsBadRequest() throws Exception { + /** + * Testing that an already started rollout cannot be started again and returns bad request + */ + @Test void startingAlreadyStartedRolloutReturnsBadRequest() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1168,9 +1207,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("errorCode", equalTo(SpServerError.SP_ROLLOUT_ILLEGAL_STATE.getKey()))); } - @Test - @Description("Testing that resuming a rollout which is not started leads to bad request") - void resumingNotStartedRolloutReturnsBadRequest() throws Exception { + /** + * Testing that resuming a rollout which is not started leads to bad request + */ + @Test void resumingNotStartedRolloutReturnsBadRequest() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1186,9 +1226,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("errorCode", equalTo(SpServerError.SP_ROLLOUT_ILLEGAL_STATE.getKey()))); } - @Test - @Description("Testing that starting rollout the first rollout group is in running state") - void startingRolloutFirstRolloutGroupIsInRunningState() throws Exception { + /** + * Testing that starting rollout the first rollout group is in running state + */ + @Test void startingRolloutFirstRolloutGroupIsInRunningState() throws Exception { // setup final int amountTargets = 10; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1218,9 +1259,11 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.content[1].status", equalTo("scheduled"))); } + /** + * Testing that a single rollout group can be retrieved + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Testing that a single rollout group can be retrieved") void retrieveSingleRolloutGroup(final boolean confirmationFlowEnabled, final boolean confirmationRequired) throws Exception { // setup @@ -1250,9 +1293,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { confirmationRequired); } - @Test - @Description("Testing that the targets of rollout group can be retrieved") - void retrieveTargetsFromRolloutGroup() throws Exception { + /** + * Testing that the targets of rollout group can be retrieved + */ + @Test void retrieveTargetsFromRolloutGroup() throws Exception { // setup final int amountTargets = 10; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1275,9 +1319,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.total", equalTo(5))); } - @Test - @Description("Testing that the targets of rollout group can be retrieved with rsql query param") - void retrieveTargetsFromRolloutGroupWithQuery() throws Exception { + /** + * Testing that the targets of rollout group can be retrieved with rsql query param + */ + @Test void retrieveTargetsFromRolloutGroupWithQuery() throws Exception { // setup final int amountTargets = 10; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1303,9 +1348,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.total", equalTo(1))); } - @Test - @Description("Testing that the targets of rollout group can be retrieved after the rollout has been started") - void retrieveTargetsFromRolloutGroupAfterRolloutIsStarted() throws Exception { + /** + * Testing that the targets of rollout group can be retrieved after the rollout has been started + */ + @Test void retrieveTargetsFromRolloutGroupAfterRolloutIsStarted() throws Exception { // setup final int amountTargets = 10; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1333,9 +1379,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.total", equalTo(5))); } - @Test - @Description("Start the rollout in async mode") - void startingRolloutSwitchesIntoRunningStateAsync() throws Exception { + /** + * Start the rollout in async mode + */ + @Test void startingRolloutSwitchesIntoRunningStateAsync() throws Exception { final int amountTargets = 50; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1356,9 +1403,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { awaitRunningState(rollout.getId()); } - @Test - @Description("Deletion of a rollout") - void deleteRollout() throws Exception { + /** + * Deletion of a rollout + */ + @Test void deleteRollout() throws Exception { final int amountTargets = 10; testdataFactory.createTargets(amountTargets, "rolloutDelete", "rolloutDelete"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -1373,9 +1421,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { assertStatusIs(rollout, RolloutStatus.DELETING); } - @Test - @Description("Soft deletion of a rollout: soft deletion appears when already running rollout is being deleted") - void deleteRunningRollout() throws Exception { + /** + * Soft deletion of a rollout: soft deletion appears when already running rollout is being deleted + */ + @Test void deleteRunningRollout() throws Exception { final Rollout rollout = testdataFactory.createSoftDeletedRollout("softDeletedRollout"); mvc.perform(get("/rest/v1/rollouts/{rolloutid}", rollout.getId())) @@ -1386,9 +1435,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { assertStatusIs(rollout, RolloutStatus.DELETED); } - @Test - @Description("Testing that rollout paged list with rsql parameter") - void getRolloutWithRSQLParam() throws Exception { + /** + * Testing that rollout paged list with rsql parameter + */ + @Test void getRolloutWithRSQLParam() throws Exception { final int amountTargetsRollout1 = 25; final int amountTargetsRollout2 = 25; @@ -1432,9 +1482,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that rolloutgroup paged list with rsql parameter") - void retrieveRolloutGroupsForSpecificRolloutWithRSQLParam() throws Exception { + /** + * Testing that rolloutgroup paged list with rsql parameter + */ + @Test void retrieveRolloutGroupsForSpecificRolloutWithRSQLParam() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1475,9 +1526,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Testing that the list of rollout groups can be requested with representation mode 'full'.") - void retrieveRolloutGroupsFullRepresentation() throws Exception { + /** + * Testing that the list of rollout groups can be requested with representation mode 'full'. + */ + @Test void retrieveRolloutGroupsFullRepresentation() throws Exception { testdataFactory.createTargets(20, "rollout", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -1513,18 +1565,20 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0].totalTargetsPerStatus.error", equalTo(0))); } - @Test - @Description("Verifies that a DOWNLOAD_ONLY rollout is possible") - void createDownloadOnlyRollout() throws Exception { + /** + * Verifies that a DOWNLOAD_ONLY rollout is possible + */ + @Test void createDownloadOnlyRollout() throws Exception { testdataFactory.createTargets(20, "target", "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); postRollout("rollout1", 5, dsA.getId(), "id==target*", 20, Action.ActionType.DOWNLOAD_ONLY); } - @Test - @Description("A rollout create request containing a weight is always accepted when weight is valid.") - void weightValidation() throws Exception { + /** + * A rollout create request containing a weight is always accepted when weight is valid. + */ + @Test void weightValidation() throws Exception { testdataFactory.createTargets(4, "rollout", "description"); final Long dsId = testdataFactory.createDistributionSet().getId(); final int weight = 66; @@ -1557,9 +1611,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { assertThat(rollouts.get(0).getWeight()).get().isEqualTo(weight); } - @Test - @Description("Trigger next rollout group") - void triggeringNextGroupRollout() throws Exception { + /** + * Trigger next rollout group + */ + @Test void triggeringNextGroupRollout() throws Exception { // setup final int amountTargets = 20; testdataFactory.createTargets(amountTargets, "rollout", "rollout"); @@ -1579,9 +1634,10 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { RolloutGroupStatus.SCHEDULED, RolloutGroupStatus.SCHEDULED); } - @Test - @Description("Trigger next rollout group if rollout is in wrong state") - void triggeringNextGroupRolloutWrongState() throws Exception { + /** + * Trigger next rollout group if rollout is in wrong state + */ + @Test void triggeringNextGroupRolloutWrongState() throws Exception { final int amountTargets = 3; final List targets = testdataFactory.createTargets(amountTargets, "rollout"); final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -1623,7 +1679,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { return Stream.of(Arguments.of(true, false), Arguments.of(true, true), Arguments.of(false, true)); } - @Step private void retrieveAndVerifyRolloutInRunning(final Rollout rollout) throws Exception { rolloutHandler.handleAll(); @@ -1644,7 +1699,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.totalGroups", equalTo(4))); } - @Step private void retrieveAndVerifyRolloutInStarting(final Rollout rollout) throws Exception { rolloutManagement.start(rollout.getId()); @@ -1665,7 +1719,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.totalGroups", equalTo(4))); } - @Step private void retrieveAndVerifyRolloutInReady(final Rollout rollout) throws Exception { rolloutHandler.handleAll(); @@ -1688,7 +1741,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.totalGroups", equalTo(4))); } - @Step private void retrieveAndVerifyRolloutInCreating(final DistributionSet dsA, final Rollout rollout) throws Exception { mvc.perform(get("/rest/v1/rollouts/" + rollout.getId()).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) @@ -1723,7 +1775,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.totalGroups", equalTo(4))); } - @Step private void retrieveAndVerifyRolloutGroupInRunningAndScheduled(final Rollout rollout, final RolloutGroup firstGroup, final RolloutGroup secondGroup, final boolean confirmationFlowEnabled, final boolean confirmationRequired) throws Exception { @@ -1760,7 +1811,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { : jsonPath("confirmationRequired").doesNotExist()); } - @Step private void retrieveAndVerifyRolloutGroupInReady(final Rollout rollout, final RolloutGroup firstGroup) throws Exception { rolloutHandler.handleAll(); @@ -1783,7 +1833,6 @@ class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTest { : jsonPath("confirmationRequired").doesNotExist()); } - @Step private void retrieveAndVerifyRolloutGroupInCreating(final Rollout rollout, final RolloutGroup firstGroup) throws Exception { mvc.perform(get("/rest/v1/rollouts/{rolloutId}/deploygroups/{groupId}", rollout.getId(), firstGroup.getId()) diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java index a21ae7832..5bb3163de 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java @@ -40,9 +40,6 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.apache.commons.io.IOUtils; import org.awaitility.Awaitility; import org.eclipse.hawkbit.exception.SpServerError; @@ -86,9 +83,10 @@ import org.springframework.web.bind.annotation.RestController; /** * Tests for {@link MgmtSoftwareModuleResource} {@link RestController}. + *

+ * Feature: Component Tests - Management API
+ * Story: Software Module Resource */ -@Feature("Component Tests - Management API") -@Story("Software Module Resource") @TestPropertySource(properties = { "hawkbit.server.security.dos.maxArtifactSize=100000", "hawkbit.server.security.dos.maxArtifactStorage=500000" }) @@ -99,9 +97,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(softwareModuleManagement.findAll(PAGE)).as("no softwaremodule should be founded").isEmpty(); } - @Test - @Description("Trying to create a SM from already marked as deleted type - should get as response 400 Bad Request") - public void createSMFromAlreadyMarkedAsDeletedType() throws Exception { + /** + * Trying to create a SM from already marked as deleted type - should get as response 400 Bad Request + */ + @Test public void createSMFromAlreadyMarkedAsDeletedType() throws Exception { final String SM_TYPE = "someSmType"; final SoftwareModule sm = testdataFactory.createSoftwareModule(SM_TYPE); testdataFactory.findOrCreateDistributionSetType( @@ -136,9 +135,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertTrue(exceptionInfo.getMessage().contains("Software Module Type already deleted")); } - @Test - @Description("Handles the GET request of retrieving all meta data of artifacts assigned to a software module (in full representation mode including a download URL by the artifact provider).") - public void getArtifactsWithParameters() throws Exception { + /** + * Handles the GET request of retrieving all meta data of artifacts assigned to a software module (in full representation mode including a download URL by the artifact provider). + */ + @Test public void getArtifactsWithParameters() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final byte[] random = randomBytes(5); @@ -153,9 +153,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(content().contentType(MediaTypes.HAL_JSON)); } - @Test - @Description(" Get a paged list of meta data for a software module.") - public void getMetadata() throws Exception { + /** + * Get a paged list of meta data for a software module. + */ + @Test public void getMetadata() throws Exception { final int totalMetadata = 4; final String knownKeyPrefix = "knownKey"; final String knownValuePrefix = "knownValue"; @@ -173,9 +174,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(content().contentType(MediaTypes.HAL_JSON)); } - @Test - @Description(" Get a paged list of meta data for a software module with defined page size and sorting by name descending and key starting with 'known'.") - public void getMetadataWithParameters() throws Exception { + /** + * Get a paged list of meta data for a software module with defined page size and sorting by name descending and key starting with 'known'. + */ + @Test public void getMetadataWithParameters() throws Exception { final int totalMetadata = 4; final String knownKeyPrefix = "knownKey"; final String knownValuePrefix = "knownValue"; @@ -194,9 +196,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(content().contentType(MediaTypes.HAL_JSON)); } - @Test - @Description("Get a single meta data value for a meta data key.") - public void getMetadataValue() throws Exception { + /** + * Get a single meta data value for a meta data key. + */ + @Test public void getMetadataValue() throws Exception { // prepare and create metadata final String knownKey = "knownKey"; @@ -211,9 +214,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(status().isOk()); } - @Test - @Description("Tests the update of software module metadata. It is verfied that only the selected fields for the update are really updated and the modification values are filled (i.e. updated by and at).") - @WithUser(principal = "smUpdateTester", allSpPermissions = true) + /** + * Tests the update of software module metadata. It is verfied that only the selected fields for the update are really updated and the modification values are filled (i.e. updated by and at). + */ + @Test @WithUser(principal = "smUpdateTester", allSpPermissions = true) void updateSoftwareModuleOnlyDescriptionAndVendorNameUntouched() throws Exception { final String knownSWName = "name1"; final String knownSWVersion = "version1"; @@ -265,9 +269,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Tests the update of the deletion flag. It is verified that the software module can't be marked as deleted through update operation.") - @WithUser(principal = "smUpdateTester", allSpPermissions = true) + /** + * Tests the update of the deletion flag. It is verified that the software module can't be marked as deleted through update operation. + */ + @Test @WithUser(principal = "smUpdateTester", allSpPermissions = true) void updateSoftwareModuleDeletedFlag() throws Exception { final String knownSWName = "name1"; final String knownSWVersion = "version1"; @@ -301,9 +306,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Tests the lock. It is verified that the software module can be marked as locked through update operation.") - @WithUser(principal = "smUpdateTester", allSpPermissions = true) + /** + * Tests the lock. It is verified that the software module can be marked as locked through update operation. + */ + @Test @WithUser(principal = "smUpdateTester", allSpPermissions = true) void lockSoftwareModule() throws Exception { final SoftwareModule sm = softwareModuleManagement.create( entityFactory.softwareModule().create().type(osType).name("name1").version("version1")); @@ -333,9 +339,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath("$.locked", equalTo(true))); } - @Test - @Description("Tests the unlock.") - @WithUser(principal = "smUpdateTester", allSpPermissions = true) + /** + * Tests the unlock. + */ + @Test @WithUser(principal = "smUpdateTester", allSpPermissions = true) void unlockSoftwareModule() throws Exception { final SoftwareModule sm = softwareModuleManagement.create( entityFactory.softwareModule().create().type(osType).name("name1").version("version1")); @@ -368,9 +375,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath("$.locked", equalTo(false))); } - @Test - @Description("Tests the upload of an artifact binary. The upload is executed and the content checked in the repository for completeness.") - void uploadArtifact() throws Exception { + /** + * Tests the upload of an artifact binary. The upload is executed and the content checked in the repository for completeness. + */ + @Test void uploadArtifact() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); // create test file @@ -409,9 +417,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertArtifact(sm, random); } - @Test - @Description("Verifies that artifacts which exceed the configured maximum size cannot be uploaded.") - void uploadArtifactFailsIfTooLarge() throws Exception { + /** + * Verifies that artifacts which exceed the configured maximum size cannot be uploaded. + */ + @Test void uploadArtifactFailsIfTooLarge() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModule("quota", "quota", false); final long maxSize = quotaManagement.getMaxArtifactSize(); @@ -429,9 +438,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_FILE_SIZE_QUOTA_EXCEEDED.getKey()))); } - @Test - @Description("Verifies that artifact with invalid filename cannot be uploaded to prevent cross site scripting.") - void uploadArtifactFailsIfFilenameInvalide() throws Exception { + /** + * Verifies that artifact with invalid filename cannot be uploaded to prevent cross site scripting. + */ + @Test void uploadArtifactFailsIfFilenameInvalide() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModule("quota", "quota", false); final String illegalFilename = ".xml"; @@ -445,9 +455,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath("$.message", containsString("Invalid characters in string"))); } - @Test - @Description("Verifies that the system does not accept empty artifact uploads. Expected response: BAD REQUEST") - void emptyUploadArtifact() throws Exception { + /** + * Verifies that the system does not accept empty artifact uploads. Expected response: BAD REQUEST + */ + @Test void emptyUploadArtifact() throws Exception { assertThat(softwareModuleManagement.findAll(PAGE)).isEmpty(); assertThat(artifactManagement.count()).isZero(); @@ -461,9 +472,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(status().isBadRequest()); } - @Test - @Description("Verifies that the system does not accept identical artifacts uploads for the same software module. Expected response: CONFLICT") - void duplicateUploadArtifact() throws Exception { + /** + * Verifies that the system does not accept identical artifacts uploads for the same software module. Expected response: CONFLICT + */ + @Test void duplicateUploadArtifact() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final byte[] random = randomBytes(5 * 1024); @@ -488,9 +500,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(status().isConflict()); } - @Test - @Description("verifies that option to upload artifacts with a custom defined by metadata, i.e. not the file name of the binary itself.") - void uploadArtifactWithCustomName() throws Exception { + /** + * verifies that option to upload artifacts with a custom defined by metadata, i.e. not the file name of the binary itself. + */ + @Test void uploadArtifactWithCustomName() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); assertThat(artifactManagement.count()).isZero(); @@ -515,9 +528,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(artifactManagement.getByFilename("customFilename")).as("Local artifact is wrong").isPresent(); } - @Test - @Description("Verifies that the system refuses upload of an artifact where the provided hash sums do not match. Expected result: BAD REQUEST") - void uploadArtifactWithHashCheck() throws Exception { + /** + * Verifies that the system refuses upload of an artifact where the provided hash sums do not match. Expected result: BAD REQUEST + */ + @Test void uploadArtifactWithHashCheck() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); assertThat(artifactManagement.count()).isZero(); @@ -577,9 +591,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Verifies that only a limited number of artifacts can be uploaded for one software module.") - void uploadArtifactsUntilQuotaExceeded() throws Exception { + /** + * Verifies that only a limited number of artifacts can be uploaded for one software module. + */ + @Test void uploadArtifactsUntilQuotaExceeded() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final long maxArtifacts = quotaManagement.getMaxArtifactsPerSoftwareModule(); @@ -619,9 +634,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Verifies that artifacts can only be added as long as the artifact storage quota is not exceeded.") - void uploadArtifactsUntilStorageQuotaExceeded() throws Exception { + /** + * Verifies that artifacts can only be added as long as the artifact storage quota is not exceeded. + */ + @Test void uploadArtifactsUntilStorageQuotaExceeded() throws Exception { final long storageLimit = quotaManagement.getMaxArtifactStorage(); @@ -667,9 +683,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Tests binary download of an artifact including verfication that the downloaded binary is consistent and that the etag header is as expected identical to the SHA1 hash of the file.") - void downloadArtifact() throws Exception { + /** + * Tests binary download of an artifact including verfication that the downloaded binary is consistent and that the etag header is as expected identical to the SHA1 hash of the file. + */ + @Test void downloadArtifact() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final int artifactSize = 5 * 1024; @@ -687,9 +704,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(artifactManagement.count()).isEqualTo(2); } - @Test - @Description("Verifies the listing of one defined artifact assigned to a given software module. That includes the artifact metadata and download links.") - void getArtifact() throws Exception { + /** + * Verifies the listing of one defined artifact assigned to a given software module. That includes the artifact metadata and download links. + */ + @Test void getArtifact() throws Exception { // prepare data for test final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); @@ -719,9 +737,11 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes artifact.getId())))); } + /** + * Verifies the listing of one defined artifact assigned to a given software module. That includes the artifact metadata and cdn download links. + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verifies the listing of one defined artifact assigned to a given software module. That includes the artifact metadata and cdn download links.") void getArtifactWithUseArtifactUrlHandlerParameter(final boolean useArtifactUrlHandler) throws Exception { // prepare data for test final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); @@ -754,9 +774,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes artifact.getId())))); } - @Test - @Description("Verifies the listing of an artifact that belongs to a soft deleted software module.") - void getArtifactSoftDeleted() throws Exception { + /** + * Verifies the listing of an artifact that belongs to a soft deleted software module. + */ + @Test void getArtifactSoftDeleted() throws Exception { // prepare data for test final SoftwareModule sm = testdataFactory.createSoftwareModuleOs("softDeleted"); final Artifact artifact = testdataFactory.createArtifacts(sm.getId()).get(0); @@ -781,9 +802,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes artifact.getId())))); } - @Test - @Description("Verifies the listing of all artifacts assigned to a software module. That includes the artifact metadata.") - void getArtifacts() throws Exception { + /** + * Verifies the listing of all artifacts assigned to a software module. That includes the artifact metadata. + */ + @Test void getArtifacts() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final int artifactSize = 5 * 1024; @@ -816,9 +838,11 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes "http://localhost/rest/v1/softwaremodules/" + sm.getId() + "/artifacts/" + artifact2.getId()))); } + /** + * Verifies the listing of all artifacts assigned to a software module. That includes the artifact metadata and download links. + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verifies the listing of all artifacts assigned to a software module. That includes the artifact metadata and download links.") void getArtifactsWithUseArtifactUrlHandlerParameter(final boolean useArtifactUrlHandler) throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); @@ -864,9 +888,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes artifact2.getId())))); } - @Test - @Description("Verifies that the system refuses unsupported request types and answers as defined to them, e.g. NOT FOUND on a non existing resource. Or a HTTP POST for updating a resource results in METHOD NOT ALLOWED etc.") - void invalidRequestsOnArtifactResource() throws Exception { + /** + * Verifies that the system refuses unsupported request types and answers as defined to them, e.g. NOT FOUND on a non existing resource. Or a HTTP POST for updating a resource results in METHOD NOT ALLOWED etc. + */ + @Test void invalidRequestsOnArtifactResource() throws Exception { final int artifactSize = 5 * 1024; final byte[] random = randomBytes(artifactSize); @@ -920,9 +945,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(status().isGone()); } - @Test - @Description("Tests the deletion of an artifact including verification that the artifact is actually erased in the repository and removed from the software module.") - void deleteArtifact() throws Exception { + /** + * Tests the deletion of an artifact including verification that the artifact is actually erased in the repository and removed from the software module. + */ + @Test void deleteArtifact() throws Exception { // Create 1 SM final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); @@ -954,9 +980,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Verifies that the system refuses unsupported request types and answers as defined to them, e.g. NOT FOUND on a non existing resource. Or a HTTP POST for updating a resource results in METHOD NOT ALLOWED etc.") - void invalidRequestsOnSoftwareModulesResource() throws Exception { + /** + * Verifies that the system refuses unsupported request types and answers as defined to them, e.g. NOT FOUND on a non existing resource. Or a HTTP POST for updating a resource results in METHOD NOT ALLOWED etc. + */ + @Test void invalidRequestsOnSoftwareModulesResource() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final List modules = Collections.singletonList(sm); @@ -1020,9 +1047,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Test of modules retrieval without any parameters. Will return all modules in the system as defined by standard page size.") - void getSoftwareModulesWithoutAdditionalRequestParameters() throws Exception { + /** + * Test of modules retrieval without any parameters. Will return all modules in the system as defined by standard page size. + */ + @Test void getSoftwareModulesWithoutAdditionalRequestParameters() throws Exception { final int modules = 5; createSoftwareModulesAlphabetical(modules); mvc.perform(get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)) @@ -1033,9 +1061,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(modules))); } - @Test - @Description("Test of modules retrieval with paging limit parameter. Will return all modules in the system as defined by given page size.") - void detSoftwareModulesWithPagingLimitRequestParameter() throws Exception { + /** + * Test of modules retrieval with paging limit parameter. Will return all modules in the system as defined by given page size. + */ + @Test void detSoftwareModulesWithPagingLimitRequestParameter() throws Exception { final int modules = 5; final int limitSize = 1; createSoftwareModulesAlphabetical(modules); @@ -1048,9 +1077,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Test of modules retrieval with paging limit offset parameters. Will return all modules in the system as defined by given page size starting from given offset.") - void getSoftwareModulesWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Test of modules retrieval with paging limit offset parameters. Will return all modules in the system as defined by given page size starting from given offset. + */ + @Test void getSoftwareModulesWithPagingLimitAndOffsetRequestParameter() throws Exception { final int modules = 5; final int offsetParam = 2; final int expectedSize = modules - offsetParam; @@ -1065,9 +1095,11 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } + /** + * Test retrieval of all software modules the user has access to. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Test retrieval of all software modules the user has access to.") void getSoftwareModules() throws Exception { final SoftwareModule os = testdataFactory.createSoftwareModuleOs(); final SoftwareModule app = testdataFactory.createSoftwareModuleApp(); @@ -1100,9 +1132,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(softwareModuleManagement.findAll(PAGE)).as("Softwaremodule size is wrong").hasSize(2); } - @Test - @Description("Test the various filter parameters, e.g. filter by name or type of the module.") - void getSoftwareModulesWithFilterParameters() throws Exception { + /** + * Test the various filter parameters, e.g. filter by name or type of the module. + */ + @Test void getSoftwareModulesWithFilterParameters() throws Exception { final SoftwareModule os1 = testdataFactory.createSoftwareModuleOs("1"); final SoftwareModule app1 = testdataFactory.createSoftwareModuleApp("1"); testdataFactory.createSoftwareModuleOs("2"); @@ -1165,27 +1198,31 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .andExpect(jsonPath("$.total", equalTo(1))); } - @Test - @Description("Verifies that the system answers as defined in case of a wrong filter parameter syntax. Expected result: BAD REQUEST with error description.") - void getSoftwareModulesWithSyntaxErrorFilterParameter() throws Exception { + /** + * Verifies that the system answers as defined in case of a wrong filter parameter syntax. Expected result: BAD REQUEST with error description. + */ + @Test void getSoftwareModulesWithSyntaxErrorFilterParameter() throws Exception { mvc.perform(get("/rest/v1/softwaremodules?q=wrongFIQLSyntax").accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isBadRequest()) .andExpect(jsonPath("$.errorCode", equalTo("hawkbit.server.error.rest.param.rsqlParamSyntax"))); } - @Test - @Description("Verifies that the system answers as defined in case of a non existing field used in filter. Expected result: BAD REQUEST with error description.") - void getSoftwareModulesWithUnknownFieldErrorFilterParameter() throws Exception { + /** + * Verifies that the system answers as defined in case of a non existing field used in filter. Expected result: BAD REQUEST with error description. + */ + @Test void getSoftwareModulesWithUnknownFieldErrorFilterParameter() throws Exception { mvc.perform(get("/rest/v1/softwaremodules?q=wrongField==abc").accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isBadRequest()) .andExpect(jsonPath("$.errorCode", equalTo("hawkbit.server.error.rest.param.rsqlInvalidField"))); } + /** + * Tests GET request on /rest/v1/softwaremodules/{smId}. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Tests GET request on /rest/v1/softwaremodules/{smId}.") void getSoftwareModule() throws Exception { final SoftwareModule os = testdataFactory.createSoftwareModuleOs(); @@ -1211,9 +1248,11 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(softwareModuleManagement.findAll(PAGE)).as("Softwaremodule size is wrong").hasSize(1); } + /** + * Verifies that the create request actually results in the creation of the modules in the repository. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Verifies that the create request actually results in the creation of the modules in the repository.") void createSoftwareModules() throws Exception { final SoftwareModule os = entityFactory.softwareModule() .create() @@ -1284,9 +1323,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes "Softwaremoudle name is wrong").isEqualTo(ah.getName()); } - @Test - @Description("Verifies successfull deletion of software modules that are not in use, i.e. assigned to a DS.") - void deleteUnassignedSoftwareModule() throws Exception { + /** + * Verifies successfull deletion of software modules that are not in use, i.e. assigned to a DS. + */ + @Test void deleteUnassignedSoftwareModule() throws Exception { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); @@ -1308,9 +1348,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(artifactManagement.count()).isZero(); } - @Test - @Description("Verifies successfull deletion of a software module that is in use, i.e. assigned to a DS which should result in movinf the module to the archive.") - void deleteAssignedSoftwareModule() throws Exception { + /** + * Verifies successfull deletion of a software module that is in use, i.e. assigned to a DS which should result in movinf the module to the archive. + */ + @Test void deleteAssignedSoftwareModule() throws Exception { final DistributionSet ds1 = testdataFactory.createDistributionSet("a"); final int artifactSize = 5 * 1024; @@ -1342,9 +1383,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(artifactManagement.count()).isEqualTo(1); } - @Test - @Description("Verifies the successful creation of metadata and the enforcement of the meta data quota.") - void createMetadata() throws Exception { + /** + * Verifies the successful creation of metadata and the enforcement of the meta data quota. + */ + @Test void createMetadata() throws Exception { final String knownKey1 = "knownKey1"; final String knownValue1 = "knownValue1"; final String knownKey2 = "knownKey2"; @@ -1384,9 +1426,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes } - @Test - @Description("Verifies the successful update of metadata based on given key.") - void updateMetadataKey() throws Exception { + /** + * Verifies the successful update of metadata based on given key. + */ + @Test void updateMetadataKey() throws Exception { // prepare and create metadata for update final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1410,9 +1453,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(assertDS.isTargetVisible()).as("target visible is wrong").isTrue(); } - @Test - @Description("Verifies the successful deletion of metadata entry.") - void deleteMetadata() throws Exception { + /** + * Verifies the successful deletion of metadata entry. + */ + @Test void deleteMetadata() throws Exception { // prepare and create metadata for deletion final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1429,9 +1473,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes .isThrownBy(() -> softwareModuleManagement.getMetadata(smId, knownKey)); } - @Test - @Description("Ensures that module metadata deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteModuleMetadataThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that module metadata deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteModuleMetadataThatDoesNotExistLeadsToNotFound() throws Exception { // prepare and create metadata for deletion final String knownKey = "knownKey"; final String knownValue = "knownValue"; @@ -1451,9 +1496,10 @@ class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegrationTes assertThat(softwareModuleManagement.getMetadata(smId, knownKey)).isNotNull(); } - @Test - @Description("Ensures that module deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteSoftwareModuleThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that module deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteSoftwareModuleThatDoesNotExistLeadsToNotFound() throws Exception { mvc.perform(delete("/rest/v1/softwaremodules/1234")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index e8fdaa6c7..5a7cf2a88 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -28,9 +28,6 @@ import java.util.Collections; import java.util.List; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.NamedEntity; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; @@ -44,14 +41,17 @@ import org.springframework.test.web.servlet.MvcResult; /** * Test for {@link MgmtSoftwareModuleTypeResource}. + *

+ * Feature: Component Tests - Management API
+ * Story: Software Module Type Resource */ -@Feature("Component Tests - Management API") -@Story("Software Module Type Resource") public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiIntegrationTest { + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests.") public void getSoftwareModuleTypes() throws Exception { final SoftwareModuleType testType = createTestType(); @@ -93,9 +93,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath("$.total", equalTo(4))); } + /** + * Handles the GET request of retrieving all software module types within SP with parameters. In this case the first 10 result in ascending order by name where the name starts with 'a'. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Handles the GET request of retrieving all software module types within SP with parameters. In this case the first 10 result in ascending order by name where the name starts with 'a'.") public void getSoftwareModuleTypesWithParameters() throws Exception { final SoftwareModuleType testType = testdataFactory.findOrCreateSoftwareModuleType("test123"); softwareModuleTypeManagement @@ -107,9 +109,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(status().isOk()); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with sorting by MAXASSIGNMENTS field. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with sorting by MAXASSIGNMENTS field.") public void getSoftwareModuleTypesSortedByMaxAssignments() throws Exception { final SoftwareModuleType testType = createTestType(); @@ -149,9 +153,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath("$.total", equalTo(4))); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests when max assignment is smaller than 1 + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests when max assignment is smaller than 1") public void createSoftwareModuleTypesInvalidAssignmentBadRequest() throws Exception { final List types = new ArrayList<>(); @@ -172,9 +178,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(status().isBadRequest()); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes POST requests.") public void createSoftwareModuleTypes() throws Exception { final List types = Arrays.asList( @@ -223,9 +231,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt assertThat(softwareModuleTypeManagement.count()).isEqualTo(6); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} GET requests. + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} GET requests.") public void getSoftwareModuleType() throws Exception { final SoftwareModuleType testType = createTestType(); @@ -244,9 +254,11 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath("$.deleted", equalTo(testType.isDeleted()))); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} DELETE requests (hard delete scenario). + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} DELETE requests (hard delete scenario).") public void deleteSoftwareModuleTypeUnused() throws Exception { final SoftwareModuleType testType = createTestType(); @@ -259,17 +271,20 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt assertThat(softwareModuleTypeManagement.count()).isEqualTo(3); } - @Test - @Description("Ensures that module type deletion request to API on an entity that does not exist results in NOT_FOUND.") - public void deleteSoftwareModuleTypeThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that module type deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test public void deleteSoftwareModuleTypeThatDoesNotExistLeadsToNotFound() throws Exception { mvc.perform(delete("/rest/v1/softwaremoduletypes/1234")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} DELETE requests (soft delete scenario). + */ @Test @WithUser(principal = "uploadTester", allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} DELETE requests (soft delete scenario).") public void deleteSoftwareModuleTypeUsed() throws Exception { final SoftwareModuleType testType = createTestType(); softwareModuleManagement @@ -294,9 +309,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt assertThat(softwareModuleTypeManagement.count()).isEqualTo(3); } - @Test - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} PUT requests.") - public void updateSoftwareModuleTypeColourDescriptionAndNameUntouched() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes/{ID} PUT requests. + */ + @Test public void updateSoftwareModuleTypeColourDescriptionAndNameUntouched() throws Exception { final SoftwareModuleType testType = createTestType(); final String body = new JSONObject().put("id", testType.getId()).put("description", "foobardesc") @@ -314,9 +330,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt } - @Test - @Description("Tests the update of the deletion flag. It is verfied that the software module type can't be marked as deleted through update operation.") - public void updateSoftwareModuleTypeDeletedFlag() throws Exception { + /** + * Tests the update of the deletion flag. It is verfied that the software module type can't be marked as deleted through update operation. + */ + @Test public void updateSoftwareModuleTypeDeletedFlag() throws Exception { SoftwareModuleType testType = createTestType(); final String body = new JSONObject().put("id", testType.getId()).put("deleted", true).toString(); @@ -334,9 +351,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt assertThat(testType.isDeleted()).isFalse(); } - @Test - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.") - public void getSoftwareModuleTypesWithoutAddtionalRequestParameters() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging. + */ + @Test public void getSoftwareModuleTypesWithoutAddtionalRequestParameters() throws Exception { final int types = 3; mvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)) .andDo(MockMvcResultPrinter.print()) @@ -346,9 +364,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); } - @Test - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.") - public void getSoftwareModuleTypesWithPagingLimitRequestParameter() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging. + */ + @Test public void getSoftwareModuleTypesWithPagingLimitRequestParameter() throws Exception { final int types = 3; final int limitSize = 1; mvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) @@ -360,9 +379,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.") - public void getSoftwareModuleTypesWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging. + */ + @Test public void getSoftwareModuleTypesWithPagingLimitAndOffsetRequestParameter() throws Exception { final int types = 3; final int offsetParam = 2; final int expectedSize = types - offsetParam; @@ -376,9 +396,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } - @Test - @Description("Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.).") - public void invalidRequestsOnSoftwaremoduleTypesResource() throws Exception { + /** + * Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.). + */ + @Test public void invalidRequestsOnSoftwaremoduleTypesResource() throws Exception { final SoftwareModuleType testType = createTestType(); final List types = Collections.singletonList(testType); @@ -436,9 +457,10 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt } - @Test - @Description("Search erquest of software module types.") - public void searchSoftwareModuleTypeRsql() throws Exception { + /** + * Search erquest of software module types. + */ + @Test public void searchSoftwareModuleTypeRsql() throws Exception { softwareModuleTypeManagement.create(entityFactory.softwareModuleType().create().key("test123") .name("TestName123").description("Desc123").maxAssignments(5)); softwareModuleTypeManagement.create(entityFactory.softwareModuleType().create().key("test1234") diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetFilterQueryResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetFilterQueryResourceTest.java index 55c843746..1aab90954 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetFilterQueryResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetFilterQueryResourceTest.java @@ -26,10 +26,6 @@ import java.nio.charset.StandardCharsets; import java.util.List; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -59,9 +55,10 @@ import org.springframework.web.util.UriUtils; /** * Spring MVC Tests against the MgmtTargetResource. + *

+ * Feature: Component Tests - Management API
+ * Story: Target Filter Query Resource */ -@Feature("Component Tests - Management API") -@Story("Target Filter Query Resource") public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiIntegrationTest { private static final String JSON_PATH_ROOT = "$"; @@ -94,9 +91,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte private static final String JSON_PATH_EXCEPTION_CLASS = JSON_PATH_ROOT + JSON_PATH_FIELD_EXCEPTION_CLASS; private static final String JSON_PATH_ERROR_CODE = JSON_PATH_ROOT + JSON_PATH_FIELD_ERROR_CODE; - @Test - @Description("Handles the GET request of retrieving all target filter queries within SP.") - public void getTargetFilterQueries() throws Exception { + /** + * Handles the GET request of retrieving all target filter queries within SP. + */ + @Test public void getTargetFilterQueries() throws Exception { final String filterName = "filter_01"; createSingleTargetFilterQuery(filterName, "name==test_01"); mvc.perform(get(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING)) @@ -104,17 +102,19 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andDo(MockMvcResultPrinter.print()); } - @Test - @Description("Handles the GET request of retrieving all target filter queries within SP based by parameter. Required Permission: READ_TARGET.") - public void getTargetFilterQueriesWithParameters() throws Exception { + /** + * Handles the GET request of retrieving all target filter queries within SP based by parameter. Required Permission: READ_TARGET. + */ + @Test public void getTargetFilterQueriesWithParameters() throws Exception { mvc.perform(get(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==*1")) .andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()); } - @Test - @Description("Handles the POST request of creating a new target filter query within SP.") - public void createTargetFilterQuery() throws Exception { + /** + * Handles the POST request of creating a new target filter query within SP. + */ + @Test public void createTargetFilterQuery() throws Exception { final String name = "test_02"; final String filterQuery = "name==test_02"; final String body = new JSONObject() @@ -127,9 +127,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(status().isCreated()); } - @Test - @Description("Ensures that deletion is executed if permitted.") - public void deleteTargetFilterQueryReturnsOK() throws Exception { + /** + * Ensures that deletion is executed if permitted. + */ + @Test public void deleteTargetFilterQueryReturnsOK() throws Exception { final String filterName = "filter_01"; final TargetFilterQuery filterQuery = createSingleTargetFilterQuery(filterName, "name==test_01"); @@ -139,18 +140,20 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(targetFilterQueryManagement.get(filterQuery.getId())).isNotPresent(); } - @Test - @Description("Ensures that deletion is refused with not found if target does not exist.") - public void deleteTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { + /** + * Ensures that deletion is refused with not found if target does not exist. + */ + @Test public void deleteTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { final String notExistingId = "4395"; mvc.perform(delete(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/" + notExistingId)) .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that update is refused with not found if target does not exist.") - public void updateTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { + /** + * Ensures that update is refused with not found if target does not exist. + */ + @Test public void updateTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { final String notExistingId = "4395"; mvc.perform(put(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/" + notExistingId).content("{}") .contentType(MediaType.APPLICATION_JSON)) @@ -158,9 +161,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that update request is reflected by repository.") - public void updateTargetFilterQueryQuery() throws Exception { + /** + * Ensures that update request is reflected by repository. + */ + @Test public void updateTargetFilterQueryQuery() throws Exception { final String filterName = "filter_02"; final String filterQuery = "name==test_02"; final String filterQuery2 = "name==test_02_changed"; @@ -183,9 +187,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(tfqCheck.getName()).isEqualTo(filterName); } - @Test - @Description("Ensures that update request is reflected by repository.") - public void updateTargetFilterQueryName() throws Exception { + /** + * Ensures that update request is reflected by repository. + */ + @Test public void updateTargetFilterQueryName() throws Exception { final String filterName = "filter_03"; final String filterName2 = "filter_03_changed"; final String filterQuery = "name==test_03"; @@ -209,9 +214,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(tfqCheck.getName()).isEqualTo(filterName2); } - @Test - @Description("Ensures that request returns list of filters in defined format.") - public void getTargetFilterQueryWithoutAdditionalRequestParameters() throws Exception { + /** + * Ensures that request returns list of filters in defined format. + */ + @Test public void getTargetFilterQueryWithoutAdditionalRequestParameters() throws Exception { final int knownTargetAmount = 3; final String idA = "a"; final String idB = "b"; @@ -239,9 +245,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath("$.content.[?(@.name=='" + idC + "')].query", contains(testQuery))); } - @Test - @Description("Ensures that request returns list of filters in defined format in size reduced by given limit parameter.") - public void getTargetWithPagingLimitRequestParameter() throws Exception { + /** + * Ensures that request returns list of filters in defined format in size reduced by given limit parameter. + */ + @Test public void getTargetWithPagingLimitRequestParameter() throws Exception { final int limitSize = 1; final int knownTargetAmount = 3; final String idA = "a"; @@ -307,9 +314,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte UriUtils.decode(resultDSURIFromMultipleJson, StandardCharsets.UTF_8)); } - @Test - @Description("Ensures that request returns list of filters in defined format in size reduced by given limit and offset parameter.") - public void getTargetWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Ensures that request returns list of filters in defined format in size reduced by given limit and offset parameter. + */ + @Test public void getTargetWithPagingLimitAndOffsetRequestParameter() throws Exception { final int knownTargetAmount = 5; final int offsetParam = 2; final int expectedSize = knownTargetAmount - offsetParam; @@ -343,9 +351,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath("$.content.[?(@.name=='" + idE + "')].query", contains(testQuery))); } - @Test - @Description("Ensures that a single target filter query can be retrieved via its id.") - public void getSingleTarget() throws Exception { + /** + * Ensures that a single target filter query can be retrieved via its id. + */ + @Test public void getSingleTarget() throws Exception { // create first a target which can be retrieved by rest interface final String knownQuery = "name==test01"; final String knownName = "someName"; @@ -363,9 +372,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath("$._links.autoAssignDS.href", equalTo(hrefPrefix + "/autoAssignDS"))); } - @Test - @Description("Ensures that the retrieval of a non-existing target filter query results in a HTTP Not found error (404).") - public void getSingleTargetNoExistsResponseNotFound() throws Exception { + /** + * Ensures that the retrieval of a non-existing target filter query results in a HTTP Not found error (404). + */ + @Test public void getSingleTargetNoExistsResponseNotFound() throws Exception { final String targetIdNotExists = "546546"; // test @@ -380,9 +390,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REPO_ENTITY_NOT_EXISTS.getKey()); } - @Test - @Description("Ensures that the creation of a target filter query based on an invalid request payload results in a HTTP Bad Request error (400).") - public void createTargetFilterQueryWithBadPayloadBadRequest() throws Exception { + /** + * Ensures that the creation of a target filter query based on an invalid request payload results in a HTTP Bad Request error (400). + */ + @Test public void createTargetFilterQueryWithBadPayloadBadRequest() throws Exception { final String notJson = "abc"; final MvcResult mvcResult = mvc @@ -401,9 +412,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REST_BODY_NOT_READABLE.getKey()); } - @Test - @Description("Ensures that the creation of a target filter query based on an invalid RSQL query results in a HTTP Bad Request error (400).") - public void createTargetFilterWithInvalidQuery() throws Exception { + /** + * Ensures that the creation of a target filter query based on an invalid RSQL query results in a HTTP Bad Request error (400). + */ + @Test public void createTargetFilterWithInvalidQuery() throws Exception { final String invalidQuery = "name=abc"; final String body = new JSONObject().put("query", invalidQuery).put("name", "invalidFilter").toString(); @@ -416,9 +428,11 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(targetFilterQueryManagement.count()).isZero(); } + /** + * Ensures that the assignment of an auto-assign distribution set results in a HTTP Forbidden error (403) + * if the (existing) query addresses too many targets. + */ @Test - @Description("Ensures that the assignment of an auto-assign distribution set results in a HTTP Forbidden error (403) " - + "if the (existing) query addresses too many targets.") public void setAutoAssignDistributionSetOnFilterQueryThatExceedsQuota() throws Exception { // create targets @@ -439,9 +453,11 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath(JSON_PATH_ERROR_CODE, equalTo(SpServerError.SP_QUOTA_EXCEEDED.getKey()))); } + /** + * Ensures that the update of a target filter query results in a HTTP Forbidden error (403) + * if the updated query addresses too many targets. + */ @Test - @Description("Ensures that the update of a target filter query results in a HTTP Forbidden error (403) " - + "if the updated query addresses too many targets.") public void updateTargetFilterQueryWithQueryThatExceedsQuota() throws Exception { // create targets final int maxTargets = quotaManagement.getMaxTargetsPerAutoAssignment(); @@ -476,9 +492,11 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte } + /** + * Ensures that the distribution set auto-assignment works as intended with distribution set, action type and confirmation validation + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Ensures that the distribution set auto-assignment works as intended with distribution set, action type and confirmation validation") public void setAutoAssignDistributionSetToTargetFilterQuery(final boolean confirmationFlowActive, final Boolean confirmationRequired) throws Exception { final String knownQuery = "name==test05"; @@ -503,9 +521,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte verifyAutoAssignmentWithSoftDeletedDs(tfq); } - @Test - @Description("Handles the GET request of retrieving a the auto assign distribution set of a target filter query within SP.") - public void getAssignDS() throws Exception { + /** + * Handles the GET request of retrieving a the auto assign distribution set of a target filter query within SP. + */ + @Test public void getAssignDS() throws Exception { final TargetFilterQuery filterQuery = createSingleTargetFilterQuery("filter_01", "name==test_01"); final DistributionSet ds = testdataFactory.createDistributionSet("ds"); targetFilterQueryManagement @@ -518,9 +537,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(status().isOk()); } - @Test - @Description("Handles the POST request of setting a distribution set for auto assignment within SP.") - public void createAutoAssignDS() throws Exception { + /** + * Handles the POST request of setting a distribution set for auto assignment within SP. + */ + @Test public void createAutoAssignDS() throws Exception { enableMultiAssignments(); enableConfirmationFlow(); @@ -537,9 +557,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(status().isOk()); } - @Test - @Description("Handles the DELETE request of deleting the auto assign distribution set from a target filter query within SP.") - public void deleteAutoAssignDS() throws Exception { + /** + * Handles the DELETE request of deleting the auto assign distribution set from a target filter query within SP. + */ + @Test public void deleteAutoAssignDS() throws Exception { final String filterName = "filter_01"; final TargetFilterQuery filterQuery = createSingleTargetFilterQuery(filterName, "name==test_01"); mvc @@ -550,9 +571,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(status().isNoContent()); } - @Test - @Description("Ensures that the deletion of auto-assignment distribution set works as intended, deleting the auto-assignment action type as well") - public void deleteAutoAssignDistributionSetOfTargetFilterQuery() throws Exception { + /** + * Ensures that the deletion of auto-assignment distribution set works as intended, deleting the auto-assignment action type as well + */ + @Test public void deleteAutoAssignDistributionSetOfTargetFilterQuery() throws Exception { final String knownQuery = "name==test06"; final String knownName = "filter06"; final String dsName = "testDS"; @@ -585,9 +607,10 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte } - @Test - @Description("An auto assignment containing a weight is only accepted when weight is valide and multi assignment is on.") - public void weightValidation() throws Exception { + /** + * An auto assignment containing a weight is only accepted when weight is valide and multi assignment is on. + */ + @Test public void weightValidation() throws Exception { final Long filterId = createSingleTargetFilterQuery("filter1", "name==*").getId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -615,9 +638,11 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte assertThat(filters.get(0).getAutoAssignWeight()).contains(45); } + /** + * Verify the confirmation required flag will be set based on the feature state + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verify the confirmation required flag will be set based on the feature state") void verifyConfirmationStateIfNotProvided(final boolean confirmationFlowActive) throws Exception { final String knownQuery = "name==test05"; final String knownName = "filter05"; @@ -642,19 +667,16 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte Arguments.of(true, null), Arguments.of(false, null)); } - @Step private void verifyAutoAssignmentWithoutActionType(final TargetFilterQuery tfq, final DistributionSet set, final Boolean confirmationRequired) throws Exception { verifyAutoAssignmentByActionType(tfq, set, null, confirmationRequired); } - @Step private void verifyAutoAssignmentWithForcedActionType(final TargetFilterQuery tfq, final DistributionSet set, final Boolean confirmationRequired) throws Exception { verifyAutoAssignmentByActionType(tfq, set, MgmtActionType.FORCED, confirmationRequired); } - @Step private void verifyAutoAssignmentWithSoftActionType(final TargetFilterQuery tfq, final DistributionSet set, final Boolean confirmationRequired) throws Exception { verifyAutoAssignmentByActionType(tfq, set, MgmtActionType.SOFT, confirmationRequired); @@ -702,7 +724,6 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath("$._links.autoAssignDS.href", equalTo(hrefPrefix + "/autoAssignDS"))); } - @Step private void verifyAutoAssignmentWithTimeForcedActionType(final TargetFilterQuery tfq, final DistributionSet set) throws Exception { mvc.perform(post(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/" + tfq.getId() + "/autoAssignDS") @@ -716,13 +737,11 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte equalTo(SpServerError.SP_AUTO_ASSIGN_ACTION_TYPE_INVALID.getKey()))); } - @Step private void verifyAutoAssignmentWithDownloadOnlyActionType(final TargetFilterQuery tfq, final DistributionSet set, final Boolean confirmationRequired) throws Exception { verifyAutoAssignmentByActionType(tfq, set, MgmtActionType.DOWNLOAD_ONLY, confirmationRequired); } - @Step private void verifyAutoAssignmentWithUnknownActionType(final TargetFilterQuery tfq, final DistributionSet set) throws Exception { mvc.perform(post(MgmtRestConstants.TARGET_FILTER_V1_REQUEST_MAPPING + "/" + tfq.getId() + "/autoAssignDS") @@ -733,7 +752,6 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath(JSON_PATH_ERROR_CODE, equalTo(SpServerError.SP_REST_BODY_NOT_READABLE.getKey()))); } - @Step private void verifyAutoAssignmentWithIncompleteDs(final TargetFilterQuery tfq) throws Exception { final DistributionSet incompleteDistributionSet = distributionSetManagement .create(entityFactory.distributionSet().create().name("incomplete").version("1") @@ -748,7 +766,6 @@ public class MgmtTargetFilterQueryResourceTest extends AbstractManagementApiInte .andExpect(jsonPath(JSON_PATH_ERROR_CODE, equalTo(SpServerError.SP_DS_INCOMPLETE.getKey()))); } - @Step private void verifyAutoAssignmentWithSoftDeletedDs(final TargetFilterQuery tfq) throws Exception { final DistributionSet softDeletedDs = testdataFactory.createDistributionSet("softDeleted"); assignDistributionSet(softDeletedDs, testdataFactory.createTarget("forSoftDeletedDs")); diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java index e1fae0fa0..757756e08 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java @@ -47,10 +47,6 @@ import jakarta.validation.ConstraintViolationException; import com.fasterxml.jackson.databind.ObjectMapper; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.im.authentication.SpPermission; @@ -106,9 +102,10 @@ import org.springframework.test.web.servlet.ResultActions; /** * Spring MVC Tests against the MgmtTargetResource. + *

+ * Feature: Component Tests - Management API
+ * Story: Target Resource */ -@Feature("Component Tests - Management API") -@Story("Target Resource") class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { private static final String TARGET_DESCRIPTION_TEST = "created in test"; @@ -148,9 +145,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { @Autowired private ObjectMapper objectMapper; - @Test - @Description("Ensures that when targetType value of -1 is provided the target type is unassigned from the target.") - void updateTargetAndUnassignTargetType() throws Exception { + /** + * Ensures that when targetType value of -1 is provided the target type is unassigned from the target. + */ + @Test void updateTargetAndUnassignTargetType() throws Exception { final String knownControllerId = "123"; final String knownNewAddress = "amqp://test123/foobar"; final String knownNameNotModify = "controllerName"; @@ -185,9 +183,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Ensures that when targetType value of -1 is provided the target type is unassigned from the target when updating multiple fields in target object.") - void updateTargetNameAndUnassignTargetType() throws Exception { + /** + * Ensures that when targetType value of -1 is provided the target type is unassigned from the target when updating multiple fields in target object. + */ + @Test void updateTargetNameAndUnassignTargetType() throws Exception { final String knownControllerId = "123"; final String knownNewAddress = "amqp://test123/foobar"; final String knownNameNotModify = "controllerName"; @@ -225,26 +224,29 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.targetType").doesNotExist()); } - @Test - @Description("Handles the GET request of retrieving all targets within SP..") - void getTargets() throws Exception { + /** + * Handles the GET request of retrieving all targets within SP.. + */ + @Test void getTargets() throws Exception { enableConfirmationFlow(); mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)) .andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()); } - @Test - @Description("Handles the GET request of retrieving all targets within SP based by parameter.") - void getTargetsWithParameters() throws Exception { + /** + * Handles the GET request of retrieving all targets within SP based by parameter. + */ + @Test void getTargetsWithParameters() throws Exception { mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==a")) .andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()); } - @Test - @Description("Handles the POST request to activate auto-confirm on a target. Payload can be provided to specify more details about the operation.") - void postActivateAutoConfirm() throws Exception { + /** + * Handles the POST request to activate auto-confirm on a target. Payload can be provided to specify more details about the operation. + */ + @Test void postActivateAutoConfirm() throws Exception { final Target testTarget = testdataFactory.createTarget("targetId"); final MgmtTargetAutoConfirmUpdate body = new MgmtTargetAutoConfirmUpdate("custom_initiator_value", @@ -257,9 +259,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("Handles the POST request to deactivate auto-confirm on a target.") - void postDeactivateAutoConfirm() throws Exception { + /** + * Handles the POST request to deactivate auto-confirm on a target. + */ + @Test void postDeactivateAutoConfirm() throws Exception { final Target testTarget = testdataFactory.createTarget("targetId"); confirmationManagement.activateAutoConfirmation(testTarget.getControllerId(), null, null); @@ -269,9 +272,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("Test confirmation of single Action with confirm status. Check that Action goes into Running status with appropriate messages and status code") - void updateActionConfirmationWithConfirm() throws Exception { + /** + * Test confirmation of single Action with confirm status. Check that Action goes into Running status with appropriate messages and status code + */ + @Test void updateActionConfirmationWithConfirm() throws Exception { final int expectedStatusCode = 210; final String expectedStatusMessage1 = "some-custom-message1"; final String expectedStatusMessage2 = "some-custom-message2"; @@ -280,9 +284,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { testActionConfirmation("targetId", actionId, MgmtActionConfirmationRequestBodyPut.Confirmation.CONFIRMED, expectedStatusCode, new String[]{expectedStatusMessage1, expectedStatusMessage2}, HttpStatus.OK ,expectedStatusAfterActionConfirmationCall); } - @Test - @Description("Test confirmation of single Action with deny status. Check that Action stays in WAIT_FOR_CONFIRMATION status with appropriate messages and status code") - void updateActionConfirmationWithDeny() throws Exception { + /** + * Test confirmation of single Action with deny status. Check that Action stays in WAIT_FOR_CONFIRMATION status with appropriate messages and status code + */ + @Test void updateActionConfirmationWithDeny() throws Exception { final int expectedStatusCode = 410; final String expectedStatusMessage1 = "some-error-custom-message1"; final String expectedStatusMessage2 = "some-error-custom-message2"; @@ -291,9 +296,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { testActionConfirmation("targetId", actionId, MgmtActionConfirmationRequestBodyPut.Confirmation.DENIED, expectedStatusCode, new String[]{expectedStatusMessage1, expectedStatusMessage2}, HttpStatus.OK, expectedStatusAfterActionConfirmationCall); } - @Test - @Description("Test confirmation of single Action with wrong ControllerId - e.g. the given Action is not assigned to the given Target - confirmation call must fail.") - void updateActionConfirmationFailsIfActionNotAssignedToTarget() throws Exception { + /** + * Test confirmation of single Action with wrong ControllerId - e.g. the given Action is not assigned to the given Target - confirmation call must fail. + */ + @Test void updateActionConfirmationFailsIfActionNotAssignedToTarget() throws Exception { final int payloadCallCode = 200; final String payloadCallMessage1 = "random1"; final String payloadCallMessage2 = "random2"; @@ -364,9 +370,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { } } - @Test - @Description("Ensures that actions list is in expected order.") - void getActionStatusReturnsCorrectType() throws Exception { + /** + * Ensures that actions list is in expected order. + */ + @Test void getActionStatusReturnsCorrectType() throws Exception { final int limitSize = 2; final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -395,9 +402,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content.[1].type", equalTo("canceling"))); } - @Test - @Description("Ensures that security token is not returned if user does not have READ_TARGET_SEC_TOKEN permission.") - @WithUser(allSpPermissions = false, authorities = { SpPermission.READ_TARGET, SpPermission.CREATE_TARGET }) + /** + * Ensures that security token is not returned if user does not have READ_TARGET_SEC_TOKEN permission. + */ + @Test @WithUser(allSpPermissions = false, authorities = { SpPermission.READ_TARGET, SpPermission.CREATE_TARGET }) void securityTokenIsNotInResponseIfMissingPermission() throws Exception { final String knownControllerId = "knownControllerId"; @@ -408,9 +416,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("securityToken").doesNotExist()); } - @Test - @Description("Ensures that security token is returned if user does have READ_TARGET_SEC_TOKEN permission.") - @WithUser(allSpPermissions = false, authorities = { SpPermission.READ_TARGET, SpPermission.CREATE_TARGET, + /** + * Ensures that security token is returned if user does have READ_TARGET_SEC_TOKEN permission. + */ + @Test @WithUser(allSpPermissions = false, authorities = { SpPermission.READ_TARGET, SpPermission.CREATE_TARGET, SpPermission.READ_TARGET_SEC_TOKEN }) void securityTokenIsInResponseWithCorrectPermission() throws Exception { @@ -422,9 +431,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("securityToken", equalTo(createTarget.getSecurityToken()))); } - @Test - @Description("Ensures that that IP address is in result as stored in the repository.") - void addressAndIpAddressInTargetResult() throws Exception { + /** + * Ensures that that IP address is in result as stored in the repository. + */ + @Test void addressAndIpAddressInTargetResult() throws Exception { // prepare targets with IP final String knownControllerId1 = "0815"; final String knownControllerId2 = "4711"; @@ -448,9 +458,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { contains(IpUtil.createHttpUri("127.0.0.1").toString()))); } - @Test - @Description("Ensures that actions history is returned as defined by filter status==pending,status==finished.") - void searchActionsRsql() throws Exception { + /** + * Ensures that actions history is returned as defined by filter status==pending,status==finished. + */ + @Test void searchActionsRsql() throws Exception { // prepare test final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -489,9 +500,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0].status", equalTo("pending"))); } - @Test - @Description("Ensures that a deletion of an active action results in cancellation triggered.") - void cancelActionOK() throws Exception { + /** + * Ensures that a deletion of an active action results in cancellation triggered. + */ + @Test void cancelActionOK() throws Exception { // prepare test final Target tA = createTargetAndStartAction(); @@ -516,9 +528,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(deploymentManagement.getInstalledDistributionSet(tA.getControllerId())).isNotPresent(); } - @Test - @Description("Ensures that method not allowed is returned if cancellation is triggered on already canceled action.") - void cancelAndCancelActionIsNotAllowed() throws Exception { + /** + * Ensures that method not allowed is returned if cancellation is triggered on already canceled action. + */ + @Test void cancelAndCancelActionIsNotAllowed() throws Exception { // prepare test final Target tA = createTargetAndStartAction(); @@ -538,9 +551,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Force Quit an Action, which is already canceled. Expected Result is an HTTP response code 204.") - void forceQuitAnCanceledActionReturnsOk() throws Exception { + /** + * Force Quit an Action, which is already canceled. Expected Result is an HTTP response code 204. + */ + @Test void forceQuitAnCanceledActionReturnsOk() throws Exception { final Target tA = createTargetAndStartAction(); @@ -561,9 +575,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isNoContent()); } - @Test - @Description("Force Quit an Action, which is not canceled. Expected Result is an HTTP response code 405.") - void forceQuitAnNotCanceledActionReturnsMethodNotAllowed() throws Exception { + /** + * Force Quit an Action, which is not canceled. Expected Result is an HTTP response code 405. + */ + @Test void forceQuitAnNotCanceledActionReturnsMethodNotAllowed() throws Exception { final Target tA = createTargetAndStartAction(); @@ -576,9 +591,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Ensures that deletion is executed if permitted.") - void deleteTargetReturnsOK() throws Exception { + /** + * Ensures that deletion is executed if permitted. + */ + @Test void deleteTargetReturnsOK() throws Exception { final String knownControllerId = "knownControllerIdDelete"; testdataFactory.createTarget(knownControllerId); @@ -588,18 +604,20 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getByControllerID(knownControllerId)).isNotPresent(); } - @Test - @Description("Ensures that deletion is refused with not found if target does not exist.") - void deleteTargetWhichDoesNotExistsLeadsToNotFound() throws Exception { + /** + * Ensures that deletion is refused with not found if target does not exist. + */ + @Test void deleteTargetWhichDoesNotExistsLeadsToNotFound() throws Exception { final String knownControllerId = "knownControllerIdDelete"; mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that update is refused with not found if target does not exist.") - void updateTargetWhichDoesNotExistsLeadsToNotFound() throws Exception { + /** + * Ensures that update is refused with not found if target does not exist. + */ + @Test void updateTargetWhichDoesNotExistsLeadsToNotFound() throws Exception { final String knownControllerId = "knownControllerIdUpdate"; mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId).content("{}") .contentType(MediaType.APPLICATION_JSON)) @@ -607,9 +625,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isNotFound()); } - @Test - @Description("Ensures that target update request is reflected by repository.") - void updateTargetDescription() throws Exception { + /** + * Ensures that target update request is reflected by repository. + */ + @Test void updateTargetDescription() throws Exception { final String knownControllerId = "123"; final String knownNewDescription = "a new desc updated over rest"; final String knownNameNotModify = "nameNotModify"; @@ -632,9 +651,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(findTargetByControllerID.getName()).isEqualTo(knownNameNotModify); } - @Test - @Description("Ensures that target update request fails is updated value fails against a constraint.") - void updateTargetDescriptionFailsIfInvalidLength() throws Exception { + /** + * Ensures that target update request fails is updated value fails against a constraint. + */ + @Test void updateTargetDescriptionFailsIfInvalidLength() throws Exception { final String knownControllerId = "123"; final String knownNewDescription = randomString(513); final String knownNameNotModify = "nameNotModify"; @@ -653,9 +673,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(findTargetByControllerID.getDescription()).isEqualTo("old description"); } - @Test - @Description("Ensures that target update request is reflected by repository.") - void updateTargetSecurityToken() throws Exception { + /** + * Ensures that target update request is reflected by repository. + */ + @Test void updateTargetSecurityToken() throws Exception { final String knownControllerId = "123"; final String knownNewToken = "6567576565"; final String knownNameNotModify = "nameNotModify"; @@ -678,9 +699,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(findTargetByControllerID.getName()).isEqualTo(knownNameNotModify); } - @Test - @Description("Ensures that target update request is reflected by repository.") - void updateTargetAddress() throws Exception { + /** + * Ensures that target update request is reflected by repository. + */ + @Test void updateTargetAddress() throws Exception { final String knownControllerId = "123"; final String knownNewAddress = "amqp://test123/foobar"; final String knownNameNotModify = "nameNotModify"; @@ -703,9 +725,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(findTargetByControllerID.getName()).isEqualTo(knownNameNotModify); } - @Test - @Description("Ensures that target query returns list of targets in defined format.") - void getTargetWithoutAdditionalRequestParameters() throws Exception { + /** + * Ensures that target query returns list of targets in defined format. + */ + @Test void getTargetWithoutAdditionalRequestParameters() throws Exception { final int knownTargetAmount = 3; final String idA = "a"; final String idB = "b"; @@ -747,9 +770,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.content.[?(@.name=='" + idA + "')].lastControllerRequestAt", notNullValue())); } - @Test - @Description("Ensures that target query returns list of targets in defined format in size reduced by given limit parameter.") - void getTargetWithPagingLimitRequestParameter() throws Exception { + /** + * Ensures that target query returns list of targets in defined format in size reduced by given limit parameter. + */ + @Test void getTargetWithPagingLimitRequestParameter() throws Exception { final int knownTargetAmount = 3; final int limitSize = 1; createTargetsAlphabetical(knownTargetAmount); @@ -773,9 +797,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.content.[?(@.name=='" + idA + "')].updateStatus", contains("registered"))); } - @Test - @Description("Ensures that target query returns list of targets in defined format in size reduced by given limit and offset parameter.") - void getTargetWithPagingLimitAndOffsetRequestParameter() throws Exception { + /** + * Ensures that target query returns list of targets in defined format in size reduced by given limit and offset parameter. + */ + @Test void getTargetWithPagingLimitAndOffsetRequestParameter() throws Exception { final int knownTargetAmount = 5; final int offsetParam = 2; final int expectedSize = knownTargetAmount - offsetParam; @@ -819,9 +844,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.content.[?(@.name=='" + idE + "')].updateStatus", contains("registered"))); } - @Test - @Description("Ensures that the get request for a target works.") - void getSingleTarget() throws Exception { + /** + * Ensures that the get request for a target works. + */ + @Test void getSingleTarget() throws Exception { // create first a target which can be retrieved by rest interface final String knownControllerId = "1"; final String knownName = "someName"; @@ -844,9 +870,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { equalTo(hrefPrefix + "actions" + "?offset=0&limit=50&sort=id%3ADESC"))); } - @Test - @Description("Ensures that target get request returns a not found if the target does not exits.") - void getSingleTargetNoExistsResponseNotFound() throws Exception { + /** + * Ensures that target get request returns a not found if the target does not exits. + */ + @Test void getSingleTargetNoExistsResponseNotFound() throws Exception { final String targetIdNotExists = "bubu"; @@ -862,9 +889,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REPO_ENTITY_NOT_EXISTS.getKey()); } - @Test - @Description("Ensures that get request for asigned distribution sets returns no count if no distribution set has been assigned.") - void getAssignedDistributionSetOfTargetIsEmpty() throws Exception { + /** + * Ensures that get request for asigned distribution sets returns no count if no distribution set has been assigned. + */ + @Test void getAssignedDistributionSetOfTargetIsEmpty() throws Exception { // create first a target which can be retrieved by rest interface final String knownControllerId = "1"; final String knownName = "someName"; @@ -877,9 +905,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Ensures that the get request for asigned distribution sets works.") - void getAssignedDistributionSetOfTarget() throws Exception { + /** + * Ensures that the get request for asigned distribution sets works. + */ + @Test void getAssignedDistributionSetOfTarget() throws Exception { // create first a target which can be retrieved by rest interface final String knownControllerId = "1"; final String knownName = "someName"; @@ -935,9 +964,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { } - @Test - @Description("Ensures that get request for installed distribution sets returns no count if no distribution set has been installed.") - void getInstalledDistributionSetOfTargetIsEmpty() throws Exception { + /** + * Ensures that get request for installed distribution sets returns no count if no distribution set has been installed. + */ + @Test void getInstalledDistributionSetOfTargetIsEmpty() throws Exception { // create first a target which can be retrieved by rest interface final String knownControllerId = "1"; final String knownName = "someName"; @@ -948,9 +978,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(content().string("")); } - @Test - @Description("Ensures that a target creation with empty name and a controllerId that exceeds the name length limitation is successful and the name gets truncated.") - void createTargetWithEmptyNameAndLongControllerId() throws Exception { + /** + * Ensures that a target creation with empty name and a controllerId that exceeds the name length limitation is successful and the name gets truncated. + */ + @Test void createTargetWithEmptyNameAndLongControllerId() throws Exception { final String randomString = randomString(JpaTarget.CONTROLLER_ID_MAX_SIZE); final Target target = entityFactory.target().create().controllerId(randomString).build(); @@ -969,9 +1000,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getByControllerID(randomString).get().getName()).isEqualTo(expectedTargetName); } - @Test - @Description("Ensures that post request for creating a target with no payload returns a bad request.") - void createTargetWithoutPayloadBadRequest() throws Exception { + /** + * Ensures that post request for creating a target with no payload returns a bad request. + */ + @Test void createTargetWithoutPayloadBadRequest() throws Exception { final MvcResult mvcResult = mvc .perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).contentType(MediaType.APPLICATION_JSON)) @@ -988,9 +1020,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getMessage()).isEqualTo(SpServerError.SP_REST_BODY_NOT_READABLE.getMessage()); } - @Test - @Description("Ensures that post request for creating a target with invalid payload returns a bad request.") - void createTargetWithBadPayloadBadRequest() throws Exception { + /** + * Ensures that post request for creating a target with invalid payload returns a bad request. + */ + @Test void createTargetWithBadPayloadBadRequest() throws Exception { final String notJson = "abc"; final MvcResult mvcResult = mvc @@ -1009,9 +1042,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REST_BODY_NOT_READABLE.getKey()); } - @Test - @Description("Verifies that a mandatory properties of new targets are validated as not null.") - void createTargetWithMissingMandatoryPropertyBadRequest() throws Exception { + /** + * Verifies that a mandatory properties of new targets are validated as not null. + */ + @Test void createTargetWithMissingMandatoryPropertyBadRequest() throws Exception { final MvcResult mvcResult = mvc .perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content("[{\"name\":\"id1\"}]") .contentType(MediaType.APPLICATION_JSON)) @@ -1028,9 +1062,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); } - @Test - @Description("Verifies that a properties of new targets are validated as in allowed size range.") - void createTargetWithInvalidPropertyBadRequest() throws Exception { + /** + * Verifies that a properties of new targets are validated as in allowed size range. + */ + @Test void createTargetWithInvalidPropertyBadRequest() throws Exception { final Target test1 = entityFactory.target().create().controllerId("id1") .name(randomString(NamedEntity.NAME_MAX_SIZE + 1)).build(); @@ -1051,9 +1086,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_REPO_CONSTRAINT_VIOLATION.getKey()); } - @Test - @Description("Ensures that a post request for creating multiple targets works.") - void createTargetsListReturnsSuccessful() throws Exception { + /** + * Ensures that a post request for creating multiple targets works. + */ + @Test void createTargetsListReturnsSuccessful() throws Exception { final Target test1 = entityFactory.target().create().controllerId("id1").name("testname1") .securityToken("token").address("amqp://test123/foobar").description("testid1").build(); final Target test2 = entityFactory.target().create().controllerId("id2").name("testname2") @@ -1104,9 +1140,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertTarget("id3", "testname3", "testid3"); } - @Test - @Description("Ensures that a post request for creating one target within a list works.") - void createTargetsSingleEntryListReturnsSuccessful() throws Exception { + /** + * Ensures that a post request for creating one target within a list works. + */ + @Test void createTargetsSingleEntryListReturnsSuccessful() throws Exception { final String knownName = "someName"; final String knownControllerId = "controllerId1"; final String knownDescription = "someDescription"; @@ -1125,9 +1162,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(target.getDescription()).isEqualTo(knownDescription); } - @Test - @Description("Ensures that a post request for creating the same target again leads to a conflict response.") - void createTargetsSingleEntryListDoubleReturnConflict() throws Exception { + /** + * Ensures that a post request for creating the same target again leads to a conflict response. + */ + @Test void createTargetsSingleEntryListDoubleReturnConflict() throws Exception { final String knownName = "someName"; final String knownControllerId = "controllerId1"; final String knownDescription = "someDescription"; @@ -1157,9 +1195,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getMessage()).isEqualTo(SpServerError.SP_REPO_ENTITY_ALREADY_EXISTS.getMessage()); } - @Test - @Description("Ensures that the get request for action of a target returns no actions if nothing has happened.") - void getActionWithEmptyResult() throws Exception { + /** + * Ensures that the get request for action of a target returns no actions if nothing has happened. + */ + @Test void getActionWithEmptyResult() throws Exception { final String knownTargetId = "targetId"; testdataFactory.createTarget(knownTargetId); @@ -1172,9 +1211,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("total", equalTo(0))); } - @Test - @Description("Ensures that the expected response is returned for update action.") - void getUpdateAction() throws Exception { + /** + * Ensures that the expected response is returned for update action. + */ + @Test void getUpdateAction() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -1195,9 +1235,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { equalTo(generateStatusreferenceLink(knownTargetId, actions.get(1).getId())))); } - @Test - @Description("Ensures that the expected response is returned for update action with maintenance window.") - void getUpdateActionWithMaintenanceWindow() throws Exception { + /** + * Ensures that the expected response is returned for update action with maintenance window. + */ + @Test void getUpdateActionWithMaintenanceWindow() throws Exception { final String knownTargetId = "targetId"; final String schedule = getTestSchedule(10); final String duration = getTestDuration(10); @@ -1226,9 +1267,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { equalTo(generateStatusreferenceLink(knownTargetId, actions.get(1).getId())))); } - @Test - @Description("Ensures that the expected response is returned when update action was cancelled.") - void getCancelAction() throws Exception { + /** + * Ensures that the expected response is returned when update action was cancelled. + */ + @Test void getCancelAction() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -1249,9 +1291,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { equalTo(generateStatusreferenceLink(knownTargetId, actions.get(0).getId())))); } - @Test - @Description("Ensures that the expected response is returned when update action with maintenance window was cancelled.") - void getCancelActionWithMaintenanceWindow() throws Exception { + /** + * Ensures that the expected response is returned when update action with maintenance window was cancelled. + */ + @Test void getCancelActionWithMaintenanceWindow() throws Exception { final String knownTargetId = "targetId"; final String schedule = getTestSchedule(10); final String duration = getTestDuration(10); @@ -1280,21 +1323,24 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { equalTo(generateStatusreferenceLink(knownTargetId, actions.get(0).getId())))); } - @Test - @Description("Ensures that the expected response of getting actions of a target is returned.") - void getActions() throws Exception { + /** + * Ensures that the expected response of getting actions of a target is returned. + */ + @Test void getActions() throws Exception { getActions(false); } - @Test - @Description("Ensures that the expected response of getting actions (with ext refs) of a target is returned.") - void getActionsExtRef() throws Exception { + /** + * Ensures that the expected response of getting actions (with ext refs) of a target is returned. + */ + @Test void getActionsExtRef() throws Exception { getActions(true); } - @Test - @Description("Ensures that the expected response of getting actions with maintenance window of a target is returned.") - void getActionsWithMaintenanceWindow() throws Exception { + /** + * Ensures that the expected response of getting actions with maintenance window of a target is returned. + */ + @Test void getActionsWithMaintenanceWindow() throws Exception { final String knownTargetId = "targetId"; final String schedule = getTestSchedule(10); final String duration = getTestDuration(10); @@ -1331,9 +1377,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); } - @Test - @Description("Verifies that the API returns the status list with expected content.") - void getActionsStatus() throws Exception { + /** + * Verifies that the API returns the status list with expected content. + */ + @Test void getActionsStatus() throws Exception { final String knownTargetId = "targetId"; final Action action = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId).get(0); // retrieve list in default descending order for actionstaus entries @@ -1360,9 +1407,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); } - @Test - @Description("Verifies that the API returns the status list with expected content sorted by reportedAt field.") - void getActionsStatusSortedByReportedAt() throws Exception { + /** + * Verifies that the API returns the status list with expected content sorted by reportedAt field. + */ + @Test void getActionsStatusSortedByReportedAt() throws Exception { final String knownTargetId = "targetId"; final Action action = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId).get(0); final List actionStatus = deploymentManagement.findActionStatusByAction(action.getId(), PAGE) @@ -1408,9 +1456,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); } - @Test - @Description("Verifies that the API returns the status list with expected content split into two pages.") - void getActionsStatusWithPagingLimitRequestParameter() throws Exception { + /** + * Verifies that the API returns the status list with expected content split into two pages. + */ + @Test void getActionsStatusWithPagingLimitRequestParameter() throws Exception { final String knownTargetId = "targetId"; final Action action = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId).get(0); @@ -1450,9 +1499,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies getting multiple actions with the paging request parameter.") - void getActionsWithPagingLimitRequestParameter() throws Exception { + /** + * Verifies getting multiple actions with the paging request parameter. + */ + @Test void getActionsWithPagingLimitRequestParameter() throws Exception { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); @@ -1491,9 +1541,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies that an action is switched from soft to forced if requested by management API") - void updateAction() throws Exception { + /** + * Verifies that an action is switched from soft to forced if requested by management API + */ + @Test void updateAction() throws Exception { final Target target = testdataFactory.createTarget(); final DistributionSet set = testdataFactory.createDistributionSet(); final Long actionId = getFirstAssignedActionId( @@ -1520,9 +1571,11 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(deploymentManagement.findAction(actionId).get().getActionType()).isEqualTo(ActionType.FORCED); } + /** + * Verifies that a DS to target assignment is reflected by the repository and that repeating + * the assignment does not change the target. + */ @Test - @Description("Verifies that a DS to target assignment is reflected by the repository and that repeating " - + "the assignment does not change the target.") void assignDistributionSetToTarget() throws Exception { Target target = testdataFactory.createTarget(); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1552,9 +1605,11 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getByControllerID(target.getControllerId()).get()).isEqualTo(target); } + /** + * Ensures that confirmation option is considered in assignment request. + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Ensures that confirmation option is considered in assignment request.") void assignDistributionSetToTargetWithConfirmationOptions(final boolean confirmationFlowActive, final Boolean confirmationRequired) throws Exception { final Target target = testdataFactory.createTarget(); @@ -1594,9 +1649,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { }); } - @Test - @Description("Verifies that a DOWNLOAD_ONLY DS to target assignment is properly handled") - void assignDownloadOnlyDistributionSetToTarget() throws Exception { + /** + * Verifies that a DOWNLOAD_ONLY DS to target assignment is properly handled + */ + @Test void assignDownloadOnlyDistributionSetToTarget() throws Exception { final Target target = testdataFactory.createTarget(); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1616,9 +1672,11 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .extracting(Action::getActionType).containsOnly(ActionType.DOWNLOAD_ONLY); } + /** + * Verifies that an offline DS to target assignment is reflected by the repository and that repeating + * the assignment does not change the target. + */ @Test - @Description("Verifies that an offline DS to target assignment is reflected by the repository and that repeating " - + "the assignment does not change the target.") void offlineAssignDistributionSetToTarget() throws Exception { Target target = testdataFactory.createTarget(); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1675,9 +1733,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(deploymentManagement.getAssignedDistributionSet("fsdfsd").get()).isEqualTo(set); } - @Test - @Description("Assigns distribution set to target with only maintenance schedule.") - void assignDistributionSetToTargetWithMaintenanceWindowStartTimeOnly() throws Exception { + /** + * Assigns distribution set to target with only maintenance schedule. + */ + @Test void assignDistributionSetToTargetWithMaintenanceWindowStartTimeOnly() throws Exception { final Target target = testdataFactory.createTarget("fsdfsd"); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1691,9 +1750,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Test - @Description("Assigns distribution set to target with only maintenance window duration.") - void assignDistributionSetToTargetWithMaintenanceWindowEndTimeOnly() throws Exception { + /** + * Assigns distribution set to target with only maintenance window duration. + */ + @Test void assignDistributionSetToTargetWithMaintenanceWindowEndTimeOnly() throws Exception { final Target target = testdataFactory.createTarget("fsdfsd"); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1707,9 +1767,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Test - @Description("Assigns distribution set to target with valid maintenance window.") - void assignDistributionSetToTargetWithValidMaintenanceWindow() throws Exception { + /** + * Assigns distribution set to target with valid maintenance window. + */ + @Test void assignDistributionSetToTargetWithValidMaintenanceWindow() throws Exception { final Target target = testdataFactory.createTarget("fsdfsd"); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1725,9 +1786,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("Assigns distribution set to target with maintenance window next execution start (should be ignored, calculated automaticaly based on schedule, duration and timezone)") - void assignDistributionSetToTargetWithMaintenanceWindowNextExecutionStart() throws Exception { + /** + * Assigns distribution set to target with maintenance window next execution start (should be ignored, calculated automaticaly based on schedule, duration and timezone) + */ + @Test void assignDistributionSetToTargetWithMaintenanceWindowNextExecutionStart() throws Exception { final Target target = testdataFactory.createTarget("fsdfsd"); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1750,9 +1812,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content.[0].maintenanceWindow.nextStartAt", not(nextExecutionStart))); } - @Test - @Description("Assigns distribution set to target with last maintenance window scheduled before current time.") - void assignDistributionSetToTargetWithMaintenanceWindowEndTimeBeforeStartTime() throws Exception { + /** + * Assigns distribution set to target with last maintenance window scheduled before current time. + */ + @Test void assignDistributionSetToTargetWithMaintenanceWindowEndTimeBeforeStartTime() throws Exception { final Target target = testdataFactory.createTarget("fsdfsd"); final DistributionSet set = testdataFactory.createDistributionSet("one"); @@ -1908,9 +1971,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().is(HttpStatus.NO_CONTENT.value())); } - @Test - @Description("Request update of Controller Attributes.") - void triggerControllerAttributesUpdate() throws Exception { + /** + * Request update of Controller Attributes. + */ + @Test void triggerControllerAttributesUpdate() throws Exception { // create target with attributes final String knownTargetId = "targetIdNeedsUpdate"; final Map knownControllerAttrs = new HashMap<>(); @@ -1971,9 +2035,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.[1].name", in(tagNames))); } - @Test - @Description("Ensures that the metadata creation through API is reflected by the repository.") - void createMetadata() throws Exception { + /** + * Ensures that the metadata creation through API is reflected by the repository. + */ + @Test void createMetadata() throws Exception { final String knownControllerId = "targetIdWithMetadata"; testdataFactory.createTarget(knownControllerId); @@ -2014,9 +2079,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getMetadata(knownControllerId)).hasSize(metaData1.length()); } - @Test - @Description("Ensures that a metadata update through API is reflected by the repository.") - void updateMetadata() throws Exception { + /** + * Ensures that a metadata update through API is reflected by the repository. + */ + @Test void updateMetadata() throws Exception { final String knownControllerId = "targetIdWithMetadata"; final String updateValue = "valueForUpdate"; @@ -2034,9 +2100,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getMetadata(knownControllerId).get(KNOWN_KEY)).isEqualTo(updateValue); } - @Test - @Description("Ensures that a metadata entry deletion through API is reflected by the repository.") - void deleteMetadata() throws Exception { + /** + * Ensures that a metadata entry deletion through API is reflected by the repository. + */ + @Test void deleteMetadata() throws Exception { final String knownControllerId = "targetIdWithMetadata"; setupTargetWithMetadata(knownControllerId, KNOWN_KEY, KNOWN_VALUE); @@ -2053,9 +2120,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getMetadata(knownControllerId).get(KNOWN_KEY)).isNull(); } - @Test - @Description("Ensures that target metadata deletion request to API on an entity that does not exist results in NOT_FOUND.") - void deleteMetadataThatDoesNotExistLeadsToNotFound() throws Exception { + /** + * Ensures that target metadata deletion request to API on an entity that does not exist results in NOT_FOUND. + */ + @Test void deleteMetadataThatDoesNotExistLeadsToNotFound() throws Exception { final String knownControllerId = "targetIdWithMetadata"; setupTargetWithMetadata(knownControllerId, KNOWN_KEY, KNOWN_VALUE); @@ -2071,9 +2139,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.getMetadata(knownControllerId).get(KNOWN_KEY)).isNotNull(); } - @Test - @Description("Ensures that a metadata entry selection through API reflects the repository content.") - void getMetadataKey() throws Exception { + /** + * Ensures that a metadata entry selection through API reflects the repository content. + */ + @Test void getMetadataKey() throws Exception { final String knownControllerId = "targetIdWithMetadata"; setupTargetWithMetadata(knownControllerId, KNOWN_KEY, KNOWN_VALUE); @@ -2085,9 +2154,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(JSON_PATH_VALUE, equalTo(KNOWN_VALUE))); } - @Test - @Description("Ensures that a metadata entry paged list selection through API reflectes the repository content.") - void getMetadata() throws Exception { + /** + * Ensures that a metadata entry paged list selection through API reflectes the repository content. + */ + @Test void getMetadata() throws Exception { final String knownControllerId = "targetIdWithMetadata"; final int totalMetadata = 10; @@ -2121,9 +2191,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[0].value", equalTo(knownValuePrefix + "0"))); } - @Test - @Description("A request for assigning multiple DS to a target results in a Bad Request when multiassignment in disabled.") - void multiAssignmentRequestNotAllowedIfDisabled() throws Exception { + /** + * A request for assigning multiple DS to a target results in a Bad Request when multiassignment in disabled. + */ + @Test void multiAssignmentRequestNotAllowedIfDisabled() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final List dsIds = testdataFactory.createDistributionSets(2).stream().map(DistributionSet::getId) .toList(); @@ -2137,9 +2208,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isBadRequest()); } - @Test - @Description("Passing an array in assignment request is allowed if multiassignment is disabled and array size in 1.") - void multiAssignmentRequestAllowedIfDisabledButHasSizeOne() throws Exception { + /** + * Passing an array in assignment request is allowed if multiassignment is disabled and array size in 1. + */ + @Test void multiAssignmentRequestAllowedIfDisabledButHasSizeOne() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -2150,9 +2222,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("Identical assignments in a single request are removed when multiassignment in disabled.") - void identicalAssignmentInRequestAreRemovedIfMultiassignmentsDisabled() throws Exception { + /** + * Identical assignments in a single request are removed when multiassignment in disabled. + */ + @Test void identicalAssignmentInRequestAreRemovedIfMultiassignmentsDisabled() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -2166,9 +2239,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("total", equalTo(1))); } - @Test - @Description("Assign multiple DSs to a target in one request with multiassignments enabled.") - void multiAssignment() throws Exception { + /** + * Assign multiple DSs to a target in one request with multiassignments enabled. + */ + @Test void multiAssignment() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final List dsIds = testdataFactory.createDistributionSets(2).stream().map(DistributionSet::getId) .toList(); @@ -2184,9 +2258,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("total", equalTo(2))); } - @Test - @Description("An assignment request containing a weight is only accepted when weight is valid and multi assignment is on.") - void weightValidation() throws Exception { + /** + * An assignment request containing a weight is only accepted when weight is valid and multi assignment is on. + */ + @Test void weightValidation() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); final int weight = 98; @@ -2210,9 +2285,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(actions.get(0).getWeight()).get().isEqualTo(weight); } - @Test - @Description("An assignment request containing a valid weight when multi assignment is off.") - void weightWithSingleAssignment() throws Exception { + /** + * An assignment request containing a valid weight when multi assignment is off. + */ + @Test void weightWithSingleAssignment() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -2224,9 +2300,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Test - @Description("An assignment request containing a valid weight when multi assignment is on.") - void weightWithMultiAssignment() throws Exception { + /** + * An assignment request containing a valid weight when multi assignment is on. + */ + @Test void weightWithMultiAssignment() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); final int weight = 98; @@ -2244,9 +2321,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(actions.get(0).getWeight()).get().isEqualTo(weight); } - @Test - @Description("Get weight of action") - void getActionWeight() throws Exception { + /** + * Get weight of action + */ + @Test void getActionWeight() throws Exception { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); final int customWeightHigh = 800; @@ -2265,9 +2343,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content.[2].weight", equalTo(1000))); } - @Test - @Description("An action provides information of the rollout it was created for (if any).") - void getActionWithRolloutInfo() throws Exception { + /** + * An action provides information of the rollout it was created for (if any). + */ + @Test void getActionWithRolloutInfo() throws Exception { // setup final int amountTargets = 10; @@ -2302,9 +2381,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { "$._links.rollout.href", containsString("/rest/v1/rollouts/" + rollout.getId().intValue()))); } - @Test - @Description("Ensures that a post request for creating targets with target type works.") - void createTargetsWithTargetType() throws Exception { + /** + * Ensures that a post request for creating targets with target type works. + */ + @Test void createTargetsWithTargetType() throws Exception { final TargetType type1 = testdataFactory.createTargetType("typeWithDs", Collections.singletonList(standardDsType)); final TargetType type2 = testdataFactory.createTargetType("typeWithOutDs", @@ -2371,9 +2451,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(target3.getTargetType()).extracting(TargetType::getName).isEqualTo("typeWithOutDs"); } - @Test - @Description("Ensures that a post request for creating target with target type works.") - void createTargetWithExistingTargetType() throws Exception { + /** + * Ensures that a post request for creating target with target type works. + */ + @Test void createTargetWithExistingTargetType() throws Exception { // create target type final List targetTypes = testdataFactory.createTargetTypes("targettype", 1); assertThat(targetTypes).hasSize(1); @@ -2394,9 +2475,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .isEqualTo(targetTypes.get(0).getId()); } - @Test - @Description("Ensures that a put request for updating targets with target type works.") - void updateTargetTypeInTarget() throws Exception { + /** + * Ensures that a put request for updating targets with target type works. + */ + @Test void updateTargetTypeInTarget() throws Exception { // create target type final List targetTypes = testdataFactory.createTargetTypes("targettype", 2); assertThat(targetTypes).hasSize(2); @@ -2417,9 +2499,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("targetType", equalTo(targetTypes.get(1).getId().intValue()))); } - @Test - @Description("Ensures that a post request for creating targets with unknown target type fails.") - void addingNonExistingTargetTypeInTargetShouldFail() throws Exception { + /** + * Ensures that a post request for creating targets with unknown target type fails. + */ + @Test void addingNonExistingTargetTypeInTargetShouldFail() throws Exception { final long unknownTargetTypeId = 999; final String errorMsg = String.format("TargetType with given identifier {%s} does not exist.", unknownTargetTypeId); @@ -2439,9 +2522,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("message", Matchers.containsString(errorMsg))); } - @Test - @Description("Ensures that a post request for assign target type to target works.") - void assignTargetTypeToTarget() throws Exception { + /** + * Ensures that a post request for assign target type to target works. + */ + @Test void assignTargetTypeToTarget() throws Exception { // create target type final TargetType targetType = testdataFactory.findOrCreateTargetType("targettype"); assertThat(targetType).isNotNull(); @@ -2461,9 +2545,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .isEqualTo(targetType.getId()); } - @Test - @Description("Ensures that a post request for assign a invalid target type to target fails.") - void assignInvalidTargetTypeToTargetFails() throws Exception { + /** + * Ensures that a post request for assign a invalid target type to target fails. + */ + @Test void assignInvalidTargetTypeToTargetFails() throws Exception { // Invalid target type ID final long invalidTargetTypeId = 999; @@ -2494,9 +2579,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(exceptionInfo.getMessage()).contains("targetTypeId"); } - @Test - @Description("Ensures that a delete request for unassign target type from target works.") - void unassignTargetTypeFromTarget() throws Exception { + /** + * Ensures that a delete request for unassign target type from target works. + */ + @Test void unassignTargetTypeFromTarget() throws Exception { // create target type final List targetTypes = testdataFactory.createTargetTypes("targettype", 1); assertThat(targetTypes).hasSize(1); @@ -2656,9 +2742,10 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("_links.autoConfirm").exists()); } - @Test - @Description("Verifies that the status code that was reported in the last action status update is correctly exposed via the action.") - void lastActionStatusCode() throws Exception { + /** + * Verifies that the status code that was reported in the last action status update is correctly exposed via the action. + */ + @Test void lastActionStatusCode() throws Exception { // prepare test final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -2825,7 +2912,6 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { return actions; } - @Step private void verifyAttributeUpdateCanBeRequested(final String knownTargetId) throws Exception { final String body = new JSONObject().put("requestAttributes", true).toString(); @@ -2837,7 +2923,6 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetManagement.isControllerAttributesRequested(knownTargetId)).isTrue(); } - @Step private void verifyRequestAttributesAttributeIsOptional(final String knownTargetId) throws Exception { final String body = new JSONObject().put("description", "verify attribute can be missing").toString(); @@ -2847,7 +2932,6 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isOk()); } - @Step private void verifyResettingRequestAttributesIsNotAllowed(final String knownTargetId) throws Exception { final String body = new JSONObject().put("requestAttributes", false).toString(); diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResourceTest.java index 20a292abb..b03096e4f 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResourceTest.java @@ -27,9 +27,6 @@ import java.util.List; import java.util.Map; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi; import org.eclipse.hawkbit.mgmt.rest.resource.util.ResourceUtility; @@ -53,17 +50,19 @@ import org.springframework.test.web.servlet.ResultActions; /** * Spring MVC Tests against the MgmtTargetTagResource. + *

+ * Feature: Component Tests - Management API
+ * Story: Target Tag Resource */ -@Feature("Component Tests - Management API") -@Story("Target Tag Resource") public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationTest { private static final String TARGETTAGS_ROOT = "http://localhost" + MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "/"; private static final Random RND = new Random(); - @Test - @Description("Verifies that a paged result list of target tags reflects the content on the repository side.") - @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that a paged result list of target tags reflects the content on the repository side. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) public void getTargetTags() throws Exception { final List tags = testdataFactory.createTargetTags(2, ""); final TargetTag assigned = tags.get(0); @@ -83,18 +82,20 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT } - @Test - @Description("Handles the GET request of retrieving all targets tags within SP based by parameter") - public void getTargetTagsWithParameters() throws Exception { + /** + * Handles the GET request of retrieving all targets tags within SP based by parameter + */ + @Test public void getTargetTagsWithParameters() throws Exception { testdataFactory.createTargetTags(2, ""); mvc.perform(get(MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING + "?limit=10&sort=name:ASC&offset=0&q=name==targetTag")) .andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()); } - @Test - @Description("Verifies that a page result when listing tags reflects on the content in the repository when filtered by 2 fields - one tag field and one target field") - public void getTargetTagsFilteredByColor() throws Exception { + /** + * Verifies that a page result when listing tags reflects on the content in the repository when filtered by 2 fields - one tag field and one target field + */ + @Test public void getTargetTagsFilteredByColor() throws Exception { final String controllerId1 = "controllerTestId1"; final String controllerId2 = "controllerTestId2"; testdataFactory.createTarget(controllerId1); @@ -122,9 +123,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); } - @Test - @Description("Verifies that a single result of a target tag reflects the content on the repository side.") - @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that a single result of a target tag reflects the content on the repository side. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) public void getTargetTag() throws Exception { final List tags = testdataFactory.createTargetTags(2, ""); final TargetTag assigned = tags.get(0); @@ -141,9 +143,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT } - @Test - @Description("Verifies that created target tags are stored in the repository as send to the API.") - @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) + /** + * Verifies that created target tags are stored in the repository as send to the API. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 2) }) public void createTargetTags() throws Exception { final Tag tagOne = entityFactory.tag().create().colour("testcol1").description("its a test1").name("thetest1") .build(); @@ -171,9 +174,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(applyTagMatcherOnArrayResult(createdTwo)); } - @Test - @Description("Verifies that an updated target tag is stored in the repository as send to the API.") - @ExpectEvents({ + /** + * Verifies that an updated target tag is stored in the repository as send to the API. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetTagUpdatedEvent.class, count = 1) }) public void updateTargetTag() throws Exception { @@ -200,9 +204,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(applyTagMatcherOnArrayResult(updated)); } - @Test - @Description("Verifies that the delete call is reflected by the repository.") - @ExpectEvents({ + /** + * Verifies that the delete call is reflected by the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetTagDeletedEvent.class, count = 1) }) public void deleteTargetTag() throws Exception { @@ -216,9 +221,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT assertThat(targetTagManagement.get(original.getId())).isNotPresent(); } - @Test - @Description("Ensures that assigned targets to tag in repository are listed with proper paging results.") - @ExpectEvents({ + /** + * Ensures that assigned targets to tag in repository are listed with proper paging results. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 5), @Expect(type = TargetUpdatedEvent.class, count = 5) }) @@ -236,9 +242,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(targetsAssigned))); } - @Test - @Description("Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit parameter.") - @ExpectEvents({ + /** + * Ensures that assigned DS to tag in repository are listed with proper paging results with paging limit parameter. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 5), @Expect(type = TargetUpdatedEvent.class, count = 5) }) @@ -258,9 +265,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } - @Test - @Description("Ensures that assigned targets to tag in repository are listed with proper paging results with paging limit and offset parameter.") - @ExpectEvents({ + /** + * Ensures that assigned targets to tag in repository are listed with proper paging results with paging limit and offset parameter. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 5), @Expect(type = TargetUpdatedEvent.class, count = 5) }) @@ -283,9 +291,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } - @Test - @Description("Verifies that tag assignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1) }) @@ -302,9 +311,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT assertThat(updated.stream().map(Target::getControllerId).toList()).containsOnly(assigned.getControllerId()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 2) }) @@ -325,9 +335,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .containsOnly(assigned0.getControllerId(), assigned1.getControllerId()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2) }) public void assignTargetsNotFound() throws Exception { @@ -364,9 +375,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT assertThat(targetManagement.findByTag(tag.getId(), PAGE).getContent()).isEmpty(); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 2) }) @@ -406,9 +418,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .isEqualTo(targets.stream().sorted().toList()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 2) }) @@ -439,9 +452,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .isEqualTo(targets.stream().sorted().toList()); } - @Test - @Description("Verifies that tag unassignments done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag unassignments done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 3) }) @@ -463,9 +477,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .containsOnly(assigned.getControllerId()); } - @Test - @Description("Verifies that tag unassignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag unassignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 3), @Expect(type = TargetUpdatedEvent.class, count = 5) }) @@ -489,9 +504,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .containsOnly(assigned.getControllerId()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 2) }) @@ -532,9 +548,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT .isEqualTo(targets.stream().sorted().toList()); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 4) }) @@ -575,9 +592,10 @@ public class MgmtTargetTagResourceTest extends AbstractManagementApiIntegrationT assertThat(targetManagement.findByTag(tag.getId(), PAGE).getContent()).isEmpty(); } - @Test - @Description("Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository.") - @ExpectEvents({ + /** + * Verifies that tag assignments (multi targets) done through tag API command are correctly stored in the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetUpdatedEvent.class, count = 4) }) diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTypeResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTypeResourceTest.java index f23bb6f51..edd67ed47 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTypeResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTypeResourceTest.java @@ -30,10 +30,6 @@ import java.util.Collections; import java.util.List; import com.jayway.jsonpath.JsonPath; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -53,9 +49,10 @@ import org.springframework.test.web.servlet.ResultActions; /** * Spring MVC Tests against the MgmtTargetTypeResource. + *

+ * Feature: Component Tests - Management API
+ * Story: Target Type Resource */ -@Feature("Component Tests - Management API") -@Story("Target Type Resource") class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { private static final String TARGETTYPES_ENDPOINT = MgmtRestConstants.TARGETTYPE_V1_REQUEST_MAPPING; @@ -68,18 +65,22 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { private static final String TEST_USER = "targetTypeTester"; private static final String SPACE_AND_DESCRIPTION = " description"; + /** + * GET targettypes returns Forbidden when permission is missing + */ @Test @WithUser(principal = "targetTypeTester", allSpPermissions = true, removeFromAllPermission = { SpPermission.READ_TARGET }) - @Description("GET targettypes returns Forbidden when permission is missing") void getTargetTypesWithoutPermission() throws Exception { mvc.perform(get(TARGETTYPES_ENDPOINT).accept(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isForbidden()); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{id} GET request. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{id} GET request.") void getTargetType() throws Exception { String typeName = "TestTypeGET"; TargetType testType = createTestTargetTypeInDB(typeName); @@ -104,9 +105,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { equalTo("http://localhost/rest/v1/targettypes/" + typeId + "/compatibledistributionsettypes"))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes GET requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes GET requests.") void getTargetTypes() throws Exception { String typeName = "TestTypeGET"; int count = 5; @@ -142,9 +145,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { } } + /** + * Checks the correct behaviour of /rest/v1/targettypes GET requests without prior created target types. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes GET requests without prior created target types.") void getDefaultTargetTypes() throws Exception { // 0 types overall (no default types are created) @@ -157,9 +162,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes GET requests with sorting by name. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes GET requests with sorting by name.") void getTargetTypesSortedByName() throws Exception { String typeNameA = "ATestTypeGETsorted"; String typeNameB = "BTestTypeGETsorted"; @@ -221,9 +228,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { } + /** + * Checks the correct behaviour of /rest/v1/targettypes GET requests with paging. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes GET requests with paging.") void getTargetTypesWithPagingLimitRequestParameter() throws Exception { final String typePrefix = "TestTypeGETPaging"; final int count = 10; @@ -239,9 +248,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limit))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes GET requests with paging and offset. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes GET requests with paging and offset.") void getTargetTypesWithPagingLimitAndOffsetRequestParameter() throws Exception { final int count = 10; final int offset = 2; @@ -259,9 +270,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID} PUT requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID} PUT requests.") void updateTargetType() throws Exception { String typeName = "TestTypePUT"; final TargetType testType = createTestTargetTypeInDB(typeName); @@ -279,9 +292,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andReturn(); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{id} GET requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{id} GET requests.") void getUpdatedTargetType() throws Exception { final String initialTypeName = "TestTypeGET"; TargetType testType = createTestTargetTypeInDB(initialTypeName); @@ -304,9 +319,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.key", equalTo(initialTypeName + " key"))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes POST requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes POST requests.") void createTargetTypes() throws Exception { String typeName = "TestTypePOST"; final List types = buildTestTargetTypesWithoutDsTypes(typeName, 5); @@ -314,9 +331,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { runPostTargetTypeAndVerify(types); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes POST requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes POST requests.") void addDistributionSetTypeToTargetType() throws Exception { String typeName = "TestTypeAddDs"; TargetType testType = createTestTargetTypeInDB(typeName); @@ -333,9 +352,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { assertThat(testType.getCompatibleDistributionSetTypes()).containsExactly(standardDsType); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes GET requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes GET requests.") void getDistributionSetsOfTargetType() throws Exception { String typeName = "TestTypeGetDs"; final TargetType testType = createTestTargetTypeInDB(typeName, Collections.singletonList(standardDsType)); @@ -351,9 +372,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { equalTo("http://localhost/rest/v1/distributionsettypes/" + standardDsType.getId()))); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes/{ID} GET requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes/{ID} GET requests.") void getDistributionSetOfTargetTypeReturnsNotAllowed() throws Exception { String typeName = "TestTypeAddDs"; final TargetType testType = createTestTargetTypeInDB(typeName); @@ -365,9 +388,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes/{ID} DELETE requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID}/compatibledistributionsettypes/{ID} DELETE requests.") void removeDsTypeFromTargetType() throws Exception { String typeName = "TestTypeRemoveDs"; TargetType testType = createTestTargetTypeInDB(typeName, Collections.singletonList(standardDsType)); @@ -383,9 +408,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { assertThat(testType.getCompatibleDistributionSetTypes()).isEmpty(); } + /** + * Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} DELETE requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/distributionsettypes/{ID} DELETE requests.") void deletingDsTypeRemovesAssignmentFromTargetType() throws Exception { TargetType testType = createTestTargetTypeInDB("TestTypeRemoveDs", Collections.singletonList(standardDsType)); assertThat(testType.getCompatibleDistributionSetTypes()).hasSize(1); @@ -402,9 +429,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { assertThat(distributionSetTypeManagement.findByKey(standardDsType.getKey())).isEmpty(); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID} DELETE requests - Deletion when not in use. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID} DELETE requests - Deletion when not in use.") void deleteTargetTypeUnused() throws Exception { String typeName = "TestTypeUnusedDelete"; final TargetType testType = createTestTargetTypeInDB(typeName); @@ -418,9 +447,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetTypeManagement.count()).isZero(); } + /** + * Checks the correct behaviour of /rest/v1/targettypes/{ID} DELETE requests - Deletion not possible when in use. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Checks the correct behaviour of /rest/v1/targettypes/{ID} DELETE requests - Deletion not possible when in use.") void deleteTargetTypeUsed() throws Exception { String typeName = "TestTypeUsedDelete"; final TargetType testType = createTestTargetTypeInDB(typeName); @@ -439,18 +470,22 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { assertThat(targetTypeManagement.count()).isEqualTo(1); } + /** + * Ensures that target type deletion request to API on an entity that does not exist results in NOT_FOUND. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Ensures that target type deletion request to API on an entity that does not exist results in NOT_FOUND.") void deleteTargetTypeThatDoesNotExistLeadsToNotFound() throws Exception { mvc.perform(delete(TARGETTYPE_SINGLE_ENDPOINT, 1234)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } + /** + * Tests the update of the deletion flag. It is verified that the target type can't be marked as deleted through update operation. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Tests the update of the deletion flag. It is verified that the target type can't be marked as deleted through update operation.") void updateTargetTypeDeletedFlag() throws Exception { String typeName = "TestTypePUT"; final TargetType testType = createTestTargetTypeInDB(typeName); @@ -465,9 +500,10 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.deleted", equalTo(false))); // don't delete with update } - @Test - @Description("Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.).") - void invalidRequestsOnTargetTypesResource() throws Exception { + /** + * Ensures that the server is behaving as expected on invalid requests (wrong media type, wrong ID etc.). + */ + @Test void invalidRequestsOnTargetTypesResource() throws Exception { String typeName = "TestTypeInvalidReq"; final TargetType testType = createTestTargetTypeInDB(typeName, Collections.singletonList(standardDsType)); @@ -565,9 +601,10 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(status().isMethodNotAllowed()); } - @Test - @Description("Search request of target types.") - void searchTargetTypeRsql() throws Exception { + /** + * Search request of target types. + */ + @Test void searchTargetTypeRsql() throws Exception { targetTypeManagement.create(entityFactory.targetType().create().name("TestName123")); targetTypeManagement.create(entityFactory.targetType().create().name("TestName1234")); @@ -582,9 +619,11 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("content[1].name", equalTo("TestName1234"))); } + /** + * Verifies quota enforcement for /rest/v1/targettypes/{ID}/compatibledistributionsettypes POST requests. + */ @Test @WithUser(principal = TEST_USER, allSpPermissions = true) - @Description("Verifies quota enforcement for /rest/v1/targettypes/{ID}/compatibledistributionsettypes POST requests.") void assignDistributionSetTypeToTargetTypeUntilQuotaExceeded() throws Exception { final TargetType testType = createTestTargetTypeInDB("TestTypeQuota"); @@ -613,7 +652,6 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { .andExpect(jsonPath("$.errorCode", equalTo(SpServerError.SP_QUOTA_EXCEEDED.getKey()))); } - @Step private TargetType buildTestTargetTypeBody(String name) { return prepareTestTargetType(name, null).build(); } @@ -627,24 +665,20 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { return create; } - @Step private List createTestTargetTypesInDB(String namePrefix, int count) { return testdataFactory.createTargetTypes(namePrefix, count); } - @Step private TargetType createTestTargetTypeInDB(String name) { return testdataFactory.findOrCreateTargetType(name); } - @Step private TargetType createTestTargetTypeInDB(String name, List dsTypes) { TargetType targetType = testdataFactory.createTargetType(name, dsTypes); assertThat(targetType.getOptLockRevision()).isEqualTo(1); return targetType; } - @Step private List buildTestTargetTypesWithoutDsTypes(String namePrefix, int count) { final List types = new ArrayList<>(); for (int index = 0; index < count; index++) { @@ -653,7 +687,6 @@ class MgmtTargetTypeResourceTest extends AbstractManagementApiIntegrationTest { return types; } - @Step private void runPostTargetTypeAndVerify(final List types) throws Exception { int size = types.size(); ResultActions resultActions = mvc diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResourceTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResourceTest.java index c373b62c4..8b3f81811 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResourceTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTenantManagementResourceTest.java @@ -18,9 +18,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import com.fasterxml.jackson.databind.ObjectMapper; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValueRequest; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -35,9 +32,10 @@ import org.springframework.test.web.servlet.ResultMatcher; /** * Spring MVC Tests against the MgmtTenantManagementResource. + *

+ * Feature: Component Tests - Management API
+ * Story: Tenant Management Resource */ -@Feature("Component Tests - Management API") -@Story("Tenant Management Resource") public class MgmtTenantManagementResourceTest extends AbstractManagementApiIntegrationTest { private static final String KEY_MULTI_ASSIGNMENTS = "multi.assignments.enabled"; @@ -50,9 +48,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg private static final String AUTHENTICATION_GATEWAYTOKEN_KEY = "authentication.gatewaytoken.key"; private static final String DEFAULT_DISTRIBUTION_SET_TYPE_KEY = "default.ds.type"; - @Test - @Description("Handles GET request for receiving all tenant specific configurations.") - public void getTenantConfigurations() throws Exception { + /** + * Handles GET request for receiving all tenant specific configurations. + */ + @Test public void getTenantConfigurations() throws Exception { mvc.perform(get(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs")) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) @@ -62,9 +61,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg } - @Test - @Description("Handles GET request for receiving a tenant specific configuration.") - public void getTenantConfiguration() throws Exception { + /** + * Handles GET request for receiving a tenant specific configuration. + */ + @Test public void getTenantConfiguration() throws Exception { //Test TenantConfiguration property mvc.perform(get(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", TenantConfigurationProperties.TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY)) @@ -72,9 +72,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg .andExpect(status().isOk()); } - @Test - @Description("Handles GET request for receiving (TenantMetadata - DefaultDsType) a tenant specific configuration.") - public void getTenantMetadata() throws Exception { + /** + * Handles GET request for receiving (TenantMetadata - DefaultDsType) a tenant specific configuration. + */ + @Test public void getTenantMetadata() throws Exception { //Test TenantMetadata property mvc.perform(get(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", DEFAULT_DISTRIBUTION_SET_TYPE_KEY)) @@ -83,9 +84,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg .andExpect(jsonPath("$.value", equalTo(getActualDefaultDsType().intValue()))); } - @Test - @Description("Handles PUT request for settings values in tenant specific configuration.") - public void putTenantConfiguration() throws Exception { + /** + * Handles PUT request for settings values in tenant specific configuration. + */ + @Test public void putTenantConfiguration() throws Exception { final MgmtSystemTenantConfigurationValueRequest bodyPut = new MgmtSystemTenantConfigurationValueRequest(); bodyPut.setValue("exampleToken"); final ObjectMapper mapper = new ObjectMapper(); @@ -98,9 +100,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg .andExpect(status().isOk()); } - @Test - @Description("Handles PUT request for settings values (TenantMetadata - DefaultDsType) in tenant specific configuration, which is TenantMetadata") - public void putTenantMetadata() throws Exception { + /** + * Handles PUT request for settings values (TenantMetadata - DefaultDsType) in tenant specific configuration, which is TenantMetadata + */ + @Test public void putTenantMetadata() throws Exception { final MgmtSystemTenantConfigurationValueRequest bodyPut = new MgmtSystemTenantConfigurationValueRequest(); long updatedTestDefaultDsType = createTestDistributionSetType(); @@ -120,9 +123,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg "Rest endpoint for updating the Default DistributionSetType completed successfully, but the actual value was not changed."); } - @Test - @Description("Update DefaultDistributionSetType Fails if given DistributionSetType ID does not exist.") - public void putTenantMetadataFails() throws Exception { + /** + * Update DefaultDistributionSetType Fails if given DistributionSetType ID does not exist. + */ + @Test public void putTenantMetadataFails() throws Exception { long oldDefaultDsType = getActualDefaultDsType(); //try an invalid input String newDefaultDsType = new JSONObject().put("value", true).toString(); @@ -135,9 +139,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg assertDefaultDsTypeUpdateBadRequestFails(newDefaultDsType, oldDefaultDsType, status().isNotFound()); } - @Test - @Description("The 'multi.assignments.enabled' property must not be changed to false.") - public void deactivateMultiAssignment() throws Exception { + /** + * The 'multi.assignments.enabled' property must not be changed to false. + */ + @Test public void deactivateMultiAssignment() throws Exception { final String bodyActivate = new JSONObject().put("value", true).toString(); final String bodyDeactivate = new JSONObject().put("value", false).toString(); @@ -152,9 +157,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg .andExpect(status().isForbidden()); } - @Test - @Description("The Batch configuration should not be applied, because of invalid TenantConfiguration props") - public void changeBatchConfigurationShouldFailOnInvalidTenantConfiguration() throws Exception { + /** + * The Batch configuration should not be applied, because of invalid TenantConfiguration props + */ + @Test public void changeBatchConfigurationShouldFailOnInvalidTenantConfiguration() throws Exception { //in this scenario // some TenantConfiguration are not valid, // TenantMetadata - DefaultDSType ID is valid, @@ -167,9 +173,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg testValidDistributionSetType, status().isBadRequest()); } - @Test - @Description("The Batch configuration should not be applied, because of invalid TenantMetadata (DefaultDistributionSetType)") - public void changeBatchConfigurationShouldOnInvalidTenantMetadata() throws Exception { + /** + * The Batch configuration should not be applied, because of invalid TenantMetadata (DefaultDistributionSetType) + */ + @Test public void changeBatchConfigurationShouldOnInvalidTenantMetadata() throws Exception { //in this scenario // all TenantConfiguration have valid and new values - using old values, inverted // TenantMetadata - DefaultDSType ID is invalid @@ -198,9 +205,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg testInvalidDistributionSetType, status().isNotFound()); } - @Test - @Description("The Batch configuration should be applied") - public void changeBatchConfiguration() throws Exception { + /** + * The Batch configuration should be applied + */ + @Test public void changeBatchConfiguration() throws Exception { long updatedDistributionSetType = createTestDistributionSetType(); boolean updatedRolloutApprovalEnabled = true; boolean updatedAuthGatewayTokenEnabled = true; @@ -231,9 +239,10 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg "Change BatchConfiguration was successful but TenantConfiguration property was not actually changed."); } - @Test - @Description("The 'repository.actions.autoclose.enabled' property must not be modified if Multi-Assignments is enabled.") - public void autoCloseCannotBeModifiedIfMultiAssignmentIsEnabled() throws Exception { + /** + * The 'repository.actions.autoclose.enabled' property must not be modified if Multi-Assignments is enabled. + */ + @Test public void autoCloseCannotBeModifiedIfMultiAssignmentIsEnabled() throws Exception { final String bodyActivate = new JSONObject().put("value", true).toString(); final String bodyDeactivate = new JSONObject().put("value", false).toString(); @@ -256,27 +265,30 @@ public class MgmtTenantManagementResourceTest extends AbstractManagementApiInteg .andExpect(status().isForbidden()); } - @Test - @Description("Handles DELETE request deleting a tenant specific configuration.") - public void deleteTenantConfiguration() throws Exception { + /** + * Handles DELETE request deleting a tenant specific configuration. + */ + @Test public void deleteTenantConfiguration() throws Exception { mvc.perform(delete(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", TenantConfigurationProperties.TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); } - @Test - @Description("Tests DELETE request must Fail for TenantMetadata properties.") - public void deleteTenantMetadataFail() throws Exception { + /** + * Tests DELETE request must Fail for TenantMetadata properties. + */ + @Test public void deleteTenantMetadataFail() throws Exception { mvc.perform(delete(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", DEFAULT_DISTRIBUTION_SET_TYPE_KEY)) .andDo(MockMvcResultPrinter.print()) .andExpect(status().isBadRequest()); } - @Test - @Description("Handles GET request for receiving all tenant specific configurations depending on read gateway token permissions.") - void getTenantConfigurationReadGWToken() throws Exception { + /** + * Handles GET request for receiving all tenant specific configurations depending on read gateway token permissions. + */ + @Test void getTenantConfigurationReadGWToken() throws Exception { SecurityContextSwitch.runAs(SecurityContextSwitch.withUser("tenant_admin", SpPermission.TENANT_CONFIGURATION), () -> { tenantConfigurationManagement.addOrUpdateConfiguration( TenantConfigurationProperties.TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java index 46b5ce953..17b062760 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/util/SortUtilityTest.java @@ -14,9 +14,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterSyntaxErrorException; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedDirectionException; import org.eclipse.hawkbit.mgmt.rest.resource.exception.SortParameterUnsupportedFieldException; @@ -24,8 +21,10 @@ import org.eclipse.hawkbit.repository.TargetFields; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Sort.Order; -@Feature("Component Tests - Management API") -@Story("Sorting parameter") +/** + * Feature: Component Tests - Management API
+ * Story: Sorting parameter + */ class SortUtilityTest { private static final String SORT_PARAM_1 = "NAME:ASC"; @@ -36,45 +35,51 @@ class SortUtilityTest { private static final String CASE_INSENSITIVE_DIRECTION_PARAM_1 = "name:ASC"; private static final String WRONG_FIELD_PARAM = "ASDF:ASC"; - @Test - @Description("Ascending sorting based on name.") - void parseSortParam1() { + /** + * Ascending sorting based on name. + */ + @Test void parseSortParam1() { final List parse = SortUtility.parse(TargetFields.class, SORT_PARAM_1); assertThat(parse).as("Count of parsing parameter").hasSize(1); } - @Test - @Description("Ascending sorting based on name and descending sorting based on description.") - void parseSortParam2() { + /** + * Ascending sorting based on name and descending sorting based on description. + */ + @Test void parseSortParam2() { final List parse = SortUtility.parse(TargetFields.class, SORT_PARAM_2); assertThat(parse).as("Count of parsing parameter").hasSize(2); } - @Test - @Description("Sorting with wrong syntax leads to SortParameterSyntaxErrorException.") - void parseWrongSyntaxParam() { + /** + * Sorting with wrong syntax leads to SortParameterSyntaxErrorException. + */ + @Test void parseWrongSyntaxParam() { assertThrows(SortParameterSyntaxErrorException.class, () -> SortUtility.parse(TargetFields.class, SYNTAX_FAILURE_SORT_PARAM)); } - @Test - @Description("Sorting based on name with case sensitive is possible.") - @SuppressWarnings("squid:S2699") // assert no error + /** + * Sorting based on name with case sensitive is possible. + */ + @Test @SuppressWarnings("squid:S2699") // assert no error void parsingIsNotCaseSensitive() { SortUtility.parse(TargetFields.class, CASE_INSENSITIVE_DIRECTION_PARAM); SortUtility.parse(TargetFields.class, CASE_INSENSITIVE_DIRECTION_PARAM_1); } - @Test - @Description("Sorting with unknown direction order leads to SortParameterUnsupportedDirectionException.") - void parseWrongDirectionParam() { + /** + * Sorting with unknown direction order leads to SortParameterUnsupportedDirectionException. + */ + @Test void parseWrongDirectionParam() { assertThrows(SortParameterUnsupportedDirectionException.class, () -> SortUtility.parse(TargetFields.class, WRONG_DIRECTION_PARAM)); } - @Test - @Description("Sorting with unknown field leads to SortParameterUnsupportedFieldException.") - void parseWrongFieldParam() { + /** + * Sorting with unknown field leads to SortParameterUnsupportedFieldException. + */ + @Test void parseWrongFieldParam() { assertThrows(SortParameterUnsupportedFieldException.class, () -> SortUtility.parse(TargetFields.class, WRONG_FIELD_PARAM)); } diff --git a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/AllowedHostNamesTest.java b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/AllowedHostNamesTest.java index bc341d353..f3b8d3866 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/AllowedHostNamesTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/AllowedHostNamesTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.app.mgmt; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; import org.springframework.test.context.TestPropertySource; @@ -22,25 +19,30 @@ import org.springframework.test.context.TestPropertySource; @TestPropertySource(properties = { "hawkbit.server.security.allowedHostNames=localhost", "hawkbit.server.security.httpFirewallIgnoredPaths=/index.html" }) -@Feature("Integration Test - Security") -@Story("Allowed Host Names") +/** + * Feature: Integration Test - Security
+ * Story: Allowed Host Names + */ class AllowedHostNamesTest extends AbstractSecurityTest { - @Test - @Description("Tests whether a RequestRejectedException is thrown when not allowed host is used") - void allowedHostNameWithNotAllowedHost() throws Exception { + /** + * Tests whether a RequestRejectedException is thrown when not allowed host is used + */ + @Test void allowedHostNameWithNotAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "www.google.com")).andExpect(status().isBadRequest()); } - @Test - @Description("Tests whether request is redirected when allowed host is used") - void allowedHostNameWithAllowedHost() throws Exception { + /** + * Tests whether request is redirected when allowed host is used + */ + @Test void allowedHostNameWithAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "localhost")).andExpect(status().is3xxRedirection()); } - @Test - @Description("Tests whether request without allowed host name and with ignored path end up with a client error") - void notAllowedHostnameWithIgnoredPath() throws Exception { + /** + * Tests whether request without allowed host name and with ignored path end up with a client error + */ + @Test void notAllowedHostnameWithIgnoredPath() throws Exception { mvc.perform(get("/index.html").header(HttpHeaders.HOST, "www.google.com")) .andExpect(status().is4xxClientError()); } diff --git a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/CorsTest.java b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/CorsTest.java index b7ae524e4..9b16db97f 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/CorsTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/CorsTest.java @@ -14,9 +14,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpRole; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.test.util.WithUser; @@ -34,8 +31,10 @@ import org.springframework.test.web.servlet.ResultActions; CorsTest.ALLOWED_ORIGIN_SECOND, "hawkbit.server.security.cors.exposedHeaders=" + HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN }) -@Feature("Integration Test - Security") -@Story("CORS") +/** + * Feature: Integration Test - Security
+ * Story: CORS + */ class CorsTest extends AbstractSecurityTest { static final String ALLOWED_ORIGIN_FIRST = "http://test.first.origin"; @@ -44,9 +43,10 @@ class CorsTest extends AbstractSecurityTest { private static final String INVALID_ORIGIN = "http://test.invalid.origin"; private static final String INVALID_CORS_REQUEST = "Invalid CORS request"; - @Test - @Description("Ensures that Cors is working.") - @WithUser(authorities = SpRole.TENANT_ADMIN, autoCreateTenant = false) + /** + * Ensures that Cors is working. + */ + @Test @WithUser(authorities = SpRole.TENANT_ADMIN, autoCreateTenant = false) void validateCorsRequest() throws Exception { performOptionsRequestToRestWithOrigin(ALLOWED_ORIGIN_FIRST).andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, ALLOWED_ORIGIN_FIRST)); diff --git a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/PreAuthorizeEnabledTest.java b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/PreAuthorizeEnabledTest.java index e63677fcc..76e17a98d 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/PreAuthorizeEnabledTest.java +++ b/hawkbit-mgmt/hawkbit-mgmt-server/src/test/java/org/eclipse/hawkbit/app/mgmt/PreAuthorizeEnabledTest.java @@ -15,46 +15,49 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import java.util.HashMap; import com.fasterxml.jackson.databind.ObjectMapper; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.im.authentication.SpRole; import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -@Feature("Integration Test - Security") -@Story("PreAuthorized enabled") +/** + * Feature: Integration Test - Security
+ * Story: PreAuthorized enabled + */ class PreAuthorizeEnabledTest extends AbstractSecurityTest { - @Test - @Description("Tests whether request fail if a role is forbidden for the user") - @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) + /** + * Tests whether request fail if a role is forbidden for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) void failIfNoRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")).andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.FORBIDDEN.value())); } - @Test - @Description("Tests whether request succeed if a role is granted for the user") - @WithUser(authorities = { SpPermission.READ_REPOSITORY }, autoCreateTenant = false) + /** + * Tests whether request succeed if a role is granted for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_REPOSITORY }, autoCreateTenant = false) void successIfHasRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")).andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); } - @Test - @Description("Tests whether request succeed if a role is granted for the user") - @WithUser(authorities = { SpRole.TENANT_ADMIN }, autoCreateTenant = false) + /** + * Tests whether request succeed if a role is granted for the user + */ + @Test @WithUser(authorities = { SpRole.TENANT_ADMIN }, autoCreateTenant = false) void successIfHasTenantAdminRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")).andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); } - @Test - @Description("Tests whether read tenant config request fail if a tenant config (or read read) is not granted for the user") - @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) + /** + * Tests whether read tenant config request fail if a tenant config (or read read) is not granted for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) void onlyDSIfNoTenantConfig() throws Exception { mvc.perform(get("/rest/v1/system/configs")).andExpect(result -> { // returns default DS type because of READ_TARGET @@ -64,9 +67,10 @@ class PreAuthorizeEnabledTest extends AbstractSecurityTest { }); } - @Test - @Description("Tests whether read tenant config request succeed if a tenant config (not read explicitly) is granted for the user") - @WithUser(authorities = { SpPermission.TENANT_CONFIGURATION }, autoCreateTenant = false) + /** + * Tests whether read tenant config request succeed if a tenant config (not read explicitly) is granted for the user + */ + @Test @WithUser(authorities = { SpPermission.TENANT_CONFIGURATION }, autoCreateTenant = false) void successIfHasTenantConfig() throws Exception { mvc.perform(get("/rest/v1/system/configs")).andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); diff --git a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/AllowedHostNamesTest.java b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/AllowedHostNamesTest.java index e136309bd..cdaa4d877 100644 --- a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/AllowedHostNamesTest.java +++ b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/AllowedHostNamesTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.app; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; import org.springframework.test.context.TestPropertySource; @@ -23,25 +20,30 @@ import org.springframework.test.context.TestPropertySource; "hawkbit.server.security.allowedHostNames=localhost", "hawkbit.server.security.httpFirewallIgnoredPaths=/index.html" }) -@Feature("Integration Test - Security") -@Story("Allowed Host Names") +/** + * Feature: Integration Test - Security
+ * Story: Allowed Host Names + */ class AllowedHostNamesTest extends AbstractSecurityTest { - @Test - @Description("Tests whether a RequestRejectedException is thrown when not allowed host is used") - void allowedHostNameWithNotAllowedHost() throws Exception { + /** + * Tests whether a RequestRejectedException is thrown when not allowed host is used + */ + @Test void allowedHostNameWithNotAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "www.google.com")).andExpect(status().isBadRequest()); } - @Test - @Description("Tests whether request is redirected when allowed host is used") - void allowedHostNameWithAllowedHost() throws Exception { + /** + * Tests whether request is redirected when allowed host is used + */ + @Test void allowedHostNameWithAllowedHost() throws Exception { mvc.perform(get("/").header(HttpHeaders.HOST, "localhost")).andExpect(status().is3xxRedirection()); } - @Test - @Description("Tests whether request without allowed host name and with ignored path end up with a client error") - void notAllowedHostnameWithIgnoredPath() throws Exception { + /** + * Tests whether request without allowed host name and with ignored path end up with a client error + */ + @Test void notAllowedHostnameWithIgnoredPath() throws Exception { mvc.perform(get("/index.html").header(HttpHeaders.HOST, "www.google.com")) .andExpect(status().is4xxClientError()); } diff --git a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java index 0212775bb..750b401f3 100644 --- a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java +++ b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/CorsTest.java @@ -14,9 +14,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpRole; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.test.util.WithUser; @@ -34,8 +31,10 @@ import org.springframework.test.web.servlet.ResultActions; CorsTest.ALLOWED_ORIGIN_SECOND, "hawkbit.server.security.cors.exposedHeaders=" + HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN }) -@Feature("Integration Test - Security") -@Story("CORS") +/** + * Feature: Integration Test - Security
+ * Story: CORS + */ class CorsTest extends AbstractSecurityTest { static final String ALLOWED_ORIGIN_FIRST = "http://test.first.origin"; @@ -44,9 +43,10 @@ class CorsTest extends AbstractSecurityTest { private static final String INVALID_ORIGIN = "http://test.invalid.origin"; private static final String INVALID_CORS_REQUEST = "Invalid CORS request"; - @Test - @Description("Ensures that Cors is working.") - @WithUser(authorities = SpRole.TENANT_ADMIN, autoCreateTenant = false) + /** + * Ensures that Cors is working. + */ + @Test @WithUser(authorities = SpRole.TENANT_ADMIN, autoCreateTenant = false) void validateCorsRequest() throws Exception { performOptionsRequestToRestWithOrigin(ALLOWED_ORIGIN_FIRST).andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, ALLOWED_ORIGIN_FIRST)); diff --git a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/PreAuthorizeEnabledTest.java b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/PreAuthorizeEnabledTest.java index 6228635e1..d4c333ba7 100644 --- a/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/PreAuthorizeEnabledTest.java +++ b/hawkbit-monolith/hawkbit-update-server/src/test/java/org/eclipse/hawkbit/app/PreAuthorizeEnabledTest.java @@ -15,46 +15,49 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import java.util.HashMap; import com.fasterxml.jackson.databind.ObjectMapper; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.im.authentication.SpRole; import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -@Feature("Integration Test - Security") -@Story("PreAuthorized enabled") +/** + * Feature: Integration Test - Security
+ * Story: PreAuthorized enabled + */ class PreAuthorizeEnabledTest extends AbstractSecurityTest { - @Test - @Description("Tests whether request fail if a role is forbidden for the user") - @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) + /** + * Tests whether request fail if a role is forbidden for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) void failIfNoRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.FORBIDDEN.value())); } - @Test - @Description("Tests whether request succeed if a role is granted for the user") - @WithUser(authorities = { SpPermission.READ_REPOSITORY }, autoCreateTenant = false) + /** + * Tests whether request succeed if a role is granted for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_REPOSITORY }, autoCreateTenant = false) void successIfHasRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); } - @Test - @Description("Tests whether request succeed if a role is granted for the user") - @WithUser(authorities = { SpRole.TENANT_ADMIN }, autoCreateTenant = false) + /** + * Tests whether request succeed if a role is granted for the user + */ + @Test @WithUser(authorities = { SpRole.TENANT_ADMIN }, autoCreateTenant = false) void successIfHasTenantAdminRole() throws Exception { mvc.perform(get("/rest/v1/distributionsets")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); } - @Test - @Description("Tests whether read tenant config request fail if a tenant config (or read read) is not granted for the user") - @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) + /** + * Tests whether read tenant config request fail if a tenant config (or read read) is not granted for the user + */ + @Test @WithUser(authorities = { SpPermission.READ_TARGET }, autoCreateTenant = false) void onlyDSIfNoTenantConfig() throws Exception { mvc.perform(get("/rest/v1/system/configs")) .andExpect(result -> { @@ -65,9 +68,10 @@ class PreAuthorizeEnabledTest extends AbstractSecurityTest { }); } - @Test - @Description("Tests whether read tenant config request succeed if a tenant config (not read explicitly) is granted for the user") - @WithUser(authorities = { SpPermission.TENANT_CONFIGURATION }, autoCreateTenant = false) + /** + * Tests whether read tenant config request succeed if a tenant config (not read explicitly) is granted for the user + */ + @Test @WithUser(authorities = { SpPermission.TENANT_CONFIGURATION }, autoCreateTenant = false) void successIfHasTenantConfig() throws Exception { mvc.perform(get("/rest/v1/system/configs")) .andExpect(result -> assertThat(result.getResponse().getStatus()).isEqualTo(HttpStatus.OK.value())); diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java index a95884cdd..67f578650 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java +++ b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java @@ -12,23 +12,22 @@ package org.eclipse.hawkbit.repository; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.ArtifactEncryptionUnsupportedException; import org.junit.jupiter.api.Test; /** * Test class to verify that no {@link ArtifactEncryptionService} required beans * are loaded and therefore the encryption support is not given. + *

+ * Feature: Unit Tests - Repository
+ * Story: Artifact Encryption Service */ -@Feature("Unit Tests - Repository") -@Story("Artifact Encryption Service") class ArtifactEncryptionServiceTest { - @Test - @Description("Verify that no artifact encryption support is given") - void verifyNoArtifactEncryptionSupport() { + /** + * Verify that no artifact encryption support is given + */ + @Test void verifyNoArtifactEncryptionSupport() { final ArtifactEncryptionService artifactEncryptionService = ArtifactEncryptionService.getInstance(); assertThat(artifactEncryptionService.isEncryptionSupported()).isFalse(); diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelperTest.java b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelperTest.java index 40b182529..b68ab374e 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelperTest.java +++ b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/MaintenanceScheduleHelperTest.java @@ -16,51 +16,55 @@ import java.time.Duration; import java.time.ZonedDateTime; import com.cronutils.model.Cron; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.InvalidMaintenanceScheduleException; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Repository") -@Story("Maintenance Schedule Utility") +/** + * Feature: Unit Tests - Repository
+ * Story: Maintenance Schedule Utility + */ class MaintenanceScheduleHelperTest { - @Test - @Description("Verifies that the Cron object is returned for valid cron expression") - void getCronFromExpressionValid() { + /** + * Verifies that the Cron object is returned for valid cron expression + */ + @Test void getCronFromExpressionValid() { final String validCron = "0 0 0 ? * 6"; // at 00:00 every Saturday assertThat(MaintenanceScheduleHelper.getCronFromExpression(validCron)).isNotNull().isInstanceOf(Cron.class); } - @Test - @Description("Verifies that the Duration object is returned for valid duration format (hh:mm or hh:mm:ss)") - void convertToISODurationValid() { + /** + * Verifies that the Duration object is returned for valid duration format (hh:mm or hh:mm:ss) + */ + @Test void convertToISODurationValid() { final String duration = "00:10"; assertThat(MaintenanceScheduleHelper.convertToISODuration(duration)).isNotNull().isInstanceOf(Duration.class); } - @Test - @Description("Verifies that the InvalidMaintenanceScheduleException is thrown for invalid duration format") - void validateDurationInvalid() { + /** + * Verifies that the InvalidMaintenanceScheduleException is thrown for invalid duration format + */ + @Test void validateDurationInvalid() { final String duration = "10"; assertThatThrownBy(() -> MaintenanceScheduleHelper.validateDuration(duration)) .isInstanceOf(InvalidMaintenanceScheduleException.class).hasMessage("Provided duration is not valid") .extracting("durationErrorIndex").isEqualTo(2); } - @Test - @Description("Verifies that the InvalidMaintenanceScheduleException is thrown for invalid cron expression") - void validateCronScheduleInvalid() { + /** + * Verifies that the InvalidMaintenanceScheduleException is thrown for invalid cron expression + */ + @Test void validateCronScheduleInvalid() { final String invalidCron = "0 0 0 * * 6"; assertThatThrownBy(() -> MaintenanceScheduleHelper.validateCronSchedule(invalidCron)) .isInstanceOf(InvalidMaintenanceScheduleException.class) .hasMessageContaining("Both, a day-of-week AND a day-of-month parameter, are not supported"); } - @Test - @Description("Verifies that there is a maintenance window available for correct schedule, duration and timezone") - void getNextMaintenanceWindowValid() { + /** + * Verifies that there is a maintenance window available for correct schedule, duration and timezone + */ + @Test void getNextMaintenanceWindowValid() { final ZonedDateTime currentTime = ZonedDateTime.now(); final String cronSchedule = String.format("0 %d %d %d %d ? %d", currentTime.getMinute(), currentTime.getHour(), currentTime.getDayOfMonth(), currentTime.getMonthValue(), currentTime.getYear()); @@ -69,18 +73,20 @@ class MaintenanceScheduleHelperTest { assertThat(MaintenanceScheduleHelper.getNextMaintenanceWindow(cronSchedule, duration, timezone)).isPresent(); } - @Test - @Description("Verifies the maintenance schedule when only one required field is present") - void validateMaintenanceScheduleAtLeastOneNotEmpty() { + /** + * Verifies the maintenance schedule when only one required field is present + */ + @Test void validateMaintenanceScheduleAtLeastOneNotEmpty() { final String duration = "00:10"; assertThatThrownBy(() -> MaintenanceScheduleHelper.validateMaintenanceSchedule(null, duration, null)) .isInstanceOf(InvalidMaintenanceScheduleException.class) .hasMessage("All of schedule, duration and timezone should either be null or non empty."); } - @Test - @Description("Verifies that there is no valid maintenance window available, scheduled before current time") - void validateMaintenanceScheduleBeforeCurrentTime() { + /** + * Verifies that there is no valid maintenance window available, scheduled before current time + */ + @Test void validateMaintenanceScheduleBeforeCurrentTime() { ZonedDateTime currentTime = ZonedDateTime.now(); currentTime = currentTime.plusMinutes(-30); final String cronSchedule = String.format("0 %d %d %d %d ? %d", currentTime.getMinute(), currentTime.getHour(), diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RegexCharTest.java b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RegexCharTest.java index f7f199cb3..1ab2986e5 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RegexCharTest.java +++ b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RegexCharTest.java @@ -11,23 +11,23 @@ package org.eclipse.hawkbit.repository; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.RegexCharacterCollection.RegexChar; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Repository") -@Story("Regular expression helper") +/** + * Feature: Unit Tests - Repository
+ * Story: Regular expression helper + */ class RegexCharTest { private static final int INDEX_FIRST_PRINTABLE_ASCII_CHAR = 32; private static final int INDEX_LAST_PRINTABLE_ASCII_CHAR = 127; private static final String TEST_STRING = getPrintableAsciiCharacters(); - @Test - @Description("Verifies every RegexChar can be used to exclusively find the desired characters in a String.") - void allRegexCharsOnlyFindExpectedChars() { + /** + * Verifies every RegexChar can be used to exclusively find the desired characters in a String. + */ + @Test void allRegexCharsOnlyFindExpectedChars() { for (final RegexChar character : RegexChar.values()) { switch (character) { case DIGITS: @@ -49,9 +49,10 @@ class RegexCharTest { } } - @Test - @Description("Verifies that combinations of RegexChars can be used to find the desired characters in a String.") - void combinedRegexCharsFindExpectedChars() { + /** + * Verifies that combinations of RegexChars can be used to find the desired characters in a String. + */ + @Test void combinedRegexCharsFindExpectedChars() { final RegexCharacterCollection greaterAndLessThan = new RegexCharacterCollection(RegexChar.GREATER_THAN, RegexChar.LESS_THAN); final RegexCharacterCollection equalsAndQuestionMark = new RegexCharacterCollection(RegexChar.EQUALS_SYMBOL, diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RepositoryManagementMethodPreAuthorizeAnnotatedTest.java b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RepositoryManagementMethodPreAuthorizeAnnotatedTest.java index 3edbf0277..fcd89f329 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RepositoryManagementMethodPreAuthorizeAnnotatedTest.java +++ b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/RepositoryManagementMethodPreAuthorizeAnnotatedTest.java @@ -20,22 +20,22 @@ import java.util.Set; import io.github.classgraph.ClassGraph; import io.github.classgraph.ClassInfo; import io.github.classgraph.ScanResult; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.security.access.prepost.PreAuthorize; -@Feature("Unit Tests - Repository") -@Story("Security Test") +/** + * Feature: Unit Tests - Repository
+ * Story: Security Test + */ class RepositoryManagementMethodPreAuthorizeAnnotatedTest { // if some methods are to be excluded private static final Set METHOD_SECURITY_EXCLUSION = new HashSet<>(); - @Test - @Description("Verifies that repository methods are @PreAuthorize annotated") - void repositoryManagementMethodsArePreAuthorizedAnnotated() { + /** + * Verifies that repository methods are @PreAuthorize annotated + */ + @Test void repositoryManagementMethodsArePreAuthorizedAnnotated() { final String packageName = getClass().getPackage().getName(); try (final ScanResult scanResult = new ClassGraph().acceptPackages(packageName).scan()) { final List> matchingClasses = scanResult.getAllClasses() diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/model/TotalTargetCountStatusTest.java b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/model/TotalTargetCountStatusTest.java index 8d203fd22..46a740c08 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/model/TotalTargetCountStatusTest.java +++ b/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/model/TotalTargetCountStatusTest.java @@ -15,13 +15,12 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; -@Feature("Component Tests - TotalTargetCountStatus") -@Story("TotalTargetCountStatus should correctly present finished DOWNLOAD_ONLY actions") +/** + * Feature: Component Tests - TotalTargetCountStatus
+ * Story: TotalTargetCountStatus should correctly present finished DOWNLOAD_ONLY actions + */ class TotalTargetCountStatusTest { private final List targetCountActionStatuses = Arrays.asList( @@ -36,9 +35,10 @@ class TotalTargetCountStatusTest { new TotalTargetCountActionStatus(Action.Status.CANCELING, 9L), new TotalTargetCountActionStatus(Action.Status.DOWNLOADED, 10L)); + /** + * Different Action Statuses should be correctly mapped to the corresponding TotalTargetCountStatus.Status + */ @Test - @Description("Different Action Statuses should be correctly mapped to the corresponding " + - "TotalTargetCountStatus.Status") void shouldCorrectlyMapActionStatuses() { TotalTargetCountStatus status = new TotalTargetCountStatus(targetCountActionStatuses, 55L, Action.ActionType.FORCED); @@ -51,9 +51,11 @@ class TotalTargetCountStatusTest { assertThat(status.getFinishedPercent()).isEqualTo((float) 100 * 3 / 55); } + /** + * When an empty list is passed to the TotalTargetCountStatus, all actions should be displayed as + * NOTSTARTED + */ @Test - @Description("When an empty list is passed to the TotalTargetCountStatus, all actions should be displayed as " + - "NOTSTARTED") void shouldCorrectlyMapActionStatusesToNotStarted() { TotalTargetCountStatus status = new TotalTargetCountStatus(Collections.emptyList(), 55L, Action.ActionType.FORCED); @@ -66,9 +68,10 @@ class TotalTargetCountStatusTest { assertThat(status.getFinishedPercent()).isZero(); } - @Test - @Description("DownloadOnly actions should be displayed as FINISHED when they have ActionStatus.DOWNLOADED") - void shouldCorrectlyMapActionStatusesInDownloadOnlyCase() { + /** + * DownloadOnly actions should be displayed as FINISHED when they have ActionStatus.DOWNLOADED + */ + @Test void shouldCorrectlyMapActionStatusesInDownloadOnlyCase() { TotalTargetCountStatus status = new TotalTargetCountStatus(targetCountActionStatuses, 55L, Action.ActionType.DOWNLOAD_ONLY); assertThat(status.getTotalTargetCountByStatus(TotalTargetCountStatus.Status.SCHEDULED)).isEqualTo(1L); diff --git a/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java b/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java index 73573f99a..19a3f3d4d 100644 --- a/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java +++ b/hawkbit-repository/hawkbit-repository-core/src/test/java/org/eclipse/hawkbit/event/BusProtoStuffMessageConverterTest.java @@ -15,7 +15,6 @@ import static org.mockito.Mockito.when; import java.util.HashMap; -import io.qameta.allure.Description; import org.eclipse.hawkbit.repository.event.remote.entity.RemoteEntityEvent; import org.eclipse.hawkbit.repository.event.remote.entity.TargetCreatedEvent; import org.eclipse.hawkbit.repository.model.Target; @@ -45,9 +44,10 @@ class BusProtoStuffMessageConverterTest { when(targetMock.getId()).thenReturn(1L); } - @Test - @Description("Verifies that the TargetCreatedEvent can be successfully serialized and deserialized") - void successfullySerializeAndDeserializeEvent() { + /** + * Verifies that the TargetCreatedEvent can be successfully serialized and deserialized + */ + @Test void successfullySerializeAndDeserializeEvent() { final TargetCreatedEvent targetCreatedEvent = new TargetCreatedEvent(targetMock, "1"); // serialize final Object serializedEvent = underTest.convertToInternal(targetCreatedEvent, @@ -62,9 +62,10 @@ class BusProtoStuffMessageConverterTest { .isEqualTo(targetCreatedEvent); } - @Test - @Description("Verifies that a MessageConversationException is thrown on missing event-type information encoding") - void missingEventTypeMappingThrowsMessageConversationException() { + /** + * Verifies that a MessageConversationException is thrown on missing event-type information encoding + */ + @Test void missingEventTypeMappingThrowsMessageConversationException() { final DummyRemoteEntityEvent dummyEvent = new DummyRemoteEntityEvent(targetMock, "applicationId"); final MessageHeaders messageHeaders = new MessageHeaders(new HashMap<>()); diff --git a/hawkbit-repository/hawkbit-repository-jpa-eclipselink/src/test/java/org/eclipse/hawkbit/repository/jpa/HawkBitEclipseLinkJpaDialectTest.java b/hawkbit-repository/hawkbit-repository-jpa-eclipselink/src/test/java/org/eclipse/hawkbit/repository/jpa/HawkBitEclipseLinkJpaDialectTest.java index 524cfa20e..c925b5cd8 100644 --- a/hawkbit-repository/hawkbit-repository-jpa-eclipselink/src/test/java/org/eclipse/hawkbit/repository/jpa/HawkBitEclipseLinkJpaDialectTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa-eclipselink/src/test/java/org/eclipse/hawkbit/repository/jpa/HawkBitEclipseLinkJpaDialectTest.java @@ -18,32 +18,33 @@ import java.sql.SQLException; import jakarta.persistence.OptimisticLockException; import jakarta.persistence.PersistenceException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.dao.UncategorizedDataAccessException; /** * Mapping tests for {@link HawkbitEclipseLinkJpaDialect}. + *

+ * Feature: Unit Tests - Repository
+ * Story: Exception handling */ -@Feature("Unit Tests - Repository") -@Story("Exception handling") class HawkBitEclipseLinkJpaDialectTest { private final HawkbitEclipseLinkJpaDialect hawkBitEclipseLinkJpaDialectUnderTest = new HawkbitEclipseLinkJpaDialect(); - @Test - @Description("Use Case: PersistenceException that can be mapped by EclipseLinkJpaDialect into corresponding DataAccessException.") - void jpaOptimisticLockExceptionIsConcurrencyFailureException() { + /** + * Use Case: PersistenceException that can be mapped by EclipseLinkJpaDialect into corresponding DataAccessException. + */ + @Test void jpaOptimisticLockExceptionIsConcurrencyFailureException() { assertThat(hawkBitEclipseLinkJpaDialectUnderTest.translateExceptionIfPossible(mock(OptimisticLockException.class))) .isInstanceOf(ConcurrencyFailureException.class); } + /** + * Use Case: PersistenceException that could not be mapped by EclipseLinkJpaDialect directly but + * instead is wrapped into JpaSystemException. Cause of PersistenceException is an SQLException. + */ @Test - @Description("Use Case: PersistenceException that could not be mapped by EclipseLinkJpaDialect directly but " - + "instead is wrapped into JpaSystemException. Cause of PersistenceException is an SQLException.") void jpaSystemExceptionWithSqlDeadLockExceptionIsConcurrencyFailureException() { final PersistenceException persEception = mock(PersistenceException.class); when(persEception.getCause()).thenReturn(new SQLException("simulated transaction ER_LOCK_DEADLOCK", "40001")); @@ -52,9 +53,11 @@ class HawkBitEclipseLinkJpaDialectTest { .isInstanceOf(ConcurrencyFailureException.class); } + /** + * Use Case: PersistenceException that could not be mapped by EclipseLinkJpaDialect directly but instead is wrapped + * into JpaSystemException. Cause of PersistenceException is not an SQLException. + */ @Test - @Description("Use Case: PersistenceException that could not be mapped by EclipseLinkJpaDialect directly but instead is wrapped" - + " into JpaSystemException. Cause of PersistenceException is not an SQLException.") void jpaSystemExceptionWithNumberFormatExceptionIsNull() { final PersistenceException persEception = mock(PersistenceException.class); when(persEception.getCause()).thenReturn(new NumberFormatException()); @@ -63,9 +66,11 @@ class HawkBitEclipseLinkJpaDialectTest { .isInstanceOf(UncategorizedDataAccessException.class); } + /** + * Use Case: RuntimeException that could not be mapped by EclipseLinkJpaDialect directly. + * Cause of RuntimeException is an SQLException. + */ @Test - @Description("Use Case: RuntimeException that could not be mapped by EclipseLinkJpaDialect directly. Cause of " - + "RuntimeException is an SQLException.") void runtimeExceptionWithSqlDeadLockExceptionIsConcurrencyFailureException() { final RuntimeException persEception = mock(RuntimeException.class); when(persEception.getCause()).thenReturn(new SQLException("simulated transaction ER_LOCK_DEADLOCK", "40001")); @@ -74,9 +79,11 @@ class HawkBitEclipseLinkJpaDialectTest { .isInstanceOf(ConcurrencyFailureException.class); } + /** + * Use Case: RuntimeException that could not be mapped by EclipseLinkJpaDialect directly. Cause of + * RuntimeException is not an SQLException. + */ @Test - @Description("Use Case: RuntimeException that could not be mapped by EclipseLinkJpaDialect directly. Cause of " - + "RuntimeException is not an SQLException.") void runtimeExceptionWithNumberFormatExceptionIsNull() { final RuntimeException persEception = mock(RuntimeException.class); when(persEception.getCause()).thenReturn(new NumberFormatException()); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteIdEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteIdEventTest.java index c44cb51b2..7b4d21352 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteIdEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteIdEventTest.java @@ -15,18 +15,16 @@ import static org.assertj.core.api.Assertions.fail; import java.lang.reflect.Constructor; import java.util.Arrays; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.model.JpaAction; import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Entity Id Events */ -@Feature("Component Tests - Repository") -@Story("Entity Id Events") class RemoteIdEventTest extends AbstractRemoteEventTest { private static final long ENTITY_ID = 1L; @@ -36,41 +34,47 @@ class RemoteIdEventTest extends AbstractRemoteEventTest { private static final String CONTROLLER_ID = "controller911"; private static final String ADDRESS = "amqp://anyhost"; - @Test - @Description("Verifies that the ds id is correct reloaded") - void testDistributionSetDeletedEvent() { + /** + * Verifies that the ds id is correct reloaded + */ + @Test void testDistributionSetDeletedEvent() { assertAndCreateRemoteEvent(DistributionSetDeletedEvent.class); } - @Test - @Description("Verifies that the ds tag id is correct reloaded") - void testDistributionSetTagDeletedEvent() { + /** + * Verifies that the ds tag id is correct reloaded + */ + @Test void testDistributionSetTagDeletedEvent() { assertAndCreateRemoteEvent(DistributionSetTagDeletedEvent.class); } - @Test - @Description("Verifies that the target id is correct reloaded") - void testTargetDeletedEvent() { + /** + * Verifies that the target id is correct reloaded + */ + @Test void testTargetDeletedEvent() { final TargetDeletedEvent deletedEvent = new TargetDeletedEvent(TENANT, ENTITY_ID, CONTROLLER_ID, ADDRESS, ENTITY_CLASS, NODE); assertEntity(deletedEvent); } - @Test - @Description("Verifies that the target tag id is correct reloaded") - void testTargetTagDeletedEvent() { + /** + * Verifies that the target tag id is correct reloaded + */ + @Test void testTargetTagDeletedEvent() { assertAndCreateRemoteEvent(TargetTagDeletedEvent.class); } - @Test - @Description("Verifies that the software module id is correct reloaded") - void testSoftwareModuleDeletedEvent() { + /** + * Verifies that the software module id is correct reloaded + */ + @Test void testSoftwareModuleDeletedEvent() { assertAndCreateRemoteEvent(SoftwareModuleDeletedEvent.class); } - @Test - @Description("Verifies that the rollout id is correct reloaded") - void testRolloutDeletedEvent() { + /** + * Verifies that the rollout id is correct reloaded + */ + @Test void testRolloutDeletedEvent() { assertAndCreateRemoteEvent(RolloutDeletedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteTenantAwareEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteTenantAwareEventTest.java index 54dd75840..0d88d3c4a 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteTenantAwareEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/RemoteTenantAwareEventTest.java @@ -13,9 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.model.JpaAction; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.ActionType; @@ -24,16 +21,19 @@ import org.eclipse.hawkbit.repository.model.ActionProperties; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.junit.jupiter.api.Test; -@Feature("Component Tests - Repository") -@Story("RemoteTenantAwareEvent Tests") +/** + * Feature: Component Tests - Repository
+ * Story: RemoteTenantAwareEvent Tests + */ class RemoteTenantAwareEventTest extends AbstractRemoteEventTest { private static final String TENANT_DEFAULT = "DEFAULT"; private static final String APPLICATION_ID_DEFAULT = "Node"; - @Test - @Description("Verifies that a testMultiActionAssignEvent can be properly serialized and deserialized") - void testMultiActionAssignEvent() { + /** + * Verifies that a testMultiActionAssignEvent can be properly serialized and deserialized + */ + @Test void testMultiActionAssignEvent() { final List controllerIds = List.of("id0", "id1", "id2", "id3", "id4loooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnng"); final List actions = controllerIds.stream().map(this::createAction).toList(); @@ -49,9 +49,10 @@ class RemoteTenantAwareEventTest extends AbstractRemoteEventTest { assertThat(remoteAssignEventJackson.getControllerIds()).containsExactlyElementsOf(controllerIds); } - @Test - @Description("Verifies that a MultiActionCancelEvent can be properly serialized and deserialized") - void testMultiActionCancelEvent() { + /** + * Verifies that a MultiActionCancelEvent can be properly serialized and deserialized + */ + @Test void testMultiActionCancelEvent() { final List controllerIds = List.of("id0", "id1", "id2", "id3", "id4loooooooooooooooooooooooooooooooooooonnnnnnnnnnnnnnnnnng"); final List actions = controllerIds.stream().map(this::createAction).toList(); @@ -67,9 +68,10 @@ class RemoteTenantAwareEventTest extends AbstractRemoteEventTest { assertThat(remoteCancelEventJackson.getControllerIds()).containsExactlyElementsOf(controllerIds); } - @Test - @Description("Verifies that a DownloadProgressEvent can be properly serialized and deserialized") - void reloadDownloadProgressByRemoteEvent() { + /** + * Verifies that a DownloadProgressEvent can be properly serialized and deserialized + */ + @Test void reloadDownloadProgressByRemoteEvent() { final DownloadProgressEvent downloadProgressEvent = new DownloadProgressEvent(TENANT_DEFAULT, 1L, 3L, APPLICATION_ID_DEFAULT); @@ -80,9 +82,10 @@ class RemoteTenantAwareEventTest extends AbstractRemoteEventTest { assertThat(downloadProgressEvent).isEqualTo(remoteEventJackson); } - @Test - @Description("Verifies that a TargetAssignDistributionSetEvent can be properly serialized and deserialized") - void testTargetAssignDistributionSetEvent() { + /** + * Verifies that a TargetAssignDistributionSetEvent can be properly serialized and deserialized + */ + @Test void testTargetAssignDistributionSetEvent() { final DistributionSet dsA = testdataFactory.createDistributionSet(""); @@ -107,9 +110,10 @@ class RemoteTenantAwareEventTest extends AbstractRemoteEventTest { assertTargetAssignDistributionSetEvent(action, remoteEventJackson); } - @Test - @Description("Verifies that a TargetAssignDistributionSetEvent can be properly serialized and deserialized") - void testCancelTargetAssignmentEvent() { + /** + * Verifies that a TargetAssignDistributionSetEvent can be properly serialized and deserialized + */ + @Test void testCancelTargetAssignmentEvent() { final DistributionSet dsA = testdataFactory.createDistributionSet(""); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRemoteEntityEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRemoteEntityEventTest.java index d84fece72..c10096d4f 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRemoteEntityEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRemoteEntityEventTest.java @@ -15,15 +15,14 @@ import static org.junit.jupiter.api.Assertions.fail; import java.lang.reflect.Constructor; import java.util.Arrays; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.event.remote.AbstractRemoteEventTest; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Entity Events */ -@Feature("Component Tests - Repository") -@Story("Entity Events") public abstract class AbstractRemoteEntityEventTest extends AbstractRemoteEventTest { protected RemoteEntityEvent assertAndCreateRemoteEvent(final Class> eventType) { diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/ActionEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/ActionEventTest.java index 12d84a340..7932ea44c 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/ActionEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/ActionEventTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.event.remote.entity; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.model.JpaAction; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.ActionType; @@ -24,20 +21,23 @@ import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test ActionCreatedEvent and ActionUpdatedEvent */ -@Feature("Component Tests - Repository") -@Story("Test ActionCreatedEvent and ActionUpdatedEvent") class ActionEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the action entity reloading by remote created works") - void testActionCreatedEvent() { + /** + * Verifies that the action entity reloading by remote created works + */ + @Test void testActionCreatedEvent() { assertAndCreateRemoteEvent(ActionCreatedEvent.class); } - @Test - @Description("Verifies that the action entity reloading by remote updated works") - void testActionUpdatedEvent() { + /** + * Verifies that the action entity reloading by remote updated works + */ + @Test void testActionUpdatedEvent() { assertAndCreateRemoteEvent(ActionUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetCreatedEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetCreatedEventTest.java index f3be0eee5..69a6aa93e 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetCreatedEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetCreatedEventTest.java @@ -9,22 +9,21 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test DistributionSetCreatedEvent */ -@Feature("Component Tests - Repository") -@Story("Test DistributionSetCreatedEvent") class DistributionSetCreatedEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the distribution set entity reloading by remote created event works") - void testDistributionSetCreatedEvent() { + /** + * Verifies that the distribution set entity reloading by remote created event works + */ + @Test void testDistributionSetCreatedEvent() { assertAndCreateRemoteEvent(DistributionSetCreatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetTagEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetTagEventTest.java index 1fcefab2f..199d6d174 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetTagEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetTagEventTest.java @@ -9,28 +9,28 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test DistributionSetTagCreatedEvent and DistributionSetTagUpdateEvent */ -@Feature("Component Tests - Repository") -@Story("Test DistributionSetTagCreatedEvent and DistributionSetTagUpdateEvent") class DistributionSetTagEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the distribution set tag entity reloading by remote created event works") - void testDistributionSetTagCreatedEvent() { + /** + * Verifies that the distribution set tag entity reloading by remote created event works + */ + @Test void testDistributionSetTagCreatedEvent() { assertAndCreateRemoteEvent(DistributionSetTagCreatedEvent.class); } - @Test - @Description("Verifies that the distribution set tag entity reloading by remote updated event works") - void testDistributionSetTagUpdateEvent() { + /** + * Verifies that the distribution set tag entity reloading by remote updated event works + */ + @Test void testDistributionSetTagUpdateEvent() { assertAndCreateRemoteEvent(DistributionSetTagUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetUpdatedEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetUpdatedEventTest.java index c71e55df1..8b507f562 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetUpdatedEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/DistributionSetUpdatedEventTest.java @@ -9,22 +9,21 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test DistributionSetUpdateEvent */ -@Feature("Component Tests - Repository") -@Story("Test DistributionSetUpdateEvent") class DistributionSetUpdatedEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the distribution set entity reloading by remote updated event works") - void testDistributionSetUpdateEvent() { + /** + * Verifies that the distribution set entity reloading by remote updated event works + */ + @Test void testDistributionSetUpdateEvent() { assertAndCreateRemoteEvent(DistributionSetUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutEventTest.java index bf4cf5537..99c7b2b5c 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutEventTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.event.remote.entity; import java.util.Collections; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Rollout; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; @@ -23,14 +20,16 @@ import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test RolloutUpdatedEvent */ -@Feature("Component Tests - Repository") -@Story("Test RolloutUpdatedEvent") class RolloutEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the rollout entity reloading by remote updated event works") - void testRolloutUpdatedEvent() { + /** + * Verifies that the rollout entity reloading by remote updated event works + */ + @Test void testRolloutUpdatedEvent() { assertAndCreateRemoteEvent(RolloutUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutGroupEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutGroupEventTest.java index cee49888b..913b8a074 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutGroupEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/RolloutGroupEventTest.java @@ -14,9 +14,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.Collections; import java.util.UUID; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Rollout; import org.eclipse.hawkbit.repository.model.RolloutGroup; @@ -27,22 +24,25 @@ import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test RolloutGroupCreatedEvent and RolloutGroupUpdatedEvent */ -@Feature("Component Tests - Repository") -@Story("Test RolloutGroupCreatedEvent and RolloutGroupUpdatedEvent") class RolloutGroupEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the rollout group entity reloading by remote created event works") - void testRolloutGroupCreatedEvent() { + /** + * Verifies that the rollout group entity reloading by remote created event works + */ + @Test void testRolloutGroupCreatedEvent() { final RolloutGroupCreatedEvent createdEvent = (RolloutGroupCreatedEvent) assertAndCreateRemoteEvent( RolloutGroupCreatedEvent.class); assertThat(createdEvent.getRolloutId()).isNotNull(); } - @Test - @Description("Verifies that the rollout group entity reloading by remote updated event works") - void testRolloutGroupUpdatedEvent() { + /** + * Verifies that the rollout group entity reloading by remote updated event works + */ + @Test void testRolloutGroupUpdatedEvent() { assertAndCreateRemoteEvent(RolloutGroupUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/SoftwareModuleEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/SoftwareModuleEventTest.java index 224318c58..bf404b27d 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/SoftwareModuleEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/SoftwareModuleEventTest.java @@ -9,28 +9,28 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test SoftwareModuleCreatedEvent, SoftwareModuleUpdatedEvent */ -@Feature("Component Tests - Repository") -@Story("Test SoftwareModuleCreatedEvent, SoftwareModuleUpdatedEvent") class SoftwareModuleEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the software module entity reloading by remote created event works") - void testTargetCreatedEvent() { + /** + * Verifies that the software module entity reloading by remote created event works + */ + @Test void testTargetCreatedEvent() { assertAndCreateRemoteEvent(SoftwareModuleCreatedEvent.class); } - @Test - @Description("Verifies that the software module entity reloading by remote updated event works") - void testTargetUpdatedEvent() { + /** + * Verifies that the software module entity reloading by remote updated event works + */ + @Test void testTargetUpdatedEvent() { assertAndCreateRemoteEvent(SoftwareModuleUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetEventTest.java index 391e6df36..e4797e0f2 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetEventTest.java @@ -9,28 +9,28 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.Target; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test TargetCreatedEvent, TargetUpdatedEvent and CancelTargetAssignmentEvent */ -@Feature("Component Tests - Repository") -@Story("Test TargetCreatedEvent, TargetUpdatedEvent and CancelTargetAssignmentEvent") class TargetEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the target entity reloading by remote created event works") - void testTargetCreatedEvent() { + /** + * Verifies that the target entity reloading by remote created event works + */ + @Test void testTargetCreatedEvent() { assertAndCreateRemoteEvent(TargetCreatedEvent.class); } - @Test - @Description("Verifies that the target entity reloading by remote updated event works") - void testTargetUpdatedEvent() { + /** + * Verifies that the target entity reloading by remote updated event works + */ + @Test void testTargetUpdatedEvent() { assertAndCreateRemoteEvent(TargetUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetTagEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetTagEventTest.java index 807f4ee34..171920560 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetTagEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/event/remote/entity/TargetTagEventTest.java @@ -9,28 +9,28 @@ */ package org.eclipse.hawkbit.repository.event.remote.entity; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.model.TargetTag; import org.junit.jupiter.api.Test; /** * Test the remote entity events. + *

+ * Feature: Component Tests - Repository
+ * Story: Test TargetTagCreatedEvent and TargetTagUpdateEvent */ -@Feature("Component Tests - Repository") -@Story("Test TargetTagCreatedEvent and TargetTagUpdateEvent") class TargetTagEventTest extends AbstractRemoteEntityEventTest { - @Test - @Description("Verifies that the target tag entity reloading by remote created event works") - void testTargetTagCreatedEvent() { + /** + * Verifies that the target tag entity reloading by remote created event works + */ + @Test void testTargetTagCreatedEvent() { assertAndCreateRemoteEvent(TargetTagCreatedEvent.class); } - @Test - @Description("Verifies that the target tag entity reloading by remote updated event works") - void testTargetTagUpdateEventt() { + /** + * Verifies that the target tag entity reloading by remote updated event works + */ + @Test void testTargetTagUpdateEventt() { assertAndCreateRemoteEvent(TargetTagUpdatedEvent.class); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractRepositoryManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractRepositoryManagementSecurityTest.java index d0d9cd95b..18bb039db 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractRepositoryManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/AbstractRepositoryManagementSecurityTest.java @@ -11,7 +11,6 @@ package org.eclipse.hawkbit.repository.jpa; import java.util.List; -import io.qameta.allure.Description; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.junit.jupiter.api.Test; @@ -34,76 +33,87 @@ public abstract class AbstractRepositoryManagementSecurityTest extends */ protected abstract U getUpdateObject(); - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - void createCollectionPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test void createCollectionPermissionCheck() { assertPermissions(() -> getRepositoryManagement().create(List.of(getCreateObject())), List.of(SpPermission.CREATE_REPOSITORY, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - void createPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionCheck() { assertPermissions(() -> getRepositoryManagement().create(getCreateObject()), List.of(SpPermission.CREATE_REPOSITORY, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - void updatePermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionCheck() { assertPermissions(() -> getRepositoryManagement().update(getUpdateObject()), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - void deletePermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionCheck() { assertPermissions(() -> { getRepositoryManagement().delete(1L); return null; }, List.of(SpPermission.DELETE_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void countPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void countPermissionCheck() { assertPermissions(() -> getRepositoryManagement().count(), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void deleteCollectionRepositoryManagement() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void deleteCollectionRepositoryManagement() { assertPermissions(() -> { getRepositoryManagement().delete(List.of(1L)); return null; }, List.of(SpPermission.DELETE_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void getPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void getPermissionCheck() { assertPermissions(() -> getRepositoryManagement().get(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void getCollectionPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void getCollectionPermissionCheck() { assertPermissions(() -> getRepositoryManagement().get(List.of(1L)), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void existsCollectionPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void existsCollectionPermissionCheck() { assertPermissions(() -> getRepositoryManagement().exists(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void findAllPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void findAllPermissionCheck() { assertPermissions(() -> getRepositoryManagement().findAll(Pageable.ofSize(1)), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions.") - public void findByRsqlPermissionCheck() { + /** + * Tests RepositoryManagement PreAuthorized method with correct and insufficient permissions. + */ + @Test public void findByRsqlPermissionCheck() { assertPermissions(() -> getRepositoryManagement().findByRsql("(name==*)", Pageable.ofSize(1)), List.of(SpPermission.READ_REPOSITORY)); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/ConcurrentDistributionSetInvalidationTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/ConcurrentDistributionSetInvalidationTest.java index f1797a406..d0df0a737 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/ConcurrentDistributionSetInvalidationTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/ConcurrentDistributionSetInvalidationTest.java @@ -19,9 +19,6 @@ import java.time.Duration; import java.util.Collections; import java.util.concurrent.TimeUnit; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.repository.exception.StopRolloutException; import org.eclipse.hawkbit.repository.jpa.model.JpaRolloutGroup; @@ -46,16 +43,18 @@ import org.springframework.test.context.TestPropertySource; /** * Test class testing the invalidation of a {@link DistributionSet} while the * handle rollouts is ongoing. + *

+ * Feature: Component Tests - Repository
+ * Story: Concurrent Distribution Set invalidation */ -@Feature("Component Tests - Repository") -@Story("Concurrent Distribution Set invalidation") @ContextConfiguration(classes = ConcurrentDistributionSetInvalidationTest.Config.class) @TestPropertySource(properties = { "hawkbit.server.repository.dsInvalidationLockTimeout=1" }) class ConcurrentDistributionSetInvalidationTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verify that a large rollout causes a timeout when trying to invalidate a distribution set") - void verifyInvalidateDistributionSetWithLargeRolloutThrowsException() { + /** + * Verify that a large rollout causes a timeout when trying to invalidate a distribution set + */ + @Test void verifyInvalidateDistributionSetWithLargeRolloutThrowsException() { final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final Rollout rollout = createRollout(distributionSet); final String tenant = tenantAware.getCurrentTenant(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/context/ContextAwareTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/context/ContextAwareTest.java index 738c99670..1478365b0 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/context/ContextAwareTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/context/ContextAwareTest.java @@ -15,9 +15,6 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ContextAware; import org.eclipse.hawkbit.repository.autoassign.AutoAssignExecutor; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -32,8 +29,10 @@ import org.springframework.data.domain.Pageable; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; -@Feature("Component Tests - Context runner") -@Story("Test Context Runner") +/** + * Feature: Component Tests - Context runner
+ * Story: Test Context Runner + */ class ContextAwareTest extends AbstractJpaIntegrationTest { @Autowired @@ -51,9 +50,10 @@ class ContextAwareTest extends AbstractJpaIntegrationTest { reset(contextAware); } - @Test - @Description("Verifies acm context is persisted when creating Rollout") - void verifyAcmContextIsPersistedInCreatedRollout() { + /** + * Verifies acm context is persisted when creating Rollout + */ + @Test void verifyAcmContextIsPersistedInCreatedRollout() { final SecurityContext securityContext = SecurityContextHolder.getContext(); assertThat(securityContext).isNotNull(); @@ -63,9 +63,10 @@ class ContextAwareTest extends AbstractJpaIntegrationTest { assertThat(SECURITY_CONTEXT_SERIALIZER.deserialize(ctx)).isEqualTo(securityContext)); } - @Test - @Description("Verifies acm context is reused when handling a rollout") - void verifyContextIsReusedWhenHandlingRollout() { + /** + * Verifies acm context is reused when handling a rollout + */ + @Test void verifyContextIsReusedWhenHandlingRollout() { final SecurityContext securityContext = SecurityContextHolder.getContext(); assertThat(securityContext).isNotNull(); @@ -74,9 +75,10 @@ class ContextAwareTest extends AbstractJpaIntegrationTest { verify(contextAware).runInContext(eq(SECURITY_CONTEXT_SERIALIZER.serialize(securityContext)), any(Runnable.class)); } - @Test - @Description("Verifies acm context is persisted when activating auto assignment") - void verifyContextIsPersistedInActiveAutoAssignment() { + /** + * Verifies acm context is persisted when activating auto assignment + */ + @Test void verifyContextIsPersistedInActiveAutoAssignment() { final SecurityContext securityContext = SecurityContextHolder.getContext(); assertThat(securityContext).isNotNull(); @@ -86,9 +88,10 @@ class ContextAwareTest extends AbstractJpaIntegrationTest { assertThat(SECURITY_CONTEXT_SERIALIZER.deserialize(ctx)).isEqualTo(securityContext)); } - @Test - @Description("Verifies acm context is used when performing auto assign check on all target") - void verifyContextIsReusedWhenCheckingForAutoAssignmentAllTargets() { + /** + * Verifies acm context is used when performing auto assign check on all target + */ + @Test void verifyContextIsReusedWhenCheckingForAutoAssignmentAllTargets() { final SecurityContext securityContext = SecurityContextHolder.getContext(); assertThat(securityContext).isNotNull(); @@ -97,9 +100,10 @@ class ContextAwareTest extends AbstractJpaIntegrationTest { verify(contextAware).runInContext(eq(SECURITY_CONTEXT_SERIALIZER.serialize(securityContext)), any(Runnable.class)); } - @Test - @Description("Verifies acm context is used when performing auto assign check on single target") - void verifyContextIsReusedWhenCheckingForAutoAssignmentSingleTarget() { + /** + * Verifies acm context is used when performing auto assign check on single target + */ + @Test void verifyContextIsReusedWhenCheckingForAutoAssignmentSingleTarget() { final SecurityContext securityContext = SecurityContextHolder.getContext(); assertThat(securityContext).isNotNull(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/DistributionSetAccessControllerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/DistributionSetAccessControllerTest.java index b6e963738..541b832a2 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/DistributionSetAccessControllerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/DistributionSetAccessControllerTest.java @@ -20,9 +20,6 @@ import java.util.Map; import jakarta.persistence.criteria.Predicate; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.Identifiable; import org.eclipse.hawkbit.repository.builder.AutoAssignDistributionSetUpdate; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; @@ -41,13 +38,16 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; -@Feature("Component Tests - Access Control") -@Story("Test Distribution Set Access Controller") +/** + * Feature: Component Tests - Access Control
+ * Story: Test Distribution Set Access Controller + */ class DistributionSetAccessControllerTest extends AbstractAccessControllerTest { - @Test - @Description("Verifies read access rules for distribution sets") - void verifyDistributionSetReadOperations() { + /** + * Verifies read access rules for distribution sets + */ + @Test void verifyDistributionSetReadOperations() { permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); permitAllOperations(AccessController.Operation.UPDATE); @@ -116,9 +116,10 @@ class DistributionSetAccessControllerTest extends AbstractAccessControllerTest { .as("Action is hidden.").isInstanceOf(InsufficientPermissionException.class); } - @Test - @Description("Verifies read access rules for distribution sets") - void verifyDistributionSetUpdates() { + /** + * Verifies read access rules for distribution sets + */ + @Test void verifyDistributionSetUpdates() { // permit all operations first to prepare test setup permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetAccessControllerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetAccessControllerTest.java index ac5a30fc0..cacb97ad0 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetAccessControllerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetAccessControllerTest.java @@ -18,9 +18,6 @@ import java.util.List; import jakarta.persistence.criteria.Predicate; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.FilterParams; import org.eclipse.hawkbit.repository.Identifiable; import org.eclipse.hawkbit.repository.exception.InsufficientPermissionException; @@ -42,16 +39,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; -@Feature("Component Tests - Access Control") -@Story("Test Target Access Controller") +/** + * Feature: Component Tests - Access Control
+ * Story: Test Target Access Controller + */ class TargetAccessControllerTest extends AbstractAccessControllerTest { @Autowired AutoAssignChecker autoAssignChecker; - @Test - @Description("Verifies read access rules for targets") - void verifyTargetReadOperations() { + /** + * Verifies read access rules for targets + */ + @Test void verifyTargetReadOperations() { permitAllOperations(AccessController.Operation.CREATE); final Target permittedTarget = targetManagement @@ -203,9 +203,10 @@ class TargetAccessControllerTest extends AbstractAccessControllerTest { .isInstanceOf(InsufficientPermissionException.class); } - @Test - @Description("Verifies rules for target assignment") - void verifyTargetAssignment() { + /** + * Verifies rules for target assignment + */ + @Test void verifyTargetAssignment() { permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); permitAllOperations(AccessController.Operation.UPDATE); @@ -249,9 +250,10 @@ class TargetAccessControllerTest extends AbstractAccessControllerTest { .map(Identifiable::getId).toList()).containsOnly(permittedTarget.getId()); } - @Test - @Description("Verifies rules for target assignment") - void verifyTargetAssignmentOnNonUpdatableTarget() { + /** + * Verifies rules for target assignment + */ + @Test void verifyTargetAssignmentOnNonUpdatableTarget() { permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); permitAllOperations(AccessController.Operation.UPDATE); @@ -289,9 +291,10 @@ class TargetAccessControllerTest extends AbstractAccessControllerTest { Action.ActionType.FORCED).getAssigned()).isEqualTo(1); } - @Test - @Description("Verifies only manageable targets are part of the rollout") - void verifyRolloutTargetScope() { + /** + * Verifies only manageable targets are part of the rollout + */ + @Test void verifyRolloutTargetScope() { permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); permitAllOperations(AccessController.Operation.UPDATE); @@ -330,9 +333,10 @@ class TargetAccessControllerTest extends AbstractAccessControllerTest { .anyMatch(readTarget -> readTarget.getId().equals(target.getId()))); } - @Test - @Description("Verifies only manageable targets are part of an auto assignment.") - void verifyAutoAssignmentTargetScope() { + /** + * Verifies only manageable targets are part of an auto assignment. + */ + @Test void verifyAutoAssignmentTargetScope() { permitAllOperations(AccessController.Operation.READ); permitAllOperations(AccessController.Operation.CREATE); permitAllOperations(AccessController.Operation.UPDATE); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetTypeAccessControllerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetTypeAccessControllerTest.java index 03fa19ff6..7f43ddc48 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetTypeAccessControllerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/acm/controller/TargetTypeAccessControllerTest.java @@ -16,9 +16,6 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.Identifiable; import org.eclipse.hawkbit.repository.builder.TargetTypeCreate; import org.eclipse.hawkbit.repository.builder.TargetTypeUpdate; @@ -31,13 +28,16 @@ import org.eclipse.hawkbit.repository.model.TargetType; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Pageable; -@Feature("Component Tests - Access Control") -@Story("Test Target Type Access Controller") +/** + * Feature: Component Tests - Access Control
+ * Story: Test Target Type Access Controller + */ class TargetTypeAccessControllerTest extends AbstractAccessControllerTest { - @Test - @Description("Verifies read access rules for target types") - void verifyTargetTypeReadOperations() { + /** + * Verifies read access rules for target types + */ + @Test void verifyTargetTypeReadOperations() { permitAllOperations(AccessController.Operation.CREATE); final TargetType permittedTargetType = targetTypeManagement.create(entityFactory.targetType().create().name("type1")); final TargetType hiddenTargetType = targetTypeManagement.create(entityFactory.targetType().create().name("type2")); @@ -96,9 +96,10 @@ class TargetTypeAccessControllerTest extends AbstractAccessControllerTest { .isInstanceOf(EntityNotFoundException.class); } - @Test - @Description("Verifies delete access rules for target types") - void verifyTargetTypeDeleteOperations() { + /** + * Verifies delete access rules for target types + */ + @Test void verifyTargetTypeDeleteOperations() { permitAllOperations(AccessController.Operation.CREATE); final TargetType manageableTargetType = targetTypeManagement.create(entityFactory.targetType().create().name("type1")); @@ -119,9 +120,10 @@ class TargetTypeAccessControllerTest extends AbstractAccessControllerTest { .isInstanceOfAny(InsufficientPermissionException.class, EntityNotFoundException.class); } - @Test - @Description("Verifies update operation for target types") - void verifyTargetTypeUpdateOperations() { + /** + * Verifies update operation for target types + */ + @Test void verifyTargetTypeUpdateOperations() { permitAllOperations(AccessController.Operation.CREATE); final TargetType manageableTargetType = targetTypeManagement .create(entityFactory.targetType().create().name("type1")); @@ -146,9 +148,10 @@ class TargetTypeAccessControllerTest extends AbstractAccessControllerTest { .isInstanceOf(InsufficientPermissionException.class); } - @Test - @Description("Verifies create operation blocked by controller") - void verifyTargetTypeCreationBlockedByAccessController() { + /** + * Verifies create operation blocked by controller + */ + @Test void verifyTargetTypeCreationBlockedByAccessController() { defineAccess(AccessController.Operation.CREATE); // allows for none // verify targetTypeManagement#create for any type final TargetTypeCreate targetTypeCreate = entityFactory.targetType().create().name("type1"); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerIntTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerIntTest.java index e20443568..785b697e4 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerIntTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerIntTest.java @@ -20,10 +20,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.DeploymentManagement; import org.eclipse.hawkbit.repository.builder.AutoAssignDistributionSetUpdate; import org.eclipse.hawkbit.repository.exception.IncompleteDistributionSetException; @@ -49,9 +45,10 @@ import org.springframework.data.domain.Slice; /** * Test class for {@link AutoAssignChecker}. + *

+ * Feature: Component Tests - Repository
+ * Story: Auto assign checker */ -@Feature("Component Tests - Repository") -@Story("Auto assign checker") @SuppressWarnings("java:S6813") // constructor injects are not possible for test classes class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { @@ -62,9 +59,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { @Autowired private DeploymentManagement deploymentManagement; - @Test - @Description("Verifies that a running action is auto canceled by a AutoAssignment which assigns another distribution-set.") - void autoAssignDistributionSetAndAutoCloseOldActions() { + /** + * Verifies that a running action is auto canceled by a AutoAssignment which assigns another distribution-set. + */ + @Test void autoAssignDistributionSetAndAutoCloseOldActions() { tenantConfigurationManagement .addOrUpdateConfiguration(TenantConfigurationKey.REPOSITORY_ACTIONS_AUTOCLOSE_ENABLED, true); @@ -106,9 +104,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Test auto assignment of a DS to filtered targets") - void checkAutoAssign() { + /** + * Test auto assignment of a DS to filtered targets + */ + @Test void checkAutoAssign() { // will be auto assigned final DistributionSet setA = testdataFactory.createDistributionSet("dsA"); final DistributionSet setB = testdataFactory.createDistributionSet("dsB"); @@ -158,9 +157,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { verifyThatCreatedActionsAreInitiatedByCurrentUser(targetFilterQuery, setA, targets); } - @Test - @Description("Test auto assignment of a DS for a specific device") - void checkAutoAssignmentForDevice() { + /** + * Test auto assignment of a DS for a specific device + */ + @Test void checkAutoAssignmentForDevice() { final DistributionSet toAssignDs = testdataFactory.createDistributionSet(); @@ -182,9 +182,11 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { verifyThatTargetsNotHaveDistributionSetAssignment(toAssignDs, targets.subList(1, 25)); } + /** + * Test auto assignment of a DS to filtered targets with different confirmation options + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Test auto assignment of a DS to filtered targets with different confirmation options") void checkAutoAssignWithConfirmationOptions(final boolean confirmationFlowActive, final boolean confirmationRequired, final Action.Status expectedStatus) { @@ -210,9 +212,11 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { verifyThatTargetsHaveDistributionSetAssignedAndActionStatus(distributionSet, targets, expectedStatus); } + /** + * Test auto assignment of a DS for a specific device with different confirmation options + */ @ParameterizedTest @MethodSource("confirmationOptions") - @Description("Test auto assignment of a DS for a specific device with different confirmation options") void checkAutoAssignmentForDeviceWithConfirmationRequired(final boolean confirmationFlowActive, final boolean confirmationRequired, final Action.Status expectedStatus) { @@ -237,9 +241,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { verifyThatTargetsNotHaveDistributionSetAssignment(toAssignDs, targets.subList(1, 25)); } - @Test - @Description("Test auto assignment of an incomplete DS to filtered targets, that causes failures") - void checkAutoAssignWithFailures() { + /** + * Test auto assignment of an incomplete DS to filtered targets, that causes failures + */ + @Test void checkAutoAssignWithFailures() { // incomplete distribution set that will be assigned final DistributionSet setF = distributionSetManagement.create(entityFactory.distributionSet().create() @@ -286,9 +291,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Test auto assignment of a distribution set with FORCED, SOFT and DOWNLOAD_ONLY action types") - void checkAutoAssignWithDifferentActionTypes() { + /** + * Test auto assignment of a distribution set with FORCED, SOFT and DOWNLOAD_ONLY action types + */ + @Test void checkAutoAssignWithDifferentActionTypes() { final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final String targetDsAIdPref = "A"; final String targetDsBIdPref = "B"; @@ -315,9 +321,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { verifyThatTargetsHaveAssignmentActionType(ActionType.DOWNLOAD_ONLY, targetsC); } - @Test - @Description("An auto assignment target filter with weight creates actions with weights") - void actionsWithWeightAreCreated() { + /** + * An auto assignment target filter with weight creates actions with weights + */ + @Test void actionsWithWeightAreCreated() { final int amountOfTargets = 5; final DistributionSet ds = testdataFactory.createDistributionSet(); final int weight = 32; @@ -334,9 +341,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getWeight().get() == weight); } - @Test - @Description("An auto assignment target filter without weight still works after multi assignment is enabled") - void filterWithoutWeightWorksInMultiAssignmentMode() { + /** + * An auto assignment target filter without weight still works after multi assignment is enabled + */ + @Test void filterWithoutWeightWorksInMultiAssignmentMode() { final int amountOfTargets = 5; final DistributionSet ds = testdataFactory.createDistributionSet(); targetFilterQueryManagement.create( @@ -352,9 +360,10 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getWeight().isPresent()); } - @Test - @Description("Verifies an auto assignment only creates actions for compatible targets") - void checkAutoAssignmentWithIncompatibleTargets() { + /** + * Verifies an auto assignment only creates actions for compatible targets + */ + @Test void checkAutoAssignmentWithIncompatibleTargets() { final int TARGET_COUNT = 5; final DistributionSet testDs = testdataFactory.createDistributionSet(); @@ -414,7 +423,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { * @param set the expected distribution set * @param targets the targets that should have it */ - @Step private void verifyThatTargetsHaveDistributionSetAssignment( final DistributionSet set, final List targets, final int count) { final List targetIds = targets.stream().map(Target::getId).toList(); @@ -430,7 +438,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { } } - @Step private void verifyThatTargetsHaveDistributionSetAssignedAndActionStatus(final DistributionSet set, final List targets, final Action.Status status) { final List targetIds = targets.stream().map(Target::getControllerId).toList(); @@ -445,7 +452,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { assertThat(actionsByDs).allMatch(action -> action.getStatus() == status); } - @Step private void verifyThatTargetsNotHaveDistributionSetAssignment(final DistributionSet set, final List targets) { final List targetIds = targets.stream().map(Target::getId).toList(); @@ -460,7 +466,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { } - @Step private void verifyThatCreatedActionsAreInitiatedByCurrentUser(final TargetFilterQuery targetFilterQuery, final DistributionSet distributionSet, final List targets) { final Set targetIds = targets.stream().map(Target::getControllerId).collect(Collectors.toSet()); @@ -472,7 +477,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { .isEqualTo(targetFilterQuery.getAutoAssignInitiatedBy())); } - @Step private List createTargetsAndAutoAssignDistSet(final String prefix, final int targetCount, final DistributionSet distributionSet, final ActionType actionType) { @@ -485,7 +489,6 @@ class AutoAssignCheckerIntTest extends AbstractJpaIntegrationTest { return targets; } - @Step private void verifyThatTargetsHaveAssignmentActionType(final ActionType actionType, final List targets) { final List actions = targets.stream() .map(Target::getControllerId) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerTest.java index 9caf7e961..cb59d50ef 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignCheckerTest.java @@ -21,9 +21,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.ContextAware; import org.eclipse.hawkbit.repository.DeploymentManagement; import org.eclipse.hawkbit.repository.TargetFilterQueryManagement; @@ -42,8 +39,10 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.data.domain.SliceImpl; import org.springframework.transaction.PlatformTransactionManager; -@Feature("Unit Tests - Repository") -@Story("Auto assign checker") +/** + * Feature: Unit Tests - Repository
+ * Story: Auto assign checker + */ @ExtendWith(MockitoExtension.class) class AutoAssignCheckerTest { @@ -66,9 +65,10 @@ class AutoAssignCheckerTest { transactionManager, contextAware); } - @Test - @Description("Single device check triggers update for matching auto assignment filter.") - void checkForDevice() { + /** + * Single device check triggers update for matching auto assignment filter. + */ + @Test void checkForDevice() { mockRunningAsNonSystem(); final String target = getRandomString(); final long ds = getRandomLong(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoActionCleanupTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoActionCleanupTest.java index f05b9004a..d5104718c 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoActionCleanupTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoActionCleanupTest.java @@ -17,9 +17,6 @@ import static org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationPrope import java.util.Arrays; import java.util.stream.Collectors; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; @@ -30,18 +27,20 @@ import org.springframework.beans.factory.annotation.Autowired; /** * Test class for {@link AutoActionCleanup}. + *

+ * Feature: Component Tests - Repository
+ * Story: Action cleanup handler */ -@Feature("Component Tests - Repository") -@Story("Action cleanup handler") @SuppressWarnings("java:S6813") // constructor injects are not possible for test classes class AutoActionCleanupTest extends AbstractJpaIntegrationTest { @Autowired private AutoActionCleanup autoActionCleanup; - @Test - @Description("Verifies that running actions are not cleaned up.") - void runningActionsAreNotCleanedUp() { + /** + * Verifies that running actions are not cleaned up. + */ + @Test void runningActionsAreNotCleanedUp() { // cleanup config for this test case setupCleanupConfiguration(true, 0, Action.Status.CANCELED, Action.Status.ERROR); @@ -62,9 +61,10 @@ class AutoActionCleanupTest extends AbstractJpaIntegrationTest { assertThat(actionRepository.count()).isEqualTo(2); } - @Test - @Description("Verifies that nothing is cleaned up if the cleanup is disabled.") - void cleanupDisabled() { + /** + * Verifies that nothing is cleaned up if the cleanup is disabled. + */ + @Test void cleanupDisabled() { // cleanup config for this test case setupCleanupConfiguration(false, 0, Action.Status.CANCELED); @@ -87,9 +87,10 @@ class AutoActionCleanupTest extends AbstractJpaIntegrationTest { assertThat(actionRepository.count()).isEqualTo(2); } - @Test - @Description("Verifies that canceled and failed actions are cleaned up.") - void canceledAndFailedActionsAreCleanedUp() { + /** + * Verifies that canceled and failed actions are cleaned up. + */ + @Test void canceledAndFailedActionsAreCleanedUp() { // cleanup config for this test case setupCleanupConfiguration(true, 0, Action.Status.CANCELED, Action.Status.ERROR); @@ -118,9 +119,10 @@ class AutoActionCleanupTest extends AbstractJpaIntegrationTest { assertThat(actionRepository.findById(action3)).isPresent(); } - @Test - @Description("Verifies that canceled actions are cleaned up.") - void canceledActionsAreCleanedUp() { + /** + * Verifies that canceled actions are cleaned up. + */ + @Test void canceledActionsAreCleanedUp() { // cleanup config for this test case setupCleanupConfiguration(true, 0, Action.Status.CANCELED); @@ -150,9 +152,10 @@ class AutoActionCleanupTest extends AbstractJpaIntegrationTest { assertThat(actionRepository.findById(action3)).isPresent(); } - @Test - @Description("Verifies that canceled and failed actions are cleaned up once they expired.") - @SuppressWarnings("squid:S2925") + /** + * Verifies that canceled and failed actions are cleaned up once they expired. + */ + @Test @SuppressWarnings("squid:S2925") void canceledAndFailedActionsAreCleanedUpWhenExpired() throws InterruptedException { // cleanup config for this test case setupCleanupConfiguration(true, 500, Action.Status.CANCELED, Action.Status.ERROR); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoCleanupSchedulerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoCleanupSchedulerTest.java index 1f3e3ddef..66c2c281e 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoCleanupSchedulerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/autocleanup/AutoCleanupSchedulerTest.java @@ -14,9 +14,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.Arrays; import java.util.concurrent.atomic.AtomicInteger; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -25,9 +22,10 @@ import org.springframework.integration.support.locks.LockRegistry; /** * Test class for {@link AutoCleanupScheduler}. + *

+ * Feature: Component Tests - Repository
+ * Story: Auto cleanup scheduler */ -@Feature("Component Tests - Repository") -@Story("Auto cleanup scheduler") @SuppressWarnings("java:S6813") // constructor injects are not possible for test classes class AutoCleanupSchedulerTest extends AbstractJpaIntegrationTest { @@ -41,9 +39,10 @@ class AutoCleanupSchedulerTest extends AbstractJpaIntegrationTest { counter.set(0); } - @Test - @Description("Verifies that all cleanup handlers are executed regardless if one of them throws an error") - void executeHandlerChain() { + /** + * Verifies that all cleanup handlers are executed regardless if one of them throws an error + */ + @Test void executeHandlerChain() { new AutoCleanupScheduler(systemManagement, systemSecurityContext, lockRegistry, Arrays.asList( new SuccessfulCleanup(), new SuccessfulCleanup(), new FailingCleanup(), new SuccessfulCleanup())).run(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/cluster/DistributedLockTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/cluster/DistributedLockTest.java index d52b0150a..e8eeed7e4 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/cluster/DistributedLockTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/cluster/DistributedLockTest.java @@ -19,9 +19,6 @@ import java.util.concurrent.locks.Lock; import javax.sql.DataSource; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; @@ -43,8 +40,10 @@ import org.springframework.security.provisioning.InMemoryUserDetailsManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; -@Feature("Component Tests - Repository") -@Story("Distributed Lock") +/** + * Feature: Component Tests - Repository
+ * Story: Distributed Lock + */ @SpringBootTest(classes = { DistributedLockTest.Config.class }, webEnvironment = SpringBootTest.WebEnvironment.NONE) @Slf4j class DistributedLockTest extends AbstractJpaIntegrationTest { @@ -94,9 +93,11 @@ class DistributedLockTest extends AbstractJpaIntegrationTest { } } + /** + * Test to verify that lock is kept while ping runs + */ @SuppressWarnings({"java:S2925"}) @Test - @Description("Test to verify that lock is kept while ping runs") void keepLockAlive() { final LockRegistry lockRegistry0 = new JdbcLockRegistry(lockRepository0); final LockRegistry lockRegistry1 = new JdbcLockRegistry(lockRepository1); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/event/RepositoryEntityEventTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/event/RepositoryEntityEventTest.java index 3d87ec26d..1811377c2 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/event/RepositoryEntityEventTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/event/RepositoryEntityEventTest.java @@ -15,9 +15,6 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.assertj.core.api.Assertions; import org.eclipse.hawkbit.repository.event.TenantAwareEvent; import org.eclipse.hawkbit.repository.event.remote.DistributionSetDeletedEvent; @@ -47,8 +44,10 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; import org.springframework.context.event.EventListener; -@Feature("Component Tests - Repository") -@Story("Entity Events") +/** + * Feature: Component Tests - Repository
+ * Story: Entity Events + */ @SpringBootTest(classes = { RepositoryTestConfiguration.class }, webEnvironment = SpringBootTest.WebEnvironment.NONE) @SuppressWarnings("java:S6813") // constructor injects are not possible for test classes class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { @@ -61,9 +60,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { eventListener.queue.clear(); } - @Test - @Description("Verifies that the target created event is published when a target has been created") - void targetCreatedEventIsPublished() throws InterruptedException { + /** + * Verifies that the target created event is published when a target has been created + */ + @Test void targetCreatedEventIsPublished() throws InterruptedException { final Target createdTarget = testdataFactory.createTarget("12345"); final TargetCreatedEvent targetCreatedEvent = eventListener.waitForEvent(TargetCreatedEvent.class); @@ -71,9 +71,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(targetCreatedEvent)).isEqualTo(createdTarget.getId()); } - @Test - @Description("Verifies that the target update event is published when a target has been updated") - void targetUpdateEventIsPublished() throws InterruptedException { + /** + * Verifies that the target update event is published when a target has been updated + */ + @Test void targetUpdateEventIsPublished() throws InterruptedException { final Target createdTarget = testdataFactory.createTarget("12345"); targetManagement.update(entityFactory.target().update(createdTarget.getControllerId()).name("updateName")); @@ -82,9 +83,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(targetUpdatedEvent)).isEqualTo(createdTarget.getId()); } - @Test - @Description("Verifies that the target deleted event is published when a target has been deleted") - void targetDeletedEventIsPublished() throws InterruptedException { + /** + * Verifies that the target deleted event is published when a target has been deleted + */ + @Test void targetDeletedEventIsPublished() throws InterruptedException { final Target createdTarget = testdataFactory.createTarget("12345"); targetManagement.deleteByControllerID("12345"); @@ -94,9 +96,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(targetDeletedEvent.getEntityId()).isEqualTo(createdTarget.getId()); } - @Test - @Description("Verifies that the target type created event is published when a target type has been created") - void targetTypeCreatedEventIsPublished() throws InterruptedException { + /** + * Verifies that the target type created event is published when a target type has been created + */ + @Test void targetTypeCreatedEventIsPublished() throws InterruptedException { final TargetType createdTargetType = testdataFactory.findOrCreateTargetType("targettype"); final TargetTypeCreatedEvent targetTypeCreatedEvent = eventListener.waitForEvent(TargetTypeCreatedEvent.class); @@ -104,9 +107,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(targetTypeCreatedEvent)).isEqualTo(createdTargetType.getId()); } - @Test - @Description("Verifies that the target type updated event is published when a target type has been updated") - void targetTypeUpdatedEventIsPublished() throws InterruptedException { + /** + * Verifies that the target type updated event is published when a target type has been updated + */ + @Test void targetTypeUpdatedEventIsPublished() throws InterruptedException { final TargetType createdTargetType = testdataFactory.findOrCreateTargetType("targettype"); targetTypeManagement .update(entityFactory.targetType().update(createdTargetType.getId()).name("updatedtargettype")); @@ -116,9 +120,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(targetTypeUpdatedEvent)).isEqualTo(createdTargetType.getId()); } - @Test - @Description("Verifies that the target type deleted event is published when a target type has been deleted") - void targetTypeDeletedEventIsPublished() throws InterruptedException { + /** + * Verifies that the target type deleted event is published when a target type has been deleted + */ + @Test void targetTypeDeletedEventIsPublished() throws InterruptedException { final TargetType createdTargetType = testdataFactory.findOrCreateTargetType("targettype"); targetTypeManagement.delete(createdTargetType.getId()); @@ -127,9 +132,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(targetTypeDeletedEvent.getEntityId()).isEqualTo(createdTargetType.getId()); } - @Test - @Description("Verifies that the rollout deleted event is published when a rollout has been deleted") - void rolloutDeletedEventIsPublished() throws InterruptedException { + /** + * Verifies that the rollout deleted event is published when a rollout has been deleted + */ + @Test void rolloutDeletedEventIsPublished() throws InterruptedException { final int amountTargetsForRollout = 50; final int amountGroups = 5; final String successCondition = "50"; @@ -150,9 +156,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(rolloutDeletedEvent.getEntityId()).isEqualTo(createdRollout.getId()); } - @Test - @Description("Verifies that the distribution set created event is published when a distribution set has been created") - void distributionSetCreatedEventIsPublished() throws InterruptedException { + /** + * Verifies that the distribution set created event is published when a distribution set has been created + */ + @Test void distributionSetCreatedEventIsPublished() throws InterruptedException { final DistributionSet createDistributionSet = testdataFactory.createDistributionSet(); final DistributionSetCreatedEvent dsCreatedEvent = eventListener @@ -161,9 +168,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(dsCreatedEvent)).isEqualTo(createDistributionSet.getId()); } - @Test - @Description("Verifies that the distribution set deleted event is published when a distribution set has been deleted") - void distributionSetDeletedEventIsPublished() throws InterruptedException { + /** + * Verifies that the distribution set deleted event is published when a distribution set has been deleted + */ + @Test void distributionSetDeletedEventIsPublished() throws InterruptedException { final DistributionSet createDistributionSet = testdataFactory.createDistributionSet(); distributionSetManagement.delete(createDistributionSet.getId()); @@ -174,9 +182,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(dsDeletedEvent.getEntityId()).isEqualTo(createDistributionSet.getId()); } - @Test - @Description("Verifies that the software module created event is published when a software module has been created") - void softwareModuleCreatedEventIsPublished() throws InterruptedException { + /** + * Verifies that the software module created event is published when a software module has been created + */ + @Test void softwareModuleCreatedEventIsPublished() throws InterruptedException { final SoftwareModule softwareModule = testdataFactory.createSoftwareModuleApp(); final SoftwareModuleCreatedEvent softwareModuleCreatedEvent = eventListener @@ -185,9 +194,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(softwareModuleCreatedEvent)).isEqualTo(softwareModule.getId()); } - @Test - @Description("Verifies that the software module update event is published when a software module has been updated") - void softwareModuleUpdateEventIsPublished() throws InterruptedException { + /** + * Verifies that the software module update event is published when a software module has been updated + */ + @Test void softwareModuleUpdateEventIsPublished() throws InterruptedException { final SoftwareModule softwareModule = testdataFactory.createSoftwareModuleApp(); softwareModuleManagement .update(entityFactory.softwareModule().update(softwareModule.getId()).description("New")); @@ -198,9 +208,10 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest { assertThat(getIdOfEntity(softwareModuleUpdatedEvent)).isEqualTo(softwareModule.getId()); } - @Test - @Description("Verifies that the software module deleted event is published when a software module has been deleted") - void softwareModuleDeletedEventIsPublished() throws InterruptedException { + /** + * Verifies that the software module deleted event is published when a software module has been deleted + */ + @Test void softwareModuleDeletedEventIsPublished() throws InterruptedException { final SoftwareModule softwareModule = testdataFactory.createSoftwareModuleApp(); softwareModuleManagement.delete(softwareModule.getId()); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ActionTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ActionTest.java index 9505a6e5b..95be12872 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ActionTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ActionTest.java @@ -14,9 +14,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.Duration; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.jpa.model.JpaAction; @@ -28,16 +25,19 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Repository") -@Story("Deployment Management") +/** + * Feature: Unit Tests - Repository
+ * Story: Deployment Management + */ class ActionTest extends AbstractJpaIntegrationTest { private Target target; private DistributionSet distributionSet; - @Test - @Description("Ensures that timeforced moded switch from soft to forces after defined timeframe.") - void timeForcedHitNewHasCodeIsGenerated() { + /** + * Ensures that timeforced moded switch from soft to forces after defined timeframe. + */ + @Test void timeForcedHitNewHasCodeIsGenerated() { // current time + 1 seconds final long sleepTime = 1000; final long timeForceTimeAt = System.currentTimeMillis() + sleepTime; @@ -50,9 +50,10 @@ class ActionTest extends AbstractJpaIntegrationTest { Awaitility.await().atMost(Duration.ofSeconds(2)).pollInterval(Duration.ofMillis(100)).until(timeforcedAction::isForcedOrTimeForced); } - @Test - @Description("Tests the action type mapping.") - void testActionTypeConvert() { + /** + * Tests the action type mapping. + */ + @Test void testActionTypeConvert() { final long id = createAction().getId(); for (final ActionType actionType : ActionType.values()) { final JpaAction action = actionRepository.findById(id).orElseThrow(() -> new IllegalStateException("Action not found")); @@ -63,9 +64,10 @@ class ActionTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Tests the status mapping.") - void testStatusConvert() { + /** + * Tests the status mapping. + */ + @Test void testStatusConvert() { final long id = createAction().getId(); for (final Status status : Status.values()) { final JpaAction action = actionRepository.findById(id).orElseThrow(() -> new IllegalStateException("Action not found")); @@ -76,9 +78,10 @@ class ActionTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Tests the action status status mapping.") - void testActionsStatusStatusConvert() { + /** + * Tests the action status status mapping. + */ + @Test void testActionsStatusStatusConvert() { for (final Status status : Status.values()) { final long id = createAction().getId(); controllerManagement.addUpdateActionStatus(entityFactory.actionStatus().create(id).status(status)); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementSecurityTest.java index e0e2dedae..8337f6170 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementSecurityTest.java @@ -12,87 +12,96 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.io.ByteArrayInputStream; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.ArtifactUpload; import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - ArtifactManagement") -@Story("SecurityTests ArtifactManagement") +/** + * Feature: SecurityTests - ArtifactManagement
+ * Story: SecurityTests ArtifactManagement + */ class ArtifactManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ArtifactManagement#count() method") - @WithUser(principal = "user", authorities = { SpPermission.READ_REPOSITORY }) + /** + * Tests ArtifactManagement#count() method + */ + @Test @WithUser(principal = "user", authorities = { SpPermission.READ_REPOSITORY }) void countPermissionCheck() { assertPermissions(() -> artifactManagement.count(), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#create() method") - void createPermissionCheck() { + /** + * Tests ArtifactManagement#create() method + */ + @Test void createPermissionCheck() { ArtifactUpload artifactUpload = new ArtifactUpload(new ByteArrayInputStream("RandomString".getBytes()), 1L, "filename", false, 1024); assertPermissions(() -> artifactManagement.create(artifactUpload), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#delete() method") - void deletePermissionCheck() { + /** + * Tests ArtifactManagement#delete() method + */ + @Test void deletePermissionCheck() { assertPermissions(() -> { artifactManagement.delete(1); return null; }, List.of(SpPermission.DELETE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#get() method") - void getPermissionCheck() { + /** + * Tests ArtifactManagement#get() method + */ + @Test void getPermissionCheck() { assertPermissions(() -> artifactManagement.get(1L), List.of(SpPermission.READ_REPOSITORY)); assertPermissions(() -> artifactManagement.get(1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#getByFilenameAndSoftwareModule() method") - void getByFilenameAndSoftwareModulePermissionCheck() { + /** + * Tests ArtifactManagement#getByFilenameAndSoftwareModule() method + */ + @Test void getByFilenameAndSoftwareModulePermissionCheck() { assertPermissions(() -> artifactManagement.getByFilenameAndSoftwareModule("filename", 1L), List.of(SpPermission.READ_REPOSITORY), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> artifactManagement.getByFilenameAndSoftwareModule("filename", 1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#findFirstBySHA1() method") - void findFirstBySHA1PermissionCheck() { + /** + * Tests ArtifactManagement#findFirstBySHA1() method + */ + @Test void findFirstBySHA1PermissionCheck() { assertPermissions(() -> artifactManagement.findFirstBySHA1("sha1"), List.of(SpPermission.READ_REPOSITORY)); assertPermissions(() -> artifactManagement.findFirstBySHA1("sha1"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#getByFilename() method") - void getByFilenamePermissionCheck() { + /** + * Tests ArtifactManagement#getByFilename() method + */ + @Test void getByFilenamePermissionCheck() { assertPermissions(() -> artifactManagement.getByFilename("filename"), List.of(SpPermission.READ_REPOSITORY)); assertPermissions(() -> artifactManagement.getByFilename("filename"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#findBySoftwareModule() method") - void findBySoftwareModulePermissionCheck() { + /** + * Tests ArtifactManagement#findBySoftwareModule() method + */ + @Test void findBySoftwareModulePermissionCheck() { assertPermissions(() -> artifactManagement.findBySoftwareModule(1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#countBySoftwareModule() method") - void countBySoftwareModulePermissionCheck() { + /** + * Tests ArtifactManagement#countBySoftwareModule() method + */ + @Test void countBySoftwareModulePermissionCheck() { assertPermissions(() -> artifactManagement.countBySoftwareModule(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ArtifactManagement#loadArtifactBinary() method") - void loadArtifactBinaryPermissionCheck() { + /** + * Tests ArtifactManagement#loadArtifactBinary() method + */ + @Test void loadArtifactBinaryPermissionCheck() { assertPermissions(() -> artifactManagement.loadArtifactBinary("sha1", 1L, false), List.of(SpPermission.DOWNLOAD_REPOSITORY_ARTIFACT), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> artifactManagement.loadArtifactBinary("sha1", 1L, false), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java index 16ce65614..7c51fbbd3 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java @@ -26,9 +26,6 @@ import java.util.concurrent.Callable; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.apache.commons.io.IOUtils; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; @@ -57,14 +54,16 @@ import org.junit.jupiter.api.Test; /** * Test class for {@link ArtifactManagement}. + *

+ * Feature: Component Tests - Repository
+ * Story: Artifact Management */ -@Feature("Component Tests - Repository") -@Story("Artifact Management") class ArtifactManagementTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verifies that management get access react as specfied on calls for non existing entities by means of Optional not present.") - @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) + /** + * Verifies that management get access react as specfied on calls for non existing entities by means of Optional not present. + */ + @Test @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) void nonExistingEntityAccessReturnsNotPresent() { final SoftwareModule module = testdataFactory.createSoftwareModuleOs(); @@ -75,9 +74,11 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactManagement.loadArtifactBinary(NOT_EXIST_ID, module.getId(), module.isEncrypted())).isEmpty(); } + /** + * Verifies that management queries react as specfied on calls for non existing entities by means of + * throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities by means of " + - "throwing EntityNotFoundException.") @ExpectEvents() void entityQueriesReferringToNotExistingEntitiesThrowsException() { final String artifactData = "test"; @@ -100,9 +101,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> artifactManagement.getByFilenameAndSoftwareModule("xxx", NOT_EXIST_IDL), "SoftwareModule"); } - @Test - @Description("Test if a local artifact can be created by API including metadata.") - void createArtifact() throws IOException { + /** + * Test if a local artifact can be created by API including metadata. + */ + @Test void createArtifact() throws IOException { // check baseline assertThat(softwareModuleRepository.findAll()).isEmpty(); assertThat(artifactRepository.findAll()).isEmpty(); @@ -143,9 +145,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verifies that artifact management does not create artifacts with illegal filename.") - void entityQueryWithIllegalFilenameThrowsException() { + /** + * Verifies that artifact management does not create artifacts with illegal filename. + */ + @Test void entityQueryWithIllegalFilenameThrowsException() { final String illegalFilename = ".xml"; final String artifactData = "test"; final int artifactSize = artifactData.length(); @@ -157,9 +160,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleManagement.get(smID).get().getArtifacts()).isEmpty(); } - @Test - @Description("Verifies that the quota specifying the maximum number of artifacts per software module is enforced.") - void createArtifactsUntilQuotaIsExceeded() throws IOException { + /** + * Verifies that the quota specifying the maximum number of artifacts per software module is enforced. + */ + @Test void createArtifactsUntilQuotaIsExceeded() throws IOException { // create a software module final long smId = softwareModuleRepository.save(new JpaSoftwareModule(osType, "sm1", "1.0")).getId(); @@ -186,9 +190,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactManagement.findBySoftwareModule(smId, PAGE).getTotalElements()).isEqualTo(maxArtifacts); } - @Test - @Description("Verifies that the quota specifying the maximum artifact storage is enforced (across software modules).") - void createArtifactsUntilStorageQuotaIsExceeded() throws IOException { + /** + * Verifies that the quota specifying the maximum artifact storage is enforced (across software modules). + */ + @Test void createArtifactsUntilStorageQuotaIsExceeded() throws IOException { // create as many small artifacts as possible w/o violating the storage quota final long maxBytes = quotaManagement.getMaxArtifactStorage(); final List artifactIds = new ArrayList<>(); @@ -213,9 +218,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { createArtifactForSoftwareModule("fileXYZ", smId, artifactSize); } - @Test - @Description("Verifies that you cannot create artifacts which exceed the configured maximum size.") - void createArtifactFailsIfTooLarge() { + /** + * Verifies that you cannot create artifacts which exceed the configured maximum size. + */ + @Test void createArtifactFailsIfTooLarge() { // create a software module final long smId = softwareModuleRepository.save(new JpaSoftwareModule(osType, "sm1", "1.0")).getId(); @@ -225,9 +231,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> createArtifactForSoftwareModule("file", smId, artifactSize)); } - @Test - @Description("Tests hard delete directly on repository.") - void hardDeleteSoftwareModule() throws IOException { + /** + * Tests hard delete directly on repository. + */ + @Test void hardDeleteSoftwareModule() throws IOException { final JpaSoftwareModule sm = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 1", "version 1")); createArtifactForSoftwareModule("file1", sm.getId(), 5 * 1024); @@ -240,9 +247,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { /** * Test method for {@link org.eclipse.hawkbit.repository.ArtifactManagement#delete(long)}. */ - @Test - @Description("Tests the deletion of a local artifact including metadata.") - void deleteArtifact() throws IOException { + /** + * Tests the deletion of a local artifact including metadata. + */ + @Test void deleteArtifact() throws IOException { final JpaSoftwareModule sm = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 1", "version 1")); final JpaSoftwareModule sm2 = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 2", "version 2")); @@ -277,9 +285,11 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } + /** + * Test the deletion of an artifact metadata where the binary is still linked to another metadata element. + * The expected result is that the metadata is deleted but the binary kept. + */ @Test - @Description("Test the deletion of an artifact metadata where the binary is still linked to another metadata element. " + - "The expected result is that the metadata is deleted but the binary kept.") void deleteDuplicateArtifacts() throws IOException { final JpaSoftwareModule sm = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 1", "version 1")); final JpaSoftwareModule sm2 = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 2", "version 2")); @@ -309,9 +319,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verifies that you cannot delete an artifact which exists with the same hash, in the same tenant and the SoftwareModule is not deleted .") - void deleteArtifactWithSameHashAndSoftwareModuleIsNotDeletedInSameTenants() throws IOException { + /** + * Verifies that you cannot delete an artifact which exists with the same hash, in the same tenant and the SoftwareModule is not deleted . + */ + @Test void deleteArtifactWithSameHashAndSoftwareModuleIsNotDeletedInSameTenants() throws IOException { final JpaSoftwareModule sm = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 1", "version 1")); final JpaSoftwareModule sm2 = softwareModuleRepository.save(new JpaSoftwareModule(osType, "name 2", "version 2")); @@ -346,9 +357,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verifies that you can not delete artifacts from another tenant which exists in another tenant with the same hash and the SoftwareModule is not deleted") - void deleteArtifactWithSameHashAndSoftwareModuleIsNotDeletedInDifferentTenants() throws Exception { + /** + * Verifies that you can not delete artifacts from another tenant which exists in another tenant with the same hash and the SoftwareModule is not deleted + */ + @Test void deleteArtifactWithSameHashAndSoftwareModuleIsNotDeletedInDifferentTenants() throws Exception { final String tenant1 = "mytenant"; final String tenant2 = "tenant2"; @@ -373,9 +385,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { verifyTenantArtifactCountIs(tenant2, 1); } - @Test - @Description("Loads an local artifact based on given ID.") - void findArtifact() throws IOException { + /** + * Loads an local artifact based on given ID. + */ + @Test void findArtifact() throws IOException { final int artifactSize = 5 * 1024; try (final InputStream inputStream = new RandomGeneratedInputStream(artifactSize)) { final Artifact artifact = createArtifactForSoftwareModule( @@ -384,9 +397,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Loads an artifact binary based on given ID.") - void loadStreamOfArtifact() throws IOException { + /** + * Loads an artifact binary based on given ID. + */ + @Test void loadStreamOfArtifact() throws IOException { final int artifactSize = 5 * 1024; final byte[] randomBytes = randomBytes(artifactSize); try (final InputStream input = new ByteArrayInputStream(randomBytes)) { @@ -397,18 +411,21 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } + /** + * Trys and fails to load an artifact without required permission. Checks if expected InsufficientPermissionException is thrown. + */ @Test @WithUser(allSpPermissions = true, removeFromAllPermission = { SpPermission.DOWNLOAD_REPOSITORY_ARTIFACT }) - @Description("Trys and fails to load an artifact without required permission. Checks if expected InsufficientPermissionException is thrown.") void loadArtifactBinaryWithoutDownloadArtifactThrowsPermissionDenied() { assertThatExceptionOfType(InsufficientPermissionException.class) .as("Should not have worked with missing permission.") .isThrownBy(() -> artifactManagement.loadArtifactBinary("123", 1, false)); } - @Test - @Description("Searches an artifact through the relations of a software module.") - void findArtifactBySoftwareModule() throws IOException { + /** + * Searches an artifact through the relations of a software module. + */ + @Test void findArtifactBySoftwareModule() throws IOException { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); assertThat(artifactManagement.findBySoftwareModule(sm.getId(), PAGE)).isEmpty(); @@ -419,9 +436,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Searches an artifact through the relations of a software module and the filename.") - void findByFilenameAndSoftwareModule() throws IOException { + /** + * Searches an artifact through the relations of a software module and the filename. + */ + @Test void findByFilenameAndSoftwareModule() throws IOException { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); assertThat(artifactManagement.getByFilenameAndSoftwareModule("file1", sm.getId())).isNotPresent(); @@ -435,9 +453,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verifies that creation of an artifact with none matching hashes fails.") - void createArtifactWithNoneMatchingHashes() throws IOException, NoSuchAlgorithmException { + /** + * Verifies that creation of an artifact with none matching hashes fails. + */ + @Test void createArtifactWithNoneMatchingHashes() throws IOException, NoSuchAlgorithmException { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final byte[] testData = randomBytes(100); @@ -468,9 +487,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verifies that creation of an artifact with matching hashes works.") - void createArtifactWithMatchingHashes() throws IOException, NoSuchAlgorithmException { + /** + * Verifies that creation of an artifact with matching hashes works. + */ + @Test void createArtifactWithMatchingHashes() throws IOException, NoSuchAlgorithmException { final SoftwareModule sm = testdataFactory.createSoftwareModuleOs(); final byte[] testData = randomBytes(100); @@ -490,9 +510,10 @@ class ArtifactManagementTest extends AbstractJpaIntegrationTest { assertThat(dbArtifact).isPresent(); } - @Test - @Description("Verifies that creation of an existing artifact returns a full hash list.") - void createExistingArtifactReturnsFullHashList() throws IOException, NoSuchAlgorithmException { + /** + * Verifies that creation of an existing artifact returns a full hash list. + */ + @Test void createExistingArtifactReturnsFullHashList() throws IOException, NoSuchAlgorithmException { final SoftwareModule smOs = testdataFactory.createSoftwareModuleOs(); final SoftwareModule smApp = testdataFactory.createSoftwareModuleApp(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementSecurityTest.java index 44f4327ff..cb0466308 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementSecurityTest.java @@ -11,55 +11,60 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - ConfirmationManagement") -@Story("SecurityTests ConfirmationManagement") +/** + * Feature: SecurityTests - ConfirmationManagement
+ * Story: SecurityTests ConfirmationManagement + */ class ConfirmationManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ConfirmationManagement#findActiveActionsWaitingConfirmation() method") - void findActiveActionsWaitingConfirmationPermissionsCheck() { + /** + * Tests ConfirmationManagement#findActiveActionsWaitingConfirmation() method + */ + @Test void findActiveActionsWaitingConfirmationPermissionsCheck() { assertPermissions(() -> confirmationManagement.findActiveActionsWaitingConfirmation("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ConfirmationManagement#activateAutoConfirmation() method") - void activateAutoConfirmationPermissionsCheck() { + /** + * Tests ConfirmationManagement#activateAutoConfirmation() method + */ + @Test void activateAutoConfirmationPermissionsCheck() { assertPermissions(() -> confirmationManagement.activateAutoConfirmation("controllerId", "initiator", "remark"), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ConfirmationManagement#getStatus() method") - void getStatusPermissionsCheck() { + /** + * Tests ConfirmationManagement#getStatus() method + */ + @Test void getStatusPermissionsCheck() { assertPermissions(() -> confirmationManagement.getStatus("controllerId"), List.of(SpPermission.READ_TARGET), List.of(SpPermission.CREATE_TARGET)); assertPermissions(() -> confirmationManagement.getStatus("controllerId"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ConfirmationManagement#confirmAction() method") - void confirmActionPermissionsCheck() { + /** + * Tests ConfirmationManagement#confirmAction() method + */ + @Test void confirmActionPermissionsCheck() { assertPermissions(() -> confirmationManagement.confirmAction(1L, null, null), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ConfirmationManagement#denyAction() method") - void denyActionPermissionsCheck() { + /** + * Tests ConfirmationManagement#denyAction() method + */ + @Test void denyActionPermissionsCheck() { assertPermissions(() -> confirmationManagement.denyAction(1L, null, null), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ConfirmationManagement#deactivateAutoConfirmation() method") - void deactivateAutoConfirmationPermissionsCheck() { + /** + * Tests ConfirmationManagement#deactivateAutoConfirmation() method + */ + @Test void deactivateAutoConfirmationPermissionsCheck() { assertPermissions(() -> { confirmationManagement.deactivateAutoConfirmation("controllerId"); return null; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementTest.java index 37ff2c950..572994c67 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ConfirmationManagementTest.java @@ -18,9 +18,6 @@ import java.util.List; import java.util.Objects; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.AutoConfirmationAlreadyActiveException; import org.eclipse.hawkbit.repository.exception.InvalidConfirmationFeedbackException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -38,14 +35,16 @@ import org.junit.jupiter.params.provider.MethodSource; /** * Test class testing the functionality of triggering a deployment of * {@link DistributionSet}s to {@link Target}s with AutoConfirmation active. + *

+ * Feature: Component Tests - Repository
+ * Story: Confirmation Management */ -@Feature("Component Tests - Repository") -@Story("Confirmation Management") class ConfirmationManagementTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verify 'findActiveActionsWaitingConfirmation' method is filtering like expected") - void retrieveActionsWithConfirmationState() { + /** + * Verify 'findActiveActionsWaitingConfirmation' method is filtering like expected + */ + @Test void retrieveActionsWithConfirmationState() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -65,9 +64,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getStatus() == Status.WAIT_FOR_CONFIRMATION); } - @Test - @Description("Verify 'findActiveActionsWaitingConfirmation' method is filtering like expected with multi assignment active") - void retrieveActionsWithConfirmationStateInMultiAssignment() { + /** + * Verify 'findActiveActionsWaitingConfirmation' method is filtering like expected with multi assignment active + */ + @Test void retrieveActionsWithConfirmationStateInMultiAssignment() { enableMultiAssignments(); enableConfirmationFlow(); @@ -94,9 +94,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify confirming an action will put it to the running state") - void confirmedActionWillSwitchToRunningState() { + /** + * Verify confirming an action will put it to the running state + */ + @Test void confirmedActionWillSwitchToRunningState() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -122,9 +123,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .anyMatch(status -> status.getStatus() == Status.RUNNING); } - @Test - @Description("Verify confirming an confirmed action will lead to a specific failure") - void confirmedActionCannotBeConfirmedAgain() { + /** + * Verify confirming an confirmed action will lead to a specific failure + */ + @Test void confirmedActionCannotBeConfirmedAgain() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -143,9 +145,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .getReason() == InvalidConfirmationFeedbackException.Reason.NOT_AWAITING_CONFIRMATION); } - @Test - @Description("Verify confirming a closed action will lead to a specific failure") - void confirmedActionCannotBeGivenOnFinishedAction() { + /** + * Verify confirming a closed action will lead to a specific failure + */ + @Test void confirmedActionCannotBeGivenOnFinishedAction() { enableConfirmationFlow(); final Long actionId = prepareFinishedUpdate().getId(); assertThatThrownBy(() -> confirmationManagement.confirmAction(actionId, null, null)) @@ -154,9 +157,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .getReason() == InvalidConfirmationFeedbackException.Reason.ACTION_CLOSED); } - @Test - @Description("Verify denying an action will leave it in WFC state") - void deniedActionWillStayInWfcState() { + /** + * Verify denying an action will leave it in WFC state + */ + @Test void deniedActionWillStayInWfcState() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -182,9 +186,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .noneMatch(status -> status.getStatus() == Status.RUNNING); } - @Test - @Description("Verify multiple actions in WFC state will be transferred in RUNNING state in case auto-confirmation is activated.") - void activateAutoConfirmationInMultiAssignment() { + /** + * Verify multiple actions in WFC state will be transferred in RUNNING state in case auto-confirmation is activated. + */ + @Test void activateAutoConfirmationInMultiAssignment() { enableMultiAssignments(); enableConfirmationFlow(); @@ -208,9 +213,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getStatus() == Status.RUNNING); } - @Test - @Description("Verify action in WFC state will be transferred in RUNNING state in case auto-confirmation is activated.") - void activateAutoConfirmationOnActiveAction() { + /** + * Verify action in WFC state will be transferred in RUNNING state in case auto-confirmation is activated. + */ + @Test void activateAutoConfirmationOnActiveAction() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -230,9 +236,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getStatus() == Status.RUNNING); } - @Test - @Description("Verify created action after activating auto confirmation is directly in running state.") - void activateAutoConfirmationAndCreateAction() { + /** + * Verify created action after activating auto confirmation is directly in running state. + */ + @Test void activateAutoConfirmationAndCreateAction() { enableConfirmationFlow(); final String controllerId = testdataFactory.createTarget().getControllerId(); @@ -251,9 +258,11 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getStatus() == Status.RUNNING); } + /** + * Verify activating auto confirmation with different parameters + */ @ParameterizedTest @MethodSource("getAutoConfirmationArguments") - @Description("Verify activating auto confirmation with different parameters") void verifyAutoConfirmationActivationValues(final String initiator, final String remark) { final String controllerId = testdataFactory.createTarget().getControllerId(); confirmationManagement.activateAutoConfirmation(controllerId, initiator, remark); @@ -272,9 +281,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { verifyAutoConfirmationIsDisabled(controllerId); } - @Test - @Description("Verify activating already active auto confirmation will throw exception.") - void verifyActivateAlreadyActiveAutoConfirmationThrowException() { + /** + * Verify activating already active auto confirmation will throw exception. + */ + @Test void verifyActivateAlreadyActiveAutoConfirmationThrowException() { final String controllerId = testdataFactory.createTarget().getControllerId(); confirmationManagement.activateAutoConfirmation(controllerId, "any", "any"); @@ -285,9 +295,10 @@ class ConfirmationManagementTest extends AbstractJpaIntegrationTest { .hasMessage("Auto confirmation is already active for device " + controllerId); } - @Test - @Description("Verify disabling already disabled auto confirmation will not have any affect.") - void disableAlreadyDisabledAutoConfirmationHaveNoAffect() { + /** + * Verify disabling already disabled auto confirmation will not have any affect. + */ + @Test void disableAlreadyDisabledAutoConfirmationHaveNoAffect() { final String controllerId = testdataFactory.createTarget().getControllerId(); verifyAutoConfirmationIsDisabled(controllerId); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementSecurityTest.java index 07c63dab2..93fa0f8ec 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementSecurityTest.java @@ -13,9 +13,6 @@ import java.net.URI; import java.util.List; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.exception.CancelActionNotAllowedException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -24,115 +21,133 @@ import org.eclipse.hawkbit.repository.model.Target; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Pageable; -@Feature("SecurityTests - ControllerManagement") -@Story("SecurityTests ControllerManagement") +/** + * Feature: SecurityTests - ControllerManagement
+ * Story: SecurityTests ControllerManagement + */ class ControllerManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ControllerManagement#cancelActionStatus() method") - void addCancelActionStatusPermissionsCheck() { + /** + * Tests ControllerManagement#cancelActionStatus() method + */ + @Test void addCancelActionStatusPermissionsCheck() { assertPermissions(() -> controllerManagement.addCancelActionStatus(entityFactory.actionStatus().create(0L)), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getSoftwareModule() method") - void getSoftwareModulePermissionsCheck() { + /** + * Tests ControllerManagement#getSoftwareModule() method + */ + @Test void getSoftwareModulePermissionsCheck() { assertPermissions(() -> controllerManagement.getSoftwareModule(1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findTargetVisibleMetaDataBySoftwareModuleId() method") - void findTargetVisibleMetaDataBySoftwareModuleIdPermissionsCheck() { + /** + * Tests ControllerManagement#findTargetVisibleMetaDataBySoftwareModuleId() method + */ + @Test void findTargetVisibleMetaDataBySoftwareModuleIdPermissionsCheck() { assertPermissions(() -> controllerManagement.findTargetVisibleMetaDataBySoftwareModuleId(List.of(1L)), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#addInformationalActionStatus() method") - void addInformationalActionStatusPermissionsCheck() { + /** + * Tests ControllerManagement#addInformationalActionStatus() method + */ + @Test void addInformationalActionStatusPermissionsCheck() { assertPermissions(() -> controllerManagement.addInformationalActionStatus(entityFactory.actionStatus().create(0L)), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#addUpdateActionStatus() method") - void addUpdateActionStatusPermissionsCheck() { + /** + * Tests ControllerManagement#addUpdateActionStatus() method + */ + @Test void addUpdateActionStatusPermissionsCheck() { assertPermissions(() -> controllerManagement.addUpdateActionStatus(entityFactory.actionStatus().create(0L)), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findActiveActionWithHighestWeight() method") - void findActiveActionWithHighestWeightPermissionsCheck() { + /** + * Tests ControllerManagement#findActiveActionWithHighestWeight() method + */ + @Test void findActiveActionWithHighestWeightPermissionsCheck() { assertPermissions(() -> controllerManagement.findActiveActionWithHighestWeight("controllerId"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findActiveActionsWithHighestWeight() method") - void findActiveActionsWithHighestWeightPermissionsCheck() { + /** + * Tests ControllerManagement#findActiveActionsWithHighestWeight() method + */ + @Test void findActiveActionsWithHighestWeightPermissionsCheck() { assertPermissions(() -> controllerManagement.findActiveActionsWithHighestWeight("controllerId", 1), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findActionWithDetails() method") - void findActionWithDetailsPermissionsCheck() { + /** + * Tests ControllerManagement#findActionWithDetails() method + */ + @Test void findActionWithDetailsPermissionsCheck() { assertPermissions(() -> controllerManagement.findActionWithDetails(1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findActionStatusByAction() method") - void findActionStatusByActionPermissionsCheck() { + /** + * Tests ControllerManagement#findActionStatusByAction() method + */ + @Test void findActionStatusByActionPermissionsCheck() { assertPermissions(() -> controllerManagement.findActionStatusByAction(1L, Pageable.unpaged()), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findOrRegisterTargetIfItDoesNotExist() method") - void findOrRegisterTargetIfItDoesNotExistPermissionsCheck() { + /** + * Tests ControllerManagement#findOrRegisterTargetIfItDoesNotExist() method + */ + @Test void findOrRegisterTargetIfItDoesNotExistPermissionsCheck() { assertPermissions(() -> controllerManagement.findOrRegisterTargetIfItDoesNotExist("controllerId", URI.create("someaddress")), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#findOrRegisterTargetIfItDoesNotExist() method") - void findOrRegisterTargetIfItDoesNotExistWithDetailsPermissionsCheck() { + /** + * Tests ControllerManagement#findOrRegisterTargetIfItDoesNotExist() method + */ + @Test void findOrRegisterTargetIfItDoesNotExistWithDetailsPermissionsCheck() { assertPermissions( () -> controllerManagement.findOrRegisterTargetIfItDoesNotExist("controllerId", URI.create("someaddress"), "name", "type"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getActionForDownloadByTargetAndSoftwareModule() method") - void getActionForDownloadByTargetAndSoftwareModulePermissionsCheck() { + /** + * Tests ControllerManagement#getActionForDownloadByTargetAndSoftwareModule() method + */ + @Test void getActionForDownloadByTargetAndSoftwareModulePermissionsCheck() { assertPermissions(() -> controllerManagement.getActionForDownloadByTargetAndSoftwareModule("controllerId", 1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getPollingTime() method") - void getPollingTimePermissionsCheck() { + /** + * Tests ControllerManagement#getPollingTime() method + */ + @Test void getPollingTimePermissionsCheck() { assertPermissions(() -> controllerManagement.getPollingTime(), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getMinPollingTime() method") - void getMinPollingTimePermissionsCheck() { + /** + * Tests ControllerManagement#getMinPollingTime() method + */ + @Test void getMinPollingTimePermissionsCheck() { assertPermissions(() -> controllerManagement.getMinPollingTime(), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getMaxPollingTime() method") - void getMaintenanceWindowPollCountPermissionsCheck() { + /** + * Tests ControllerManagement#getMaxPollingTime() method + */ + @Test void getMaintenanceWindowPollCountPermissionsCheck() { assertPermissions(() -> controllerManagement.getMaintenanceWindowPollCount(), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getPollingTimeForAction() method") - void getPollingTimeForActionPermissionsCheck() { + /** + * Tests ControllerManagement#getPollingTimeForAction() method + */ + @Test void getPollingTimeForActionPermissionsCheck() { final JpaAction action = new JpaAction(); action.setId(1L); assertPermissions(() -> { @@ -145,53 +160,60 @@ class ControllerManagementSecurityTest extends AbstractJpaIntegrationTest { }, List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#hasTargetArtifactAssigned() method") - void hasTargetArtifactAssignedPermissionsCheck() { + /** + * Tests ControllerManagement#hasTargetArtifactAssigned() method + */ + @Test void hasTargetArtifactAssignedPermissionsCheck() { assertPermissions(() -> controllerManagement.hasTargetArtifactAssigned("controllerId", "sha1Hash"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#hasTargetArtifactAssigned() method") - void hasTargetArtifactAssignedByIdPermissionsCheck() { + /** + * Tests ControllerManagement#hasTargetArtifactAssigned() method + */ + @Test void hasTargetArtifactAssignedByIdPermissionsCheck() { assertPermissions(() -> controllerManagement.hasTargetArtifactAssigned(1L, "sha1Hash"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#updateControllerAttributes() method") - void updateControllerAttributesPermissionsCheck() { + /** + * Tests ControllerManagement#updateControllerAttributes() method + */ + @Test void updateControllerAttributesPermissionsCheck() { assertPermissions(() -> controllerManagement.updateControllerAttributes("controllerId", Map.of(), null), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getByControllerId() method") - void getByControllerIdPermissionsCheck() { + /** + * Tests ControllerManagement#getByControllerId() method + */ + @Test void getByControllerIdPermissionsCheck() { assertPermissions(() -> controllerManagement.getByControllerId("controllerId"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); assertPermissions(() -> controllerManagement.getByControllerId("controllerId"), List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ControllerManagement#get() method") - void getPermissionsCheck() { + /** + * Tests ControllerManagement#get() method + */ + @Test void getPermissionsCheck() { assertPermissions(() -> controllerManagement.get(1L), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); assertPermissions(() -> controllerManagement.get(1L), List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ControllerManagement#getActionHistoryMessages() method") - void getActionHistoryMessagesPermissionsCheck() { + /** + * Tests ControllerManagement#getActionHistoryMessages() method + */ + @Test void getActionHistoryMessagesPermissionsCheck() { assertPermissions(() -> controllerManagement.getActionHistoryMessages(1L, 1), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#cancelAction() method") - void cancelActionPermissionsCheck() { + /** + * Tests ControllerManagement#cancelAction() method + */ + @Test void cancelActionPermissionsCheck() { final JpaAction action = new JpaAction(); action.setId(1L); assertPermissions(() -> { @@ -204,60 +226,67 @@ class ControllerManagementSecurityTest extends AbstractJpaIntegrationTest { }, List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#updateActionExternalRef() method") - void updateActionExternalRefPermissionsCheck() { + /** + * Tests ControllerManagement#updateActionExternalRef() method + */ + @Test void updateActionExternalRefPermissionsCheck() { assertPermissions(() -> { controllerManagement.updateActionExternalRef(1L, "externalRef"); return null; }, List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getActionByExternalRef() method") - void getActionByExternalRefPermissionsCheck() { + /** + * Tests ControllerManagement#getActionByExternalRef() method + */ + @Test void getActionByExternalRefPermissionsCheck() { assertPermissions(() -> controllerManagement.getActionByExternalRef("externalRef"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#deleteExistingTarget() method") - void deleteExistingTargetPermissionsCheck() { + /** + * Tests ControllerManagement#deleteExistingTarget() method + */ + @Test void deleteExistingTargetPermissionsCheck() { assertPermissions(() -> { controllerManagement.deleteExistingTarget("controllerId"); return null; }, List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#getInstalledActionByTarget() method") - void getInstalledActionByTargetPermissionsCheck() { + /** + * Tests ControllerManagement#getInstalledActionByTarget() method + */ + @Test void getInstalledActionByTargetPermissionsCheck() { final Target target = testdataFactory.createTarget(); assertPermissions( () -> controllerManagement.getInstalledActionByTarget(target), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#activateAutoConfirmation() method") - void activateAutoConfirmationPermissionsCheck() { + /** + * Tests ControllerManagement#activateAutoConfirmation() method + */ + @Test void activateAutoConfirmationPermissionsCheck() { assertPermissions( () -> controllerManagement.activateAutoConfirmation("controllerId", "initiator", "remark"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#deactivateAutoConfirmation() method") - void deactivateAutoConfirmationPermissionsCheck() { + /** + * Tests ControllerManagement#deactivateAutoConfirmation() method + */ + @Test void deactivateAutoConfirmationPermissionsCheck() { assertPermissions(() -> { controllerManagement.deactivateAutoConfirmation("controllerId"); return null; }, List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } - @Test - @Description("Tests ControllerManagement#updateOfflineAssignedVersion() method") - void updateOfflineAssignedVersionPermissionsCheck() { + /** + * Tests ControllerManagement#updateOfflineAssignedVersion() method + */ + @Test void updateOfflineAssignedVersionPermissionsCheck() { assertPermissions(() -> controllerManagement.updateOfflineAssignedVersion("controllerId", "distributionName", "version"), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE)); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementTest.java index a1ab1311d..3f3b76df9 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ControllerManagementTest.java @@ -35,10 +35,6 @@ import java.util.stream.IntStream; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.assertj.core.api.Assertions; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryProperties; @@ -89,16 +85,19 @@ import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.ConcurrencyFailureException; -@Feature("Component Tests - Repository") -@Story("Controller Management") +/** + * Feature: Component Tests - Repository
+ * Story: Controller Management + */ class ControllerManagementTest extends AbstractJpaIntegrationTest { @Autowired private RepositoryProperties repositoryProperties; - @Test - @Description("Ensures that target attribute update fails if quota hits.") - @ExpectEvents({ + /** + * Ensures that target attribute update fails if quota hits. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 2) }) void updateTargetAttributesFailsIfTooManyEntries() throws Exception { @@ -135,9 +134,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Checks if invalid values of attribute-key and attribute-value are handled correctly") - void updateTargetAttributesFailsForInvalidAttributes() { + /** + * Checks if invalid values of attribute-key and attribute-value are handled correctly + */ + @Test void updateTargetAttributesFailsForInvalidAttributes() { final String controllerId = "targetId123"; testdataFactory.createTarget(controllerId); @@ -165,9 +165,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> controllerManagement.updateControllerAttributes(controllerId, attributesNV, null)); } - @Test - @Description("Controller providing status entries fails if providing more than permitted by quota.") - @ExpectEvents({ + /** + * Controller providing status entries fails if providing more than permitted by quota. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -190,9 +191,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Test to verify the storage and retrieval of action history.") - void findMessagesByActionStatusId() { + /** + * Test to verify the storage and retrieval of action history. + */ + @Test void findMessagesByActionStatusId() { final DistributionSet testDs = testdataFactory.createDistributionSet("1"); final List testTarget = testdataFactory.createTargets(1); @@ -215,9 +217,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(messages.get(1)).as("Message of action-status").isEqualTo("proceeding message 1"); } - @Test - @Description("Verifies that the quota specifying the maximum number of status entries per action is enforced.") - @ExpectEvents({ + /** + * Verifies that the quota specifying the maximum number of status entries per action is enforced. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = DistributionSetCreatedEvent.class, count = 2), @Expect(type = SoftwareModuleCreatedEvent.class, count = 6), @@ -253,9 +256,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> controllerManagement.addInformationalActionStatus(statusWarning)); } - @Test - @Description("Verifies that the quota specifying the maximum number of messages per action status is enforced.") - @ExpectEvents({ + /** + * Verifies that the quota specifying the maximum number of messages per action status is enforced. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -283,9 +287,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> controllerManagement.addInformationalActionStatus(statusToManyMessages)); } - @Test - @Description("Verifies that a DOWNLOAD_ONLY action is not marked complete when the controller reports DOWNLOAD") - @ExpectEvents({ + /** + * Verifies that a DOWNLOAD_ONLY action is not marked complete when the controller reports DOWNLOAD + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -308,9 +313,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(activeActionExistsForControllerId(DEFAULT_CONTROLLER_ID)).isTrue(); } + /** + * Verifies that management get access react as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access react as specified on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) @@ -330,9 +337,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.hasTargetArtifactAssigned(target.getId(), "XXX")).isFalse(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) @@ -368,9 +377,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { () -> controllerManagement.updateControllerAttributes(NOT_EXIST_ID, new HashMap<>(), null), "Target"); } - @Test - @Description("Controller confirms successful update with FINISHED status.") - @ExpectEvents({ + /** + * Controller confirms successful update with FINISHED status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -395,9 +405,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(7); } - @Test - @Description("Controller confirmation fails with invalid messages.") - @ExpectEvents({ + /** + * Controller confirmation fails with invalid messages. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -427,9 +438,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(6); } + /** + * Controller confirms successful update with FINISHED status on a action that is on canceling. + * Reason: The decision to ignore the cancellation is in fact up to the controller. + */ @Test - @Description("Controller confirms successful update with FINISHED status on a action that is on canceling. " - + "Reason: The decision to ignore the cancellation is in fact up to the controller.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -455,9 +468,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(3); } - @Test - @Description("Update server rejects cancellation feedback if action is not in CANCELING state.") - @ExpectEvents({ + /** + * Update server rejects cancellation feedback if action is not in CANCELING state. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -480,9 +494,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(1); } - @Test - @Description("Controller confirms action cancellation with FINISHED status.") - @ExpectEvents({ + /** + * Controller confirms action cancellation with FINISHED status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -511,9 +526,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(8); } - @Test - @Description("Controller confirms action cancellation with FINISHED status.") - @ExpectEvents({ + /** + * Controller confirms action cancellation with FINISHED status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -542,9 +558,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(8); } + /** + * Controller rejects action cancellation with CANCEL_REJECTED status. Action goes back to RUNNING status as it expects + * that the controller will continue the original update. + */ @Test - @Description("Controller rejects action cancellation with CANCEL_REJECTED status. Action goes back to RUNNING status as it expects " - + "that the controller will continue the original update.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -574,9 +592,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(8); } + /** + * Controller rejects action cancellation with ERROR status. Action goes back to RUNNING status as it expects + * that the controller will continue the original update. + */ @Test - @Description("Controller rejects action cancellation with ERROR status. Action goes back to RUNNING status as it expects " - + "that the controller will continue the original update.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -606,9 +626,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(8); } + /** + * Verifies that assignment verification works based on SHA1 hash. By design it is not important which artifact + * is actually used for the check as long as they have an identical binary, i.e. same SHA1 hash. + */ @Test - @Description("Verifies that assignment verification works based on SHA1 hash. By design it is not important which artifact " - + "is actually used for the check as long as they have an identical binary, i.e. same SHA1 hash. ") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 2), @@ -645,9 +667,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isTrue(); } - @Test - @Description("Register a controller which does not exist") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) }) @@ -660,9 +683,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registered").isEqualTo(1L); } - @Test - @Description("Register a controller with name which does not exist and update its name") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller with name which does not exist and update its name + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2), @@ -677,9 +701,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Register a controller which does not exist with existing target type and update its target type to another existing one") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist with existing target type and update its target type to another existing one + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class, count = 2), @Expect(type = TargetCreatedEvent.class, count = 1), @@ -700,9 +725,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Register a controller which does not exist with existing target type and update its target type to non existing one") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist with existing target type and update its target type to non existing one + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 1), @@ -719,9 +745,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Register a controller which does not exist with existing target type and unassign its target type") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist with existing target type and unassign its target type + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 1), @@ -739,9 +766,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Register a controller which does not exist without target type and update its target type to existing one") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist without target type and update its target type to existing one + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 1), @@ -761,9 +789,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Register a controller which does not exist with non existing target type and update its target type to existing one") - @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) + /** + * Register a controller which does not exist with non existing target type and update its target type to existing one + */ + @Test @WithUser(principal = "controller", authorities = { CONTROLLER_ROLE }) @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 1), @@ -783,9 +812,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("Only 1 target should be registred").isEqualTo(1L); } - @Test - @Description("Tries to register a target with an invalid controller id") - void findOrRegisterTargetIfItDoesNotExistThrowsExceptionForInvalidControllerIdParam() { + /** + * Tries to register a target with an invalid controller id + */ + @Test void findOrRegisterTargetIfItDoesNotExistThrowsExceptionForInvalidControllerIdParam() { assertThatExceptionOfType(ConstraintViolationException.class) .as("register target with null as controllerId should fail") .isThrownBy(() -> controllerManagement.findOrRegisterTargetIfItDoesNotExist(null, LOCALHOST)); @@ -805,9 +835,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { controllerId, LOCALHOST)); } + /** + * Register a controller which does not exist, when a ConcurrencyFailureException is raised, the + * exception is rethrown after max retries + */ @Test - @Description("Register a controller which does not exist, when a ConcurrencyFailureException is raised, the " - + "exception is rethrown after max retries") void findOrRegisterTargetIfItDoesNotExistThrowsExceptionAfterMaxRetries() { final TargetRepository mockTargetRepository = Mockito.mock(TargetRepository.class); when(mockTargetRepository.findOne(any())).thenThrow(ConcurrencyFailureException.class); @@ -825,9 +857,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } + /** + * Register a controller which does not exist, when a ConcurrencyFailureException is raised, the + * exception is not rethrown when the max retries are not yet reached + */ @Test - @Description("Register a controller which does not exist, when a ConcurrencyFailureException is raised, the " - + "exception is not rethrown when the max retries are not yet reached") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) }) @@ -853,9 +887,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Register a controller which does not exist, then update the controller twice, first time by providing a name property and second time without a new name") - @ExpectEvents({ + /** + * Register a controller which does not exist, then update the controller twice, first time by providing a name property and second time without a new name + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 3), @Expect(type = TargetUpdatedEvent.class, count = 1) }) @@ -875,9 +910,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(secondTimeUpdatedTarget.getName()).isEqualTo(targetName); } + /** + * Register a controller which does not exist, if a EntityAlreadyExistsException is raised, the + * exception is rethrown and no further retries will be attempted + */ @Test - @Description("Register a controller which does not exist, if a EntityAlreadyExistsException is raised, the " - + "exception is rethrown and no further retries will be attempted") void findOrRegisterTargetIfItDoesNotExistDoesntRetryWhenEntityAlreadyExistsException() { final TargetRepository mockTargetRepository = Mockito.mock(TargetRepository.class); @@ -898,9 +935,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } + /** + * Retry is aborted when an unchecked exception is thrown and the exception should also be + * rethrown + */ @Test - @Description("Retry is aborted when an unchecked exception is thrown and the exception should also be " - + "rethrown") void recoverFindOrRegisterTargetIfItDoesNotExistIsNotInvokedForOtherExceptions() { final TargetRepository mockTargetRepository = Mockito.mock(TargetRepository.class); @@ -919,9 +958,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verify that targetVisible metadata is returned from repository") - @ExpectEvents({ + /** + * Verify that targetVisible metadata is returned from repository + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @Expect(type = SoftwareModuleUpdatedEvent.class, count = 6) }) @@ -936,9 +976,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { result.forEach((key, value) -> assertThat(value).hasSize(1)); } - @Test - @Description("Verify that controller registration does not result in a TargetPollEvent if feature is disabled") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) + /** + * Verify that controller registration does not result in a TargetPollEvent if feature is disabled + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) @SuppressWarnings("java:S2699") // java:S2699 - test tests the fired events, no need for assert void targetPollEventNotSendIfDisabled() { @@ -947,9 +988,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { repositoryProperties.setPublishTargetPollEvent(true); } - @Test - @Description("Controller tries to finish an update process after it has been finished by an error action status.") - @ExpectEvents({ + /** + * Controller tries to finish an update process after it has been finished by an error action status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -988,9 +1030,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(3); } - @Test - @Description("Controller tries to finish an update process after it has been finished by an FINISHED action status.") - @ExpectEvents({ + /** + * Controller tries to finish an update process after it has been finished by an FINISHED action status. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1021,9 +1064,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(actionId, PAGE).getNumberOfElements()).isEqualTo(3); } + /** + * Controller tries to send an update feedback after it has been finished which is reject as the repository is configured to reject that. + */ @Test - @Description("Controller tries to send an update feedback after it has been finished which is reject as the repository is " - + "configured to reject that.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -1051,9 +1095,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(3); } + /** + * Controller tries to send an update feedback after it has been finished which is accepted as the repository is + * configured to accept them. + */ @Test - @Description("Controller tries to send an update feedback after it has been finished which is accepted as the repository is " - + "configured to accept them.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -1078,9 +1124,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActionStatusByAction(action.getId(), PAGE).getNumberOfElements()).isEqualTo(4); } - @Test - @Description("Ensures that target attribute update is reflected by the repository.") - @ExpectEvents({ + /** + * Ensures that target attribute update is reflected by the repository. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 3) }) void updateTargetAttributes() throws Exception { @@ -1104,9 +1151,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetVerify.getLastModifiedAt()).isEqualTo(target.getLastModifiedAt()); } - @Test - @Description("Ensures that target attributes can be updated using different update modes.") - @ExpectEvents({ + /** + * Ensures that target attributes can be updated using different update modes. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 4) }) void updateTargetAttributesWithDifferentUpdateModes() { @@ -1126,9 +1174,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { updateTargetAttributesWithUpdateModeRemove(controllerId); } - @Test - @Description("Verifies that a DOWNLOAD_ONLY action is marked complete once the controller reports DOWNLOADED") - @ExpectEvents({ + /** + * Verifies that a DOWNLOAD_ONLY action is marked complete once the controller reports DOWNLOADED + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1152,9 +1201,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(activeActionExistsForControllerId(DEFAULT_CONTROLLER_ID)).isFalse(); } - @Test - @Description("Verifies that a controller can report a FINISHED event for a DOWNLOAD_ONLY non-active action.") - @ExpectEvents({ + /** + * Verifies that a controller can report a FINISHED event for a DOWNLOAD_ONLY non-active action. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1179,9 +1229,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(activeActionExistsForControllerId(DEFAULT_CONTROLLER_ID)).isFalse(); } - @Test - @Description("Verifies that multiple DOWNLOADED events for a DOWNLOAD_ONLY action are handled.") - @ExpectEvents({ + /** + * Verifies that multiple DOWNLOADED events for a DOWNLOAD_ONLY action are handled. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1207,9 +1258,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(activeActionExistsForControllerId(DEFAULT_CONTROLLER_ID)).isFalse(); } + /** + * Verifies that quota is asserted when a controller reports too many DOWNLOADED events for a + * DOWNLOAD_ONLY action. + */ @Test - @Description("Verifies that quota is asserted when a controller reports too many DOWNLOADED events for a " - + "DOWNLOAD_ONLY action.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @@ -1233,9 +1286,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> forNTimes(maxMessages, op)); } - @Test - @Description("Verifies that quota is enforced for UpdateActionStatus events for DOWNLOAD_ONLY assignments.") - @ExpectEvents({ + /** + * Verifies that quota is enforced for UpdateActionStatus events for DOWNLOAD_ONLY assignments. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1280,9 +1334,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Verifies that quota is enforced for UpdateActionStatus events for FORCED assignments.") - @ExpectEvents({ + /** + * Verifies that quota is enforced for UpdateActionStatus events for FORCED assignments. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1326,9 +1381,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Verify that the attaching externalRef to an action is properly stored") - void updatedExternalRefOnActionIsReallyUpdated() { + /** + * Verify that the attaching externalRef to an action is properly stored + */ + @Test void updatedExternalRefOnActionIsReallyUpdated() { final List allExternalRef = new ArrayList<>(); final List allActionId = new ArrayList<>(); final int numberOfActions = 3; @@ -1357,9 +1413,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verify that getting a single action using externalRef works") - void getActionUsingSingleExternalRef() { + /** + * Verify that getting a single action using externalRef works + */ + @Test void getActionUsingSingleExternalRef() { final String knownControllerId = "controllerId"; final String knownExternalRef = "externalRefId"; @@ -1380,9 +1437,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(foundAction.get().getId()).isEqualTo(actionId); } - @Test - @Description("Verify that assigning version form target works") - @ExpectEvents({ + /** + * Verify that assigning version form target works + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1), @@ -1412,17 +1470,20 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(updated2).isFalse(); } - @Test - @Description("Verify that a null externalRef cannot be assigned to an action") - void externalRefCannotBeNull() { + /** + * Verify that a null externalRef cannot be assigned to an action + */ + @Test void externalRefCannotBeNull() { assertThatExceptionOfType(ConstraintViolationException.class) .as("No ConstraintViolationException thrown when a null externalRef was set on an action") .isThrownBy(() -> controllerManagement.updateActionExternalRef(1L, null)); } + /** + * Verifies that a target can report FINISHED/ERROR updates for DOWNLOAD_ONLY assignments regardless of + * repositoryProperties.rejectActionStatusForClosedAction value. + */ @Test - @Description("Verifies that a target can report FINISHED/ERROR updates for DOWNLOAD_ONLY assignments regardless of " + - "repositoryProperties.rejectActionStatusForClosedAction value.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 4), @@ -1466,9 +1527,11 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { }); } + /** + * Verifies that a controller can report a FINISHED event for a DOWNLOAD_ONLY action after having + * installed an intermediate update. + */ @Test - @Description("Verifies that a controller can report a FINISHED event for a DOWNLOAD_ONLY action after having" - + " installed an intermediate update.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 2), @@ -1507,9 +1570,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertNoActiveActionsExistsForControllerId(DEFAULT_CONTROLLER_ID); } - @Test - @Description("Actions are exposed according to thier weight in multi assignment mode.") - void actionsAreExposedAccordingToTheirWeight() { + /** + * Actions are exposed according to thier weight in multi assignment mode. + */ + @Test void actionsAreExposedAccordingToTheirWeight() { final String targetId = testdataFactory.createTarget().getControllerId(); final DistributionSet ds = testdataFactory.createDistributionSet(); final Long actionWeightNull = assignDistributionSet(ds.getId(), targetId).getAssignedEntity().get(0).getId(); @@ -1540,9 +1604,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(controllerManagement.findActiveActionWithHighestWeight(targetId)).isEmpty(); } - @Test - @Description("Delete a target on requested target deletion from client side") - @ExpectEvents({ + /** + * Delete a target on requested target deletion from client side + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1), @Expect(type = TargetDeletedEvent.class, count = 1) }) @@ -1556,9 +1621,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("target should not exist anymore").isZero(); } - @Test - @Description("Delete a target with a non existing thingId") - @ExpectEvents({ @Expect(type = TargetDeletedEvent.class, count = 0) }) + /** + * Delete a target with a non existing thingId + */ + @Test @ExpectEvents({ @Expect(type = TargetDeletedEvent.class, count = 0) }) void deleteTargetWithInvalidThingId() { assertThatExceptionOfType(EntityNotFoundException.class) .as("No EntityNotFoundException thrown when deleting a non-existing target") @@ -1566,9 +1632,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(targetRepository.count()).as("target should not exist").isZero(); } - @Test - @Description("Delete a target after it has been deleted already") - @ExpectEvents({ + /** + * Delete a target after it has been deleted already + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1), @Expect(type = TargetDeletedEvent.class, count = 1) }) @@ -1586,9 +1653,10 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> controllerManagement.deleteExistingTarget(controllerId)); } - @Test - @Description("When action status code is provided in feedback it is also stored in the action field lastActionStatusCode") - void lastActionStatusCodeIsSet() { + /** + * When action status code is provided in feedback it is also stored in the action field lastActionStatusCode + */ + @Test void lastActionStatusCodeIsSet() { final Long actionId = createTargetAndAssignDs(); addUpdateActionStatusAndAssert(actionId, Action.Status.RUNNING, 10); @@ -1619,7 +1687,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } - @Step private Long createTargetAndAssignDs() { final Long dsId = testdataFactory.createDistributionSet().getId(); testdataFactory.createTarget(); @@ -1630,7 +1697,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { return deploymentManagement.findActiveActionsByTarget(DEFAULT_CONTROLLER_ID, PAGE).getContent().get(0).getId(); } - @Step private Long createAndAssignDsAsDownloadOnly(final String dsName, final String defaultControllerId) { final DistributionSet ds = testdataFactory.createDistributionSet(dsName); final Long dsId = ds.getId(); @@ -1642,7 +1708,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { return id; } - @Step private Long assignDs(final Long dsId, final String defaultControllerId, final Action.ActionType actionType) { assignDistributionSet(dsId, defaultControllerId, actionType); assertThat(targetManagement.getByControllerID(defaultControllerId).get().getUpdateStatus()) @@ -1654,7 +1719,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { return id; } - @Step private void simulateIntermediateStatusOnCancellation(final Long actionId) { controllerManagement .addCancelActionStatus(entityFactory.actionStatus().create(actionId).status(Action.Status.RUNNING)); @@ -1682,7 +1746,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { Action.Status.WARNING, true); } - @Step private void simulateIntermediateStatusOnUpdate(final Long actionId) { addUpdateActionStatusAndAssert(actionId, Action.Status.RUNNING); @@ -1731,7 +1794,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { systemSecurityContext.runAsSystem(() -> targetTypeManagement.create(entityFactory.targetType().create().name(targetTypeName))); } - @Step private void addAttributeAndVerify(final String controllerId) { final Map testData = new HashMap<>(1); testData.put("test1", "testdata1"); @@ -1741,7 +1803,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(testData); } - @Step private void addSecondAttributeAndVerify(final String controllerId) { final Map testData = new HashMap<>(2); testData.put("test2", "testdata20"); @@ -1752,7 +1813,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(testData); } - @Step private void updateAttributeAndVerify(final String controllerId) { final Map testData = new HashMap<>(2); testData.put("test1", "testdata12"); @@ -1764,7 +1824,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(testData); } - @Step private void updateTargetAttributesWithUpdateModeRemove(final String controllerId) { final int previousSize = targetManagement.getControllerAttributes(controllerId).size(); @@ -1780,7 +1839,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(updatedAttributes).doesNotContainKeys("k1", "k3"); } - @Step private void updateTargetAttributesWithUpdateModeMerge(final String controllerId) { // get the current attributes final HashMap attributes = new HashMap<>(targetManagement.getControllerAttributes(controllerId)); @@ -1799,7 +1857,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { attributes.keySet().forEach(assertThat(updatedAttributes)::containsKey); } - @Step private void updateTargetAttributesWithUpdateModeReplace(final String controllerId) { // get the current attributes final HashMap attributes = new HashMap<>(targetManagement.getControllerAttributes(controllerId)); @@ -1819,7 +1876,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { attributes.entrySet().forEach(assertThat(updatedAttributes)::doesNotContain); } - @Step private void updateTargetAttributesWithoutUpdateMode(final String controllerId) { // set the initial attributes final Map attributes = new HashMap<>(); @@ -1849,7 +1905,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { } } - @Step private void finishDownloadOnlyUpdateAndSendUpdateActionStatus(final Long actionId, final Status status) { // finishing action controllerManagement @@ -1859,7 +1914,6 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest { assertThat(activeActionExistsForControllerId(DEFAULT_CONTROLLER_ID)).isFalse(); } - @Step private void addUpdateActionStatus(final Long actionId, final String controllerId, final Status actionStatus) { controllerManagement.addUpdateActionStatus(entityFactory.actionStatus().create(actionId).status(actionStatus)); assertActionStatus(actionId, controllerId, TargetUpdateStatus.IN_SYNC, actionStatus, actionStatus, false); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementSecurityTest.java index 2d6293dc2..7ebe16982 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Set; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.Action; @@ -23,74 +20,86 @@ import org.eclipse.hawkbit.repository.model.DistributionSetInvalidation; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Pageable; -@Feature("SecurityTests - DeploymentManagement") -@Story("SecurityTests DeploymentManagement") +/** + * Feature: SecurityTests - DeploymentManagement
+ * Story: SecurityTests DeploymentManagement + */ class DeploymentManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignDistributionSetsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignDistributionSetsPermissionsCheck() { assertPermissions(() -> deploymentManagement.assignDistributionSets( List.of(new DeploymentRequest("controllerId", 1L, Action.ActionType.SOFT, 1L, 1, "maintenanceSchedule", "maintenanceWindowDuration", "maintenanceWindowTimeZone", true))), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignDistributionSetsWithInitiatedByPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignDistributionSetsWithInitiatedByPermissionsCheck() { assertPermissions(() -> deploymentManagement.assignDistributionSets("initiator", List.of(new DeploymentRequest("controllerId", 1L, Action.ActionType.SOFT, 1L, 1, "maintenanceSchedule", "maintenanceWindowDuration", "maintenanceWindowTimeZone", true)), "message"), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void offlineAssignedDistributionSetsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void offlineAssignedDistributionSetsPermissionsCheck() { assertPermissions(() -> deploymentManagement.offlineAssignedDistributionSets(List.of()), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void offlineAssignedDistributionSetsWithInitiatedByPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void offlineAssignedDistributionSetsWithInitiatedByPermissionsCheck() { assertPermissions(() -> deploymentManagement.offlineAssignedDistributionSets(List.of(), "initiator"), List.of(SpPermission.READ_REPOSITORY, SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void cancelActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void cancelActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.cancelAction(1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionsByTargetWithFilterPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionsByTargetWithFilterPermissionsCheck() { assertPermissions(() -> deploymentManagement.countActionsByTarget("rsqlParam", "controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionsByTargetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionsByTargetPermissionsCheck() { assertPermissions(() -> deploymentManagement.countActionsByTarget("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionsAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionsAllPermissionsCheck() { assertPermissions(() -> deploymentManagement.countActionsAll(), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionsPermissionsCheck() { assertPermissions(() -> deploymentManagement.countActions("id==1"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.findAction(1L), List.of(SpPermission.READ_TARGET)); } @@ -99,137 +108,157 @@ class DeploymentManagementSecurityTest extends AbstractJpaIntegrationTest { assertPermissions(() -> deploymentManagement.findActionsAll(Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionsPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActions("id==1", Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionsByTargetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionsByTargetPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActionsByTarget("rsql==param", "controllerId", Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionsByTargetWithControllerIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionsByTargetWithControllerIdPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActionsByTarget("controllerId", Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionStatusByActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionStatusByActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActionStatusByAction(1L, Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionStatusByActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionStatusByActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.countActionStatusByAction(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findMessagesByActionStatusIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findMessagesByActionStatusIdPermissionsCheck() { assertPermissions(() -> deploymentManagement.findMessagesByActionStatusId(1L, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActionWithDetailsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActionWithDetailsPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActionWithDetails(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActiveActionsByTargetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActiveActionsByTargetPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActiveActionsByTarget("controllerId", Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findInActiveActionsByTargetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findInActiveActionsByTargetPermissionsCheck() { assertPermissions(() -> deploymentManagement.findInActiveActionsByTarget("controllerId", Pageable.unpaged()), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActiveActionsWithHighestWeightPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActiveActionsWithHighestWeightPermissionsCheck() { assertPermissions(() -> deploymentManagement.findActiveActionsWithHighestWeight("controllerId", 1), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void forceQuitActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void forceQuitActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.forceQuitAction(1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void forceTargetActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void forceTargetActionPermissionsCheck() { assertPermissions(() -> deploymentManagement.forceTargetAction(1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void cancelInactiveScheduledActionsForTargetsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void cancelInactiveScheduledActionsForTargetsPermissionsCheck() { assertPermissions(() -> { deploymentManagement.cancelInactiveScheduledActionsForTargets(List.of(1L)); return null; }, List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void startScheduledActionsByRolloutGroupParentPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void startScheduledActionsByRolloutGroupParentPermissionsCheck() { assertPermissions(() -> { deploymentManagement.startScheduledActionsByRolloutGroupParent(1L, 1L, 1L); return null; }, List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void startScheduledActionsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void startScheduledActionsPermissionsCheck() { assertPermissions(() -> { deploymentManagement.startScheduledActions(List.of()); return null; }, List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getAssignedDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getAssignedDistributionSetPermissionsCheck() { assertPermissions(() -> deploymentManagement.getAssignedDistributionSet("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getInstalledDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getInstalledDistributionSetPermissionsCheck() { assertPermissions(() -> deploymentManagement.getInstalledDistributionSet("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteActionsByStatusAndLastModifiedBeforePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteActionsByStatusAndLastModifiedBeforePermissionsCheck() { assertPermissions(() -> deploymentManagement.deleteActionsByStatusAndLastModifiedBefore(Set.of(Action.Status.CANCELED), 1L), List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void hasPendingCancellationsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void hasPendingCancellationsPermissionsCheck() { assertPermissions(() -> deploymentManagement.hasPendingCancellations(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void cancelActionsForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void cancelActionsForDistributionSetPermissionsCheck() { assertPermissions(() -> { deploymentManagement.cancelActionsForDistributionSet(DistributionSetInvalidation.CancelationType.FORCE, entityFactory.distributionSet().create().build()); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementTest.java index 4a8181b44..2a7c7d801 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DeploymentManagementTest.java @@ -29,9 +29,6 @@ import java.util.stream.Stream; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.Getter; import org.assertj.core.api.Assertions; import org.eclipse.hawkbit.repository.ActionStatusFields; @@ -96,17 +93,19 @@ import org.springframework.data.domain.Sort.Direction; /** * Test class testing the functionality of triggering a deployment of {@link DistributionSet}s to {@link Target}s. + *

+ * Feature: Component Tests - Repository
+ * Story: Deployment Management */ -@Feature("Component Tests - Repository") -@Story("Deployment Management") class DeploymentManagementTest extends AbstractJpaIntegrationTest { private static final boolean STATE_ACTIVE = true; private static final boolean STATE_INACTIVE = false; - @Test - @Description("Tests that an exception is thrown when a target is assigned to an incomplete distribution set") - void verifyAssignTargetsToIncompleteDistribution() { + /** + * Tests that an exception is thrown when a target is assigned to an incomplete distribution set + */ + @Test void verifyAssignTargetsToIncompleteDistribution() { final DistributionSet distributionSet = testdataFactory.createIncompleteDistributionSet(); final Target target = testdataFactory.createTarget(); @@ -115,9 +114,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> assignDistributionSet(distributionSet, target)); } - @Test - @Description("Tests that an exception is thrown when a target is assigned to an invalidated distribution set") - void verifyAssignTargetsToInvalidDistribution() { + /** + * Tests that an exception is thrown when a target is assigned to an invalidated distribution set + */ + @Test void verifyAssignTargetsToInvalidDistribution() { final DistributionSet distributionSet = testdataFactory.createAndInvalidateDistributionSet(); final Target target = testdataFactory.createTarget(); @@ -126,18 +126,22 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> assignDistributionSet(distributionSet, target)); } + /** + * Verifies that management get access react as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access react as specified on calls for non existing entities by means " + - "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(deploymentManagement.findAction(1234L)).isNotPresent(); assertThat(deploymentManagement.findActionWithDetails(NOT_EXIST_IDL)).isNotPresent(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " + - " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) void entityQueriesReferringToNotExistingEntitiesThrowsException() { final Target target = testdataFactory.createTarget(); @@ -160,9 +164,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> deploymentManagement.forceTargetAction(NOT_EXIST_IDL), "Action"); } - @Test - @Description("Test verifies that the repistory retrieves the action including all defined (lazy) details.") - void findActionWithLazyDetails() { + /** + * Test verifies that the repistory retrieves the action including all defined (lazy) details. + */ + @Test void findActionWithLazyDetails() { final DistributionSet testDs = testdataFactory.createDistributionSet("TestDs", "1.0", new ArrayList<>()); final List testTarget = testdataFactory.createTargets(1); @@ -177,9 +182,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isNotNull(); } - @Test - @Description("Test verifies that actions of a target are found by using id-based search.") - void findActionByTargetId() { + /** + * Test verifies that actions of a target are found by using id-based search. + */ + @Test void findActionByTargetId() { final DistributionSet testDs = testdataFactory.createDistributionSet("TestDs", "1.0", new ArrayList<>()); final List testTarget = testdataFactory.createTargets(1); // one action with one action status is generated @@ -193,9 +199,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(actions.getContent().get(0).getId()).as("Action of target").isEqualTo(actionId); } - @Test - @Description("Test verifies that the 'max actions per target' quota is enforced.") - void assertMaxActionsPerTargetQuotaIsEnforced() { + /** + * Test verifies that the 'max actions per target' quota is enforced. + */ + @Test void assertMaxActionsPerTargetQuotaIsEnforced() { enableMultiAssignments(); final int maxActions = quotaManagement.getMaxActionsPerTarget(); @@ -211,9 +218,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> assignDistributionSet(ds1Id, controllerId, 77)); } - @Test - @Description("An assignment request with more assignments than allowed by 'maxTargetDistributionSetAssignmentsPerManualAssignment' quota throws an exception.") - void assignmentRequestThatIsTooLarge() { + /** + * An assignment request with more assignments than allowed by 'maxTargetDistributionSetAssignmentsPerManualAssignment' quota throws an exception. + */ + @Test void assignmentRequestThatIsTooLarge() { final int maxActions = quotaManagement.getMaxTargetDistributionSetAssignmentsPerManualAssignment(); final DistributionSet ds1 = testdataFactory.createDistributionSet("1"); final DistributionSet ds2 = testdataFactory.createDistributionSet("2"); @@ -225,9 +233,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThatExceptionOfType(AssignmentQuotaExceededException.class).isThrownBy(() -> assignDistributionSet(ds2, targets)); } - @Test - @Description("Test verifies that action-states of an action are found by using id-based search.") - void findActionStatusByActionId() { + /** + * Test verifies that action-states of an action are found by using id-based search. + */ + @Test void findActionStatusByActionId() { final DistributionSet testDs = testdataFactory.createDistributionSet("TestDs", "1.0", Collections.emptyList()); final List testTarget = testdataFactory.createTargets(1); // one action with one action status is generated @@ -242,9 +251,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(actionStates.getContent().get(0)).as("Action-status of action").isEqualTo(expectedActionStatus); } - @Test - @Description("Test verifies that messages of an action-status are found by using id-based search.") - void findMessagesByActionStatusId() { + /** + * Test verifies that messages of an action-status are found by using id-based search. + */ + @Test void findMessagesByActionStatusId() { final DistributionSet testDs = testdataFactory.createDistributionSet("TestDs", "1.0", new ArrayList<>()); final List testTarget = testdataFactory.createTargets(1); // one action with one action status is generated @@ -268,9 +278,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(messages.getContent().get(0)).as("Message of action-status").isEqualTo(expectedMsg); } - @Test - @Description("Ensures that tag to distribution set assignment that does not exist will cause EntityNotFoundException.") - void assignDistributionSetToTagThatDoesNotExistThrowsException() { + /** + * Ensures that tag to distribution set assignment that does not exist will cause EntityNotFoundException. + */ + @Test void assignDistributionSetToTagThatDoesNotExistThrowsException() { final List assignDS = new ArrayList<>(5); for (int i = 0; i < 4; i++) { assignDS.add(testdataFactory.createDistributionSet("DS" + i, "1.0", Collections.emptyList()).getId()); @@ -286,9 +297,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .withMessageContaining(String.valueOf(100L)); } - @Test - @Description("Test verifies that an assignment with automatic cancelation works correctly even if the update is split into multiple partitions on the database.") - @ExpectEvents({ + /** + * Test verifies that an assignment with automatic cancelation works correctly even if the update is split into multiple partitions on the database. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 20), @Expect(type = TargetUpdatedEvent.class, count = 40), @Expect(type = TargetAssignDistributionSetEvent.class, count = 2), @@ -313,10 +325,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(deploymentManagement.countActionsAll()).isEqualTo(2L * quotaManagement.getMaxTargetsPerAutoAssignment()); } + /** + * Cancels multiple active actions on a target. Expected behaviour is that with two active + * After canceling the first one also the target goes back to IN_SYNC as no open action is left. + */ @Test - @Description("Cancels multiple active actions on a target. Expected behaviour is that with two active " + - "actions after canceling the second active action the first one is still running as it is not touched by the cancelation. " + - "After canceling the first one also the target goes back to IN_SYNC as no open action is left.") void manualCancelWithMultipleAssignmentsCancelLastOneFirst() { final Action action = prepareFinishedUpdate("4712", "installed", true); final Target target = action.getTarget(); @@ -360,10 +373,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(TargetUpdateStatus.IN_SYNC); } + /** + * Cancels multiple active actions on a target. Expected behaviour is that with two active + * also the target goes back to IN_SYNC as no open action is left. + */ @Test - @Description("Cancels multiple active actions on a target. Expected behaviour is that with two active " - + "actions after canceling the first active action the system switched to second one. After canceling this one " - + "also the target goes back to IN_SYNC as no open action is left.") void manualCancelWithMultipleAssignmentsCancelMiddleOneFirst() { final Action action = prepareFinishedUpdate("4712", "installed", true); final Target target = action.getTarget(); @@ -411,9 +425,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(TargetUpdateStatus.IN_SYNC); } - @Test - @Description("Force Quit an Assignment. Expected behaviour is that the action is canceled and is marked as deleted. The assigned Software module") - void forceQuitSetActionToInactive() { + /** + * Force Quit an Assignment. Expected behaviour is that the action is canceled and is marked as deleted. The assigned Software module + */ + @Test void forceQuitSetActionToInactive() { final Action action = prepareFinishedUpdate("4712", "installed", true); final Target target = action.getTarget(); final DistributionSet dsInstalled = action.getDistributionSet(); @@ -446,9 +461,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(TargetUpdateStatus.IN_SYNC); } - @Test - @Description("Force Quit an not canceled Assignment. Expected behaviour is that the action can not be force quit and there is thrown an exception.") - void forceQuitNotAllowedThrowsException() { + /** + * Force Quit an not canceled Assignment. Expected behaviour is that the action can not be force quit and there is thrown an exception. + */ + @Test void forceQuitNotAllowedThrowsException() { final Action action = prepareFinishedUpdate("4712", "installed", true); // verify initial status assertThat(targetManagement.getByControllerID("4712").get().getUpdateStatus()).as("wrong update status") @@ -468,9 +484,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> deploymentManagement.forceQuitAction(assigningActionId)); } + /** + * Simple offline deployment of a distribution set to a list of targets. Verifies that offline assigment + * is correctly executed for targets that do not have a running update already. Those are ignored. + */ @Test - @Description("Simple offline deployment of a distribution set to a list of targets. Verifies that offline assigment " - + "is correctly executed for targets that do not have a running update already. Those are ignored.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 20), @Expect(type = TargetUpdatedEvent.class, count = 20), @@ -512,9 +530,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .allMatch(target -> target.getLastModifiedAt() == target.getInstallationDate()); } - @Test - @Description("Offline assign multiple DSs to a single Target in multiassignment mode.") - @ExpectEvents({ + /** + * Offline assign multiple DSs to a single Target in multiassignment mode. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = ActionCreatedEvent.class, count = 4), @@ -548,9 +567,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Verifies that if an account is set to action autoclose running actions in case of a new assigned set get closed and set to CANCELED.") - @ExpectEvents({ + /** + * Verifies that if an account is set to action autoclose running actions in case of a new assigned set get closed and set to CANCELED. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 10), @Expect(type = TargetUpdatedEvent.class, count = 20), @Expect(type = ActionCreatedEvent.class, count = 20), @@ -591,9 +611,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("If multi-assignment is enabled, verify that the previous Distribution Set assignment is not canceled when a new one is assigned.") - @ExpectEvents({ + /** + * If multi-assignment is enabled, verify that the previous Distribution Set assignment is not canceled when a new one is assigned. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 10), @Expect(type = TargetUpdatedEvent.class, count = 20), @Expect(type = ActionCreatedEvent.class, count = 20), @@ -622,9 +643,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertDsExclusivelyAssignedToTargets(targets, ds1.getId(), STATE_ACTIVE, RUNNING); } - @Test - @Description("Assign multiple DSs to a single Target in one request in multiassignment mode.") - @ExpectEvents({ + /** + * Assign multiple DSs to a single Target in one request in multiassignment mode. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = ActionCreatedEvent.class, count = 4), @@ -659,9 +681,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Assign multiple DSs to single Target in one request in multiAssignment mode and cancel each created action afterwards.") - @ExpectEvents({ + /** + * Assign multiple DSs to single Target in one request in multiAssignment mode and cancel each created action afterwards. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 4), @Expect(type = ActionCreatedEvent.class, count = 4), @@ -695,9 +718,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { })); } - @Test - @Description("A Request resulting in multiple assignments to a single target is only allowed when multiassignment is enabled.") - void multipleAssignmentsToTargetOnlyAllowedInMultiAssignMode() { + /** + * A Request resulting in multiple assignments to a single target is only allowed when multiassignment is enabled. + */ + @Test void multipleAssignmentsToTargetOnlyAllowedInMultiAssignMode() { final Target target = testdataFactory.createTarget(); final List distributionSets = testdataFactory.createDistributionSets(2); @@ -716,9 +740,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { deploymentManagement.assignDistributionSets(Arrays.asList(targetToDS0, targetToDS1)))).isEqualTo(2); } - @Test - @Description("Assigning distribution set to the list of targets with a non-existing one leads to successful assignment of valid targets, while not found targets are silently ignored.") - void assignDistributionSetToNotExistingTarget() { + /** + * Assigning distribution set to the list of targets with a non-existing one leads to successful assignment of valid targets, while not found targets are silently ignored. + */ + @Test void assignDistributionSetToNotExistingTarget() { final String notExistingId = "notExistingTarget"; final DistributionSet createdDs = testdataFactory.createDistributionSet(); @@ -741,9 +766,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { } } + /** + * Assignments with confirmation flow active will result in actions in 'WAIT_FOR_CONFIRMATION' state + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Assignments with confirmation flow active will result in actions in 'WAIT_FOR_CONFIRMATION' state") void assignmentWithConfirmationFlowActive(final boolean confirmationRequired) { final List controllerIds = testdataFactory.createTargets(1).stream().map(Target::getControllerId).toList(); final DistributionSet distributionSet = testdataFactory.createDistributionSet(); @@ -767,9 +794,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { })); } + /** + * Verify auto confirmation assignments and check action status with messages + */ @ParameterizedTest @ValueSource(booleans = { true, false }) - @Description("Verify auto confirmation assignments and check action status with messages") void assignmentWithAutoConfirmationWillBeHandledCorrectly(final boolean confirmationRequired) { enableConfirmationFlow(); @@ -816,9 +845,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Multiple assignments with confirmation flow active will result in correct cancel behaviour") - void multipleAssignmentWithConfirmationFlowActiveVerifyCancelBehaviour() { + /** + * Multiple assignments with confirmation flow active will result in correct cancel behaviour + */ + @Test void multipleAssignmentWithConfirmationFlowActiveVerifyCancelBehaviour() { final Target target = testdataFactory.createTarget("firstDevice"); final DistributionSet firstDs = testdataFactory.createDistributionSet(); final DistributionSet secondDs = testdataFactory.createDistributionSet(); @@ -852,9 +882,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Assignments with confirmation flow deactivated will result in actions in only in 'RUNNING' state") - void verifyConfirmationRequiredFlagHaveNoInfluenceIfFlowIsDeactivated() { + /** + * Assignments with confirmation flow deactivated will result in actions in only in 'RUNNING' state + */ + @Test void verifyConfirmationRequiredFlagHaveNoInfluenceIfFlowIsDeactivated() { final List targets1 = testdataFactory.createTargets("group1", 1).stream().map(Target::getControllerId).toList(); final List targets2 = testdataFactory.createTargets("group2", 1).stream().map(Target::getControllerId).toList(); final DistributionSet distributionSet = testdataFactory.createDistributionSet(); @@ -877,9 +908,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { })); } - @Test - @Description("Duplicate Assignments are removed from a request when multiassignment is disabled, otherwise not") - @ExpectEvents({ + /** + * Duplicate Assignments are removed from a request when multiassignment is disabled, otherwise not + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -907,9 +939,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(1); } - @Test - @Description("An assignment request is not accepted if it would lead to a target exceeding the max actions per target quota.") - @ExpectEvents({ + /** + * An assignment request is not accepted if it would lead to a target exceeding the max actions per target quota. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 21), // max actions per target are 20 for test @Expect(type = SoftwareModuleCreatedEvent.class, count = 3 * 21), @@ -936,9 +969,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(actionRepository.countByTargetControllerId(controllerId)).isZero(); } - @Test - @Description("An assignment request without a weight is ok when multi assignment in enabled.") - void weightNotRequiredInMultiAssignmentMode() { + /** + * An assignment request without a weight is ok when multi assignment in enabled. + */ + @Test void weightNotRequiredInMultiAssignmentMode() { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -949,9 +983,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(deploymentManagement.assignDistributionSets(List.of(assignWithoutWeight, assignWithWeight))).isNotNull(); } - @Test - @Description("An assignment request containing a weight don't causes an error when multi assignment in disabled.") - void weightAllowedWhenMultiAssignmentModeNotEnabled() { + /** + * An assignment request containing a weight don't causes an error when multi assignment in disabled. + */ + @Test void weightAllowedWhenMultiAssignmentModeNotEnabled() { final String targetId = testdataFactory.createTarget().getControllerId(); final Long dsId = testdataFactory.createDistributionSet().getId(); @@ -959,9 +994,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(deploymentManagement.assignDistributionSets(Collections.singletonList(assignWithoutWeight))).isNotNull().size().isEqualTo(1); } - @Test - @Description("Weights are validated and contained in the resulting Action.") - @ExpectEvents({ + /** + * Weights are validated and contained in the resulting Action. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1002,9 +1038,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { * {@link TargetRepository#assignDistributionSet(DistributionSet, Iterable)} and * checking the active action and the action history of the targets. */ - @Test - @Description("Simple deployment or distribution set to target assignment test.") - @ExpectEvents({ + /** + * Simple deployment or distribution set to target assignment test. + */ + @Test @ExpectEvents({ @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @@ -1058,9 +1095,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Test that it is not possible to assign a distribution set that is not complete.") - @ExpectEvents({ + /** + * Test that it is not possible to assign a distribution set that is not complete. + */ + @Test @ExpectEvents({ @Expect(type = TargetAssignDistributionSetEvent.class, count = 1), @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 2), @@ -1089,9 +1127,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(10); } + /** + * Multiple deployments or distribution set to target assignment test. Expected behaviour is that a new deployment + * overides unfinished old one which are canceled as part of the operation. + */ @Test - @Description("Multiple deployments or distribution set to target assignment test. Expected behaviour is that a new deployment " - + "overides unfinished old one which are canceled as part of the operation.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 5 + 4), @Expect(type = TargetUpdatedEvent.class, count = 3 * 4), @@ -1153,10 +1193,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .doesNotContain(toArray(deployedTargetsFromDB, JpaTarget.class)); } + /** + * Multiple deployments or distribution set to target assignment test including finished response + * IN_SYNC status and installed DS is set to the assigned DS entry. + */ @Test - @Description("Multiple deployments or distribution set to target assignment test including finished response " - + "from target/controller. Expected behaviour is that in case of OK finished update the target will go to " - + "IN_SYNC status and installed DS is set to the assigned DS entry.") void assignDistributionSetAndAddFinishedActionStatus() { final PageRequest pageRequest = PageRequest.of(0, 100, Direction.ASC, ActionStatusFields.ID.getJpaEntityFieldName()); @@ -1247,9 +1288,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { * {@link Target}s are assigned by {@link Target#getAssignedDistributionSet()} * or {@link Target#getInstalledDistributionSet()} */ + /** + * Deletes distribution set. Expected behaviour is that a soft delete is performed + * if the DS is assigned to a target and a hard delete if the DS is not in use at all. + */ @Test - @Description("Deletes distribution set. Expected behaviour is that a soft delete is performed " - + "if the DS is assigned to a target and a hard delete if the DS is not in use at all.") void deleteDistributionSet() { final PageRequest pageRequest = PageRequest.of(0, 100, Direction.ASC, "id"); @@ -1304,9 +1347,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Deletes multiple targets and verifies that all related metadata is also deleted.") - void deletesTargetsAndVerifyCascadeDeletes() { + /** + * Deletes multiple targets and verifies that all related metadata is also deleted. + */ + @Test void deletesTargetsAndVerifyCascadeDeletes() { final String undeployedTargetPrefix = "undep-T"; final int noOfUndeployedTargets = 2; @@ -1330,9 +1374,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(actionStatusRepository.count()).as("size of action status is wrong").isZero(); } - @Test - @Description("Testing if changing target and the status without refreshing the entities from the DB (e.g. concurrent changes from UI and from controller) works") - void alternatingAssignmentAndAddUpdateActionStatus() { + /** + * Testing if changing target and the status without refreshing the entities from the DB (e.g. concurrent changes from UI and from controller) works + */ + @Test void alternatingAssignmentAndAddUpdateActionStatus() { final DistributionSet dsA = testdataFactory.createDistributionSet("a"); final DistributionSet dsB = testdataFactory.createDistributionSet("b"); @@ -1402,9 +1447,11 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .get(0).getDistributionSet(), "Active ds is wrong"); } + /** + * The test verifies that the DS itself is not changed because of an target assignment + * which is a relationship but not a changed on the entity itself.. + */ @Test - @Description("The test verifies that the DS itself is not changed because of an target assignment" - + " which is a relationship but not a changed on the entity itself..") void checkThatDsRevisionsIsNotChangedWithTargetAssignment() { final DistributionSet dsA = testdataFactory.createDistributionSet("a"); testdataFactory.createDistributionSet("b"); @@ -1421,9 +1468,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(distributionSetManagement.getWithDetails(dsA.getId()).get().getOptLockRevision()); } - @Test - @Description("Tests the switch from a soft to hard update by API") - void forceSoftAction() { + /** + * Tests the switch from a soft to hard update by API + */ + @Test void forceSoftAction() { // prepare final Target target = testdataFactory.createTarget("knownControllerId"); final DistributionSet ds = testdataFactory.createDistributionSet("a"); @@ -1443,9 +1491,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED); } - @Test - @Description("Tests the switch from a hard to hard update by API, e.g. which in fact should not change anything.") - void forceAlreadyForcedActionNothingChanges() { + /** + * Tests the switch from a hard to hard update by API, e.g. which in fact should not change anything. + */ + @Test void forceAlreadyForcedActionNothingChanges() { // prepare final Target target = testdataFactory.createTarget("knownControllerId"); final DistributionSet ds = testdataFactory.createDistributionSet("a"); @@ -1466,9 +1515,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(findAction.getActionType()).as("action type is wrong").isEqualTo(ActionType.FORCED); } - @Test - @Description("Tests the computation of already assigned entities returned as a result of an assignment") - void testAlreadyAssignedAndAssignedActionsInAssignmentResult() { + /** + * Tests the computation of already assigned entities returned as a result of an assignment + */ + @Test void testAlreadyAssignedAndAssignedActionsInAssignmentResult() { // create target1, distributionSet, assign ds to target1 and finish // update (close all actions) final Action action = prepareFinishedUpdate("target1", "ds", false); @@ -1495,9 +1545,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .noneMatch(a -> a.getTarget().getControllerId().equals("target1")); } - @Test - @Description("Verify that the DistributionSetAssignmentResult not contains already assigned targets.") - void verifyDistributionSetAssignmentResultNotContainsAlreadyAssignedTargets() { + /** + * Verify that the DistributionSetAssignmentResult not contains already assigned targets. + */ + @Test void verifyDistributionSetAssignmentResultNotContainsAlreadyAssignedTargets() { final DistributionSet dsToTargetAssigned = testdataFactory.createDistributionSet("ds-3"); // create assigned DS @@ -1512,9 +1563,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetRepository.findAll()).hasSize(1); } - @Test - @Description("Verify that the DistributionSet assignments work for multiple targets of the same target type within the same request.") - void verifyDSAssignmentForMultipleTargetsWithSameTargetType() { + /** + * Verify that the DistributionSet assignments work for multiple targets of the same target type within the same request. + */ + @Test void verifyDSAssignmentForMultipleTargetsWithSameTargetType() { final DistributionSet ds = testdataFactory.createDistributionSet("test-ds"); final TargetType targetType = testdataFactory.createTargetType("test-type", Collections.singletonList(ds.getType())); @@ -1537,9 +1589,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .forEach(jpaTarget -> assertThat(jpaTarget.getAssignedDistributionSet()).isEqualTo(ds)); } - @Test - @Description("Verify that the DistributionSet assignments work for multiple targets of different target types.") - void verifyDSAssignmentForMultipleTargetsWithDifferentTargetTypes() { + /** + * Verify that the DistributionSet assignments work for multiple targets of different target types. + */ + @Test void verifyDSAssignmentForMultipleTargetsWithDifferentTargetTypes() { final DistributionSet ds = testdataFactory.createDistributionSet("test-ds"); final TargetType targetType1 = testdataFactory.createTargetType("test-type1", Collections.singletonList(ds.getType())); final TargetType targetType2 = testdataFactory.createTargetType("test-type2", Collections.singletonList(ds.getType())); @@ -1562,9 +1615,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { assertThat(assignedDsTarget2).isEqualTo(ds); } - @Test - @Description("Verify that the DistributionSet assignment fails for target with incompatible target type.") - void verifyDSAssignmentFailsForTargetsWithIncompatibleTargetTypes() { + /** + * Verify that the DistributionSet assignment fails for target with incompatible target type. + */ + @Test void verifyDSAssignmentFailsForTargetsWithIncompatibleTargetTypes() { final DistributionSet ds = testdataFactory.createDistributionSet("test-ds"); final DistributionSetType dsType = testdataFactory.findOrCreateDistributionSetType("test-ds-type", "dsType"); final TargetType targetType = testdataFactory.createTargetType("target-type", @@ -1579,9 +1633,10 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> deploymentManagement.assignDistributionSets(deploymentRequests)); } - @Test - @Description("Verify that the DistributionSet assignment fails for target with target type that is not compatible with any dsType.") - void verifyDSAssignmentFailsForTargetsWithTargetTypesThatAreNotCompatibleWithAnyDs() { + /** + * Verify that the DistributionSet assignment fails for target with target type that is not compatible with any dsType. + */ + @Test void verifyDSAssignmentFailsForTargetsWithTargetTypesThatAreNotCompatibleWithAnyDs() { final DistributionSet ds = testdataFactory.createDistributionSet("test-ds"); final TargetType emptyTargetType = testdataFactory.createTargetType("target-type", Collections.emptyList()); final Target targetWithEmptyType = testdataFactory.createTarget("test-target", "test-target", diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetInvalidationManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetInvalidationManagementTest.java index 4188cd851..f3799a501 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetInvalidationManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetInvalidationManagementTest.java @@ -15,9 +15,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import java.util.Collections; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.IncompleteDistributionSetException; import org.eclipse.hawkbit.repository.exception.InsufficientPermissionException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -41,14 +38,16 @@ import org.springframework.data.repository.query.Param; /** * Test class testing the functionality of invalidating a * {@link DistributionSet} + *

+ * Feature: Component Tests - Repository
+ * Story: Distribution set invalidation management */ -@Feature("Component Tests - Repository") -@Story("Distribution set invalidation management") class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verify invalidation of distribution sets that only removes distribution sets from auto assignments") - void verifyInvalidateDistributionSetStopAutoAssignment() { + /** + * Verify invalidation of distribution sets that only removes distribution sets from auto assignments + */ + @Test void verifyInvalidateDistributionSetStopAutoAssignment() { final InvalidationTestData invalidationTestData = createInvalidationTestData("verifyInvalidateDistributionSetStopAutoAssignment"); final DistributionSetInvalidation distributionSetInvalidation = new DistributionSetInvalidation( @@ -74,9 +73,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe } } - @Test - @Description("Verify invalidation of distribution sets that removes distribution sets from auto assignments and stops rollouts") - void verifyInvalidateDistributionSetStopRollouts() { + /** + * Verify invalidation of distribution sets that removes distribution sets from auto assignments and stops rollouts + */ + @Test void verifyInvalidateDistributionSetStopRollouts() { final InvalidationTestData invalidationTestData = createInvalidationTestData( "verifyInvalidateDistributionSetStopRollouts"); @@ -106,9 +106,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe } } - @Test - @Description("Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and force cancels assignments") - void verifyInvalidateDistributionSetStopAllAndForceCancel() { + /** + * Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and force cancels assignments + */ + @Test void verifyInvalidateDistributionSetStopAllAndForceCancel() { final InvalidationTestData invalidationTestData = createInvalidationTestData( "verifyInvalidateDistributionSetStopAllAndForceCancel"); @@ -136,9 +137,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe } } - @Test - @Description("Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and cancels assignments") - void verifyInvalidateDistributionSetStopAll() { + /** + * Verify invalidation of distribution sets that removes distribution sets from auto assignments, stops rollouts and cancels assignments + */ + @Test void verifyInvalidateDistributionSetStopAll() { final InvalidationTestData invalidationTestData = createInvalidationTestData( "verifyInvalidateDistributionSetStopAll"); @@ -163,9 +165,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe } } - @Test - @Description("Verify that invalidating an incomplete distribution set throws an exception") - void verifyInvalidateIncompleteDistributionSetThrowsException() { + /** + * Verify that invalidating an incomplete distribution set throws an exception + */ + @Test void verifyInvalidateIncompleteDistributionSetThrowsException() { final DistributionSet distributionSet = testdataFactory.createIncompleteDistributionSet(); final DistributionSetInvalidation distributionSetInvalidation = new DistributionSetInvalidation( @@ -175,9 +178,11 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe .isThrownBy(() -> distributionSetInvalidationManagement.invalidateDistributionSet(distributionSetInvalidation)); } + /** + * Verify that invalidating an invalidated distribution set don't throws an exception + * -> should be able to cancel actions again (if previous time there was a problem + */ @Test - @Description("Verify that invalidating an invalidated distribution set don't throws an exception" + - " -> should be able to cancel actions again (if previous time there was a problem") @SuppressWarnings("java:S2699") // test that no exception is thrown void verifyInvalidateInvalidatedDistributionSetDontThrowsException() { final DistributionSet distributionSet = testdataFactory.createAndInvalidateDistributionSet(); @@ -186,9 +191,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe CancelationType.SOFT, true)); } - @Test - @Description("Verify that a user that has authority READ_REPOSITORY and UPDATE_REPOSITORY is allowed to invalidate a distribution set") - @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY" }) + /** + * Verify that a user that has authority READ_REPOSITORY and UPDATE_REPOSITORY is allowed to invalidate a distribution set + */ + @Test @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY" }) void verifyInvalidateWithReadAndUpdateRepoAuthority() { final InvalidationTestData invalidationTestData = systemSecurityContext .runAsSystem(() -> createInvalidationTestData("verifyInvalidateWithUpdateRepoAuthority")); @@ -201,9 +207,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe .isFalse(); } - @Test - @Description("Verify that a user that has authority READ_REPOSITORY, UPDATE_REPOSITORY and UPDATE_TARGET is allowed to invalidate a distribution set only without canceling rollouts") - @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY", "UPDATE_TARGET" }) + /** + * Verify that a user that has authority READ_REPOSITORY, UPDATE_REPOSITORY and UPDATE_TARGET is allowed to invalidate a distribution set only without canceling rollouts + */ + @Test @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY", "UPDATE_TARGET" }) void verifyInvalidateWithReadAndUpdateRepoAndUpdateTargetAuthority() { final InvalidationTestData invalidationTestData = systemSecurityContext.runAsSystem( () -> createInvalidationTestData("verifyInvalidateWithUpdateRepoAndUpdateTargetAuthority")); @@ -222,9 +229,10 @@ class DistributionSetInvalidationManagementTest extends AbstractJpaIntegrationTe .isFalse(); } - @Test - @Description("Verify that a user that has authority READ_REPOSITORY, UPDATE_REPOSITORY, UPDATE_ROLLOUT and UPDATE_TARGET is allowed to invalidate a distribution") - @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY", "UPDATE_TARGET", "UPDATE_ROLLOUT" }) + /** + * Verify that a user that has authority READ_REPOSITORY, UPDATE_REPOSITORY, UPDATE_ROLLOUT and UPDATE_TARGET is allowed to invalidate a distribution + */ + @Test @WithUser(authorities = { "READ_REPOSITORY", "UPDATE_REPOSITORY", "UPDATE_TARGET", "UPDATE_ROLLOUT" }) void verifyInvalidateWithReadAndUpdateRepoAndUpdateTargetAndUpdateRolloutAuthority() { final InvalidationTestData invalidationTestData = systemSecurityContext.runAsSystem( () -> createInvalidationTestData("verifyInvalidateWithUpdateRepoAndUpdateTargetAuthority")); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementSecurityTest.java index 149d93579..686611676 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.eclipse.hawkbit.repository.builder.DistributionSetCreate; @@ -24,8 +21,10 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetFilter; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - DistributionSetManagement") -@Story("SecurityTests DistributionSetManagement") +/** + * Feature: SecurityTests - DistributionSetManagement
+ * Story: SecurityTests DistributionSetManagement + */ class DistributionSetManagementSecurityTest extends AbstractRepositoryManagementSecurityTest { @@ -45,29 +44,33 @@ class DistributionSetManagementSecurityTest .description("a new description").version("a new version").requiredMigrationStep(true); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignSoftwareModulesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignSoftwareModulesPermissionsCheck() { assertPermissions(() -> distributionSetManagement.assignSoftwareModules(1L, List.of(1L)), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignTagPermissionsCheck() { assertPermissions(() -> distributionSetManagement.assignTag(List.of(1L), 1L), List.of(SpPermission.UPDATE_REPOSITORY, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests that the method throws InsufficientPermissionException when the user does not have the correct permission") - void unassignTagPermissionsCheck() { + /** + * Tests that the method throws InsufficientPermissionException when the user does not have the correct permission + */ + @Test void unassignTagPermissionsCheck() { assertPermissions(() -> distributionSetManagement.unassignTag(List.of(1L), 1L), List.of(SpPermission.UPDATE_REPOSITORY, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createMetadataPermissionsCheck() { assertPermissions( () -> { distributionSetManagement.createMetadata(1L, Map.of("key", "value")); @@ -76,15 +79,17 @@ class DistributionSetManagementSecurityTest List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getMetadataPermissiosCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getMetadataPermissiosCheck() { assertPermissions(() -> distributionSetManagement.getMetadata(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updateMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updateMetadataPermissionsCheck() { assertPermissions(() -> { distributionSetManagement.updateMetadata(1L,"key", "value"); return null; @@ -92,146 +97,168 @@ class DistributionSetManagementSecurityTest List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteMetadataPermissionsCheck() { assertPermissions(() -> { distributionSetManagement.deleteMetadata(1L, "key"); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void lockPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void lockPermissionsCheck() { assertPermissions(() -> { distributionSetManagement.lock(1L); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unlockPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unlockPermissionsCheck() { assertPermissions(() -> { distributionSetManagement.unlock(1L); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByActionPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByAction(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getWithDetailsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getWithDetailsPermissionsCheck() { assertPermissions(() -> distributionSetManagement.getWithDetails(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNameAndVersionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNameAndVersionPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByNameAndVersion("name", "version"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getValidAndCompletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getValidAndCompletePermissionsCheck() { assertPermissions(() -> distributionSetManagement.getValidAndComplete(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getValidPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getValidPermissionsCheck() { assertPermissions(() -> distributionSetManagement.getValid(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getOrElseThrowExceptionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getOrElseThrowExceptionPermissionsCheck() { assertPermissions(() -> distributionSetManagement.getOrElseThrowException(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByCompletedPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByCompletedPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByCompleted(true, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByCompletedPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByCompletedPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countByCompleted(true), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByDistributionSetFilterPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByDistributionSetFilterPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByDistributionSetFilter(DistributionSetFilter.builder().build(), PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByDistributionSetFilterPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByDistributionSetFilterPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countByDistributionSetFilter(DistributionSetFilter.builder().build()), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTagPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByTag(1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlAndTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlAndTagPermissionsCheck() { assertPermissions(() -> distributionSetManagement.findByRsqlAndTag("rsql", 1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void isInUsePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void isInUsePermissionsCheck() { assertPermissions(() -> distributionSetManagement.isInUse(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignSoftwareModulePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignSoftwareModulePermissionsCheck() { assertPermissions(() -> distributionSetManagement.unassignSoftwareModule(1L, 1L), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByTypeIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByTypeIdPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countByTypeId(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countRolloutsByStatusForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countRolloutsByStatusForDistributionSetPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countRolloutsByStatusForDistributionSet(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countActionsByStatusForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countActionsByStatusForDistributionSetPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countActionsByStatusForDistributionSet(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countAutoAssignmentsForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countAutoAssignmentsForDistributionSetPermissionsCheck() { assertPermissions(() -> distributionSetManagement.countAutoAssignmentsForDistributionSet(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void invalidatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void invalidatePermissionsCheck() { distributionSetTypeManagement.create(entityFactory.distributionSetType().create().key("type").name("name")); assertPermissions(() -> { distributionSetManagement.invalidate(entityFactory.distributionSet().create().name("name").version("1.0").type("type").build()); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementTest.java index 98e54d48c..730df8c22 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetManagementTest.java @@ -28,10 +28,6 @@ import java.util.stream.Stream; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.assertj.core.api.Condition; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.RepositoryProperties; @@ -73,9 +69,10 @@ import org.springframework.beans.factory.annotation.Autowired; /** * {@link DistributionSetManagement} tests. + *

+ * Feature: Component Tests - Repository
+ * Story: DistributionSet Management */ -@Feature("Component Tests - Repository") -@Story("DistributionSet Management") class DistributionSetManagementTest extends AbstractJpaIntegrationTest { private static final String TAG1_NAME = "Tag1"; @@ -83,9 +80,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { @Autowired RepositoryProperties repositoryProperties; - @Test - @Description("Verifies that management get access react as specified on calls for non existing entities by means of Optional not present.") - @ExpectEvents({ + /** + * Verifies that management get access react as specified on calls for non existing entities by means of Optional not present. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3) }) void nonExistingEntityAccessReturnsNotPresent() { @@ -96,9 +94,11 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.getMetadata(set.getId()).get(NOT_EXIST_ID)).isNull(); } + /** + * Verifies that management queries react as specified on calls for non existing entities by means of + * throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities by means of " + - "throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = DistributionSetTagCreatedEvent.class, count = 1), @@ -165,9 +165,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> distributionSetManagement.getValid(NOT_EXIST_IDL), "DistributionSet"); } - @Test - @Description("Verify that a DistributionSet with invalid properties cannot be created or updated") - @ExpectEvents({ + /** + * Verify that a DistributionSet with invalid properties cannot be created or updated + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @Expect(type = DistributionSetUpdatedEvent.class) }) @@ -179,18 +180,20 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { createAndUpdateDistributionSetWithInvalidVersion(set); } - @Test - @Description("Ensures that it is not possible to create a DS that already exists (unique constraint is on name,version for DS).") - void createDuplicateDistributionSetsFailsWithException() { + /** + * Ensures that it is not possible to create a DS that already exists (unique constraint is on name,version for DS). + */ + @Test void createDuplicateDistributionSetsFailsWithException() { testdataFactory.createDistributionSet("a"); assertThatThrownBy(() -> testdataFactory.createDistributionSet("a")) .isInstanceOf(EntityAlreadyExistsException.class); } - @Test - @Description("Verifies that a DS is of default type if not specified explicitly at creation time.") - void createDistributionSetWithImplicitType() { + /** + * Verifies that a DS is of default type if not specified explicitly at creation time. + */ + @Test void createDistributionSetWithImplicitType() { final DistributionSet set = distributionSetManagement .create(entityFactory.distributionSet().create().name("newtypesoft").version("1")); @@ -200,18 +203,20 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verifies that a DS cannot be created if another DS with same name and version exists.") - void createDistributionSetWithDuplicateNameAndVersionFails() { + /** + * Verifies that a DS cannot be created if another DS with same name and version exists. + */ + @Test void createDistributionSetWithDuplicateNameAndVersionFails() { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create().name("newtypesoft").version("1"); distributionSetManagement.create(distributionSetCreate); assertThatExceptionOfType(EntityAlreadyExistsException.class).isThrownBy(() -> distributionSetManagement.create(distributionSetCreate)); } - @Test - @Description("Verifies that multiple DS are of default type if not specified explicitly at creation time.") - void createMultipleDistributionSetsWithImplicitType() { + /** + * Verifies that multiple DS are of default type if not specified explicitly at creation time. + */ + @Test void createMultipleDistributionSetsWithImplicitType() { final List creates = new ArrayList<>(10); for (int i = 0; i < 10; i++) { creates.add(entityFactory.distributionSet().create().name("newtypesoft" + i).version("1" + i)); @@ -228,9 +233,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Checks that metadata for a distribution set can be created.") - void createMetadata() { + /** + * Checks that metadata for a distribution set can be created. + */ + @Test void createMetadata() { final String knownKey = "dsMetaKnownKey"; final String knownValue = "dsMetaKnownValue"; @@ -239,9 +245,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { insertMetadata(knownKey, knownValue, ds); // and validate } - @Test - @Description("Verifies the enforcement of the metadata quota per distribution set.") - void createMetadataUntilQuotaIsExceeded() { + /** + * Verifies the enforcement of the metadata quota per distribution set. + */ + @Test void createMetadataUntilQuotaIsExceeded() { // add meta data one by one final DistributionSet ds1 = testdataFactory.createDistributionSet("ds1"); @@ -283,9 +290,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.createMetadata(ds3Id, metaData3)); } - @Test - @Description("Ensures that distribution sets can assigned and unassigned to a distribution set tag.") - void assignAndUnassignDistributionSetToTag() { + /** + * Ensures that distribution sets can assigned and unassigned to a distribution set tag. + */ + @Test void assignAndUnassignDistributionSetToTag() { final List assignDS = new ArrayList<>(4); for (int i = 0; i < 4; i++) { assignDS.add(testdataFactory.createDistributionSet("DS" + i, "1.0", Collections.emptyList()).getId()); @@ -319,9 +327,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .getNumberOfElements()).as("ds tag ds has wrong ds size").isEqualTo(3); } - @Test - @Description("Ensures that updates concerning the internal software structure of a DS are not possible if the DS is already assigned.") - void updateDistributionSetForbiddenWithIllegalUpdate() { + /** + * Ensures that updates concerning the internal software structure of a DS are not possible if the DS is already assigned. + */ + @Test void updateDistributionSetForbiddenWithIllegalUpdate() { // prepare data final Target target = testdataFactory.createTarget(); @@ -348,9 +357,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isInstanceOf(EntityReadOnlyException.class); } - @Test - @Description("Ensures that it is not possible to add a software module that is not defined of the DS's type.") - void updateDistributionSetUnsupportedModuleFails() { + /** + * Ensures that it is not possible to add a software module that is not defined of the DS's type. + */ + @Test void updateDistributionSetUnsupportedModuleFails() { final Long setId = distributionSetManagement.create( entityFactory.distributionSet().create() .type(distributionSetTypeManagement.create( @@ -369,9 +379,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isInstanceOf(UnsupportedSoftwareModuleForThisDistributionSetException.class); } - @Test - @Description("Legal updates of a DS, e.g. name or description and module addition, removal while still unassigned.") - void updateDistributionSet() { + /** + * Legal updates of a DS, e.g. name or description and module addition, removal while still unassigned. + */ + @Test void updateDistributionSet() { // prepare data DistributionSet ds = testdataFactory.createDistributionSet(""); final SoftwareModule os = testdataFactory.createSoftwareModuleOs(); @@ -398,9 +409,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(ds.isRequiredMigrationStep()).isTrue(); } - @Test - @Description("Verifies that an exception is thrown when trying to update an invalid distribution set") - void updateInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to update an invalid distribution set + */ + @Test void updateInvalidDistributionSet() { final DistributionSet distributionSet = testdataFactory.createAndInvalidateDistributionSet(); final DistributionSetUpdate update = entityFactory.distributionSet().update(distributionSet.getId()).name("new_name"); @@ -408,9 +420,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .as("Invalid distributionSet should throw an exception").isThrownBy(() -> distributionSetManagement.update(update)); } - @Test - @Description("Verifies the enforcement of the software module quota per distribution set.") - void assignSoftwareModulesUntilQuotaIsExceeded() { + /** + * Verifies the enforcement of the software module quota per distribution set. + */ + @Test void assignSoftwareModulesUntilQuotaIsExceeded() { // create some software modules final int maxModules = quotaManagement.getMaxSoftwareModulesPerDistributionSet(); @@ -451,9 +464,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verifies that an exception is thrown when trying to assign software modules to an invalidated distribution set.") - void verifyAssignSoftwareModulesToInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to assign software modules to an invalidated distribution set. + */ + @Test void verifyAssignSoftwareModulesToInvalidDistributionSet() { final Long distributionSetId = testdataFactory.createAndInvalidateDistributionSet().getId(); final List softwareModuleIds = List.of(testdataFactory.createSoftwareModuleOs().getId()); @@ -462,9 +476,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.assignSoftwareModules(distributionSetId, softwareModuleIds)); } - @Test - @Description("Verifies that an exception is thrown when trying to unassign a software module from an invalidated distribution set.") - void verifyUnassignSoftwareModulesToInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to unassign a software module from an invalidated distribution set. + */ + @Test void verifyUnassignSoftwareModulesToInvalidDistributionSet() { final Long distributionSetId = testdataFactory.createDistributionSet().getId(); final Long softwareModuleId = testdataFactory.createSoftwareModuleOs().getId(); distributionSetManagement.assignSoftwareModules(distributionSetId, singletonList(softwareModuleId)); @@ -476,9 +491,11 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .unassignSoftwareModule(distributionSetId, softwareModuleId)); } + /** + * Checks that metadata for a distribution set can be updated. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that metadata for a distribution set can be updated.") void updateMetadata() { final String knownKey = "myKnownKey"; final String knownValue = "myKnownValue"; @@ -509,9 +526,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.getMetadata(ds.getId()).get(knownKey)).isEqualTo(knownUpdateValue); } - @Test - @Description("searches for distribution sets based on the various filter options, e.g. name, version, desc., tags.") - void searchDistributionSetsOnFilters() { + /** + * searches for distribution sets based on the various filter options, e.g. name, version, desc., tags. + */ + @Test void searchDistributionSetsOnFilters() { DistributionSetTag dsTagA = distributionSetTagManagement .create(entityFactory.tag().create().name("DistributionSetTag-A")); final DistributionSetTag dsTagB = distributionSetTagManagement @@ -574,17 +592,19 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { validateDeletedAndCompletedAndTypeAndSearchTextAndTag(dsGroup2, dsTagA, dsGroup2Prefix); } - @Test - @Description("Simple DS load without the related data that should be loaded lazy.") - void findDistributionSetsWithoutLazy() { + /** + * Simple DS load without the related data that should be loaded lazy. + */ + @Test void findDistributionSetsWithoutLazy() { testdataFactory.createDistributionSets(20); assertThat(distributionSetManagement.findByCompleted(true, PAGE)).hasSize(20); } - @Test - @Description("Locks a DS.") - void lockDistributionSet() { + /** + * Locks a DS. + */ + @Test void lockDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); assertThat( distributionSetManagement.get(distributionSet.getId()).map(DistributionSet::isLocked).orElse(true)) @@ -599,9 +619,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .orElseThrow().forEach(module -> assertThat(module.isLocked()).isTrue()); } - @Test - @Description("Locked a DS could be hard deleted.") - void deleteUnassignedLockedDistributionSet() { + /** + * Locked a DS could be hard deleted. + */ + @Test void deleteUnassignedLockedDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); distributionSetManagement.lock(distributionSet.getId()); assertThat( @@ -613,9 +634,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.get(distributionSet.getId())).isEmpty(); } - @Test - @Description("Locked an assigned DS could be soft deleted.") - void deleteAssignedLockedDistributionSet() { + /** + * Locked an assigned DS could be soft deleted. + */ + @Test void deleteAssignedLockedDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); distributionSetManagement.lock(distributionSet.getId()); assertThat( @@ -630,9 +652,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.getOrElseThrowException(distributionSet.getId()).isDeleted()).isTrue(); } - @Test - @Description("Unlocks a DS.") - void unlockDistributionSet() { + /** + * Unlocks a DS. + */ + @Test void unlockDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); distributionSetManagement.lock(distributionSet.getId()); assertThat( @@ -650,9 +673,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .orElseThrow().forEach(module -> assertThat(module.isLocked()).isTrue()); } - @Test - @Description("Software modules of a locked DS can't be modified. Expected behaviour is to throw an exception and to do not modify them.") - void lockDistributionSetApplied() { + /** + * Software modules of a locked DS can't be modified. Expected behaviour is to throw an exception and to do not modify them. + */ + @Test void lockDistributionSetApplied() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); final int softwareModuleCount = distributionSet.getModules().size(); assertThat(softwareModuleCount).isNotZero(); @@ -679,9 +703,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .hasSize(softwareModuleCount); } - @Test - @Description("Test implicit locks for a DS and skip tags.") - void isImplicitLockApplicableForDistributionSet() { + /** + * Test implicit locks for a DS and skip tags. + */ + @Test void isImplicitLockApplicableForDistributionSet() { final JpaDistributionSetManagement distributionSetManagement = (JpaDistributionSetManagement) this.distributionSetManagement; final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-non-skip"); // assert that implicit lock is applicable for non skip tags @@ -706,9 +731,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Locks an incomplete DS. Expected behaviour is to throw an exception and to do not lock it.") - void lockIncompleteDistributionSetFails() { + /** + * Locks an incomplete DS. Expected behaviour is to throw an exception and to do not lock it. + */ + @Test void lockIncompleteDistributionSetFails() { final long incompleteDistributionSetId = testdataFactory.createIncompleteDistributionSet().getId(); assertThatExceptionOfType(IncompleteDistributionSetException.class) .as("Locking an incomplete distribution set should throw an exception") @@ -718,9 +744,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isFalse(); } - @Test - @Description("Deletes a DS that is no in use. Expected behaviour is a hard delete on the database.") - void deleteUnassignedDistributionSet() { + /** + * Deletes a DS that is no in use. Expected behaviour is a hard delete on the database. + */ + @Test void deleteUnassignedDistributionSet() { final DistributionSet ds1 = testdataFactory.createDistributionSet("ds-1"); testdataFactory.createDistributionSet("ds-2"); @@ -732,27 +759,30 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.findByCompleted(true, PAGE)).hasSize(1); } - @Test - @Description("Deletes an invalid distribution set") - void deleteInvalidDistributionSet() { + /** + * Deletes an invalid distribution set + */ + @Test void deleteInvalidDistributionSet() { final DistributionSet set = testdataFactory.createAndInvalidateDistributionSet(); assertThat(distributionSetRepository.findById(set.getId())).isNotEmpty(); distributionSetManagement.delete(set.getId()); assertThat(distributionSetRepository.findById(set.getId())).isEmpty(); } - @Test - @Description("Deletes an incomplete distribution set") - void deleteIncompleteDistributionSet() { + /** + * Deletes an incomplete distribution set + */ + @Test void deleteIncompleteDistributionSet() { final DistributionSet set = testdataFactory.createIncompleteDistributionSet(); assertThat(distributionSetRepository.findById(set.getId())).isNotEmpty(); distributionSetManagement.delete(set.getId()); assertThat(distributionSetRepository.findById(set.getId())).isEmpty(); } - @Test - @Description("Queries and loads the metadata related to a given distribution set.") - void getMetadata() { + /** + * Queries and loads the metadata related to a given distribution set. + */ + @Test void getMetadata() { // create a DS final DistributionSet ds1 = testdataFactory.createDistributionSet("testDs1"); final DistributionSet ds2 = testdataFactory.createDistributionSet("testDs2"); @@ -769,9 +799,11 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.getMetadata(ds2.getId())).hasSize(quotaManagement.getMaxMetaDataEntriesPerDistributionSet() - 1); } + /** + * Deletes a DS that is in use by either target assignment or rollout. Expected behaviour is a soft delete on the database, i.e. only marked as + * deleted, kept as reference but unavailable for future use.. + */ @Test - @Description("Deletes a DS that is in use by either target assignment or rollout. Expected behaviour is a soft delete on the database, i.e. only marked as " - + "deleted, kept as reference but unavailable for future use..") void deleteAssignedDistributionSet() { testdataFactory.createDistributionSet("ds-1"); testdataFactory.createDistributionSet("ds-2"); @@ -797,9 +829,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.count()).isEqualTo(2); } - @Test - @Description("Verify that the find all by ids contains the entities which are looking for") - @ExpectEvents({ + /** + * Verify that the find all by ids contains the entities which are looking for + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 12), @Expect(type = SoftwareModuleCreatedEvent.class, count = 36) }) void verifyFindDistributionSetAllById() { @@ -819,9 +852,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(collect).containsAll(searchIds); } - @Test - @Description("Verify that an exception is thrown when trying to get an invalid distribution set") - void verifyGetValid() { + /** + * Verify that an exception is thrown when trying to get an invalid distribution set + */ + @Test void verifyGetValid() { final Long distributionSetId = testdataFactory.createAndInvalidateDistributionSet().getId(); assertThatExceptionOfType(InvalidDistributionSetException.class) @@ -832,18 +866,20 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.getValidAndComplete(distributionSetId)); } - @Test - @Description("Verify that an exception is thrown when trying to get an incomplete distribution set") - void verifyGetValidAndComplete() { + /** + * Verify that an exception is thrown when trying to get an incomplete distribution set + */ + @Test void verifyGetValidAndComplete() { final Long distributionSetId = testdataFactory.createIncompleteDistributionSet().getId(); assertThatExceptionOfType(IncompleteDistributionSetException.class) .as("Incomplete distributionSet should throw an exception") .isThrownBy(() -> distributionSetManagement.getValidAndComplete(distributionSetId)); } - @Test - @Description("Verify that an exception is thrown when trying to create or update metadata for an invalid distribution set.") - void createMetadataForInvalidDistributionSet() { + /** + * Verify that an exception is thrown when trying to create or update metadata for an invalid distribution set. + */ + @Test void createMetadataForInvalidDistributionSet() { final String knownKey1 = "myKnownKey1"; final String knownKey2 = "myKnownKey2"; final String knownValue = "myKnownValue"; @@ -866,9 +902,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.updateMetadata(dsId, knownKey1, knownUpdateValue)); } - @Test - @Description("Get the Rollouts count by status statistics for a specific Distribution Set") - void getRolloutsCountStatisticsForDistributionSet() { + /** + * Get the Rollouts count by status statistics for a specific Distribution Set + */ + @Test void getRolloutsCountStatisticsForDistributionSet() { DistributionSet ds1 = testdataFactory.createDistributionSet("DS1"); DistributionSet ds2 = testdataFactory.createDistributionSet("DS2"); DistributionSet ds3 = testdataFactory.createDistributionSet("DS3"); @@ -895,9 +932,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { value.getStatus())); } - @Test - @Description("Get the Rollouts count by status statistics for a specific Distribution Set") - void getActionsCountStatisticsForDistributionSet() { + /** + * Get the Rollouts count by status statistics for a specific Distribution Set + */ + @Test void getActionsCountStatisticsForDistributionSet() { final DistributionSet ds = testdataFactory.createDistributionSet("DS"); final DistributionSet ds2 = testdataFactory.createDistributionSet("DS2"); testdataFactory.createTargets("targets", 4); @@ -914,9 +952,10 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { statistics.forEach(statistic -> assertThat(Status.valueOf(String.valueOf(statistic.getName()))).isEqualTo(Status.RUNNING)); } - @Test - @Description("Get the Rollouts count by status statistics for a specific Distribution Set") - void getAutoAssignmentsCountStatisticsForDistributionSet() { + /** + * Get the Rollouts count by status statistics for a specific Distribution Set + */ + @Test void getAutoAssignmentsCountStatisticsForDistributionSet() { DistributionSet ds = testdataFactory.createDistributionSet("DS"); DistributionSet ds2 = testdataFactory.createDistributionSet("DS2"); testdataFactory.createTargets("targets", 4); @@ -930,7 +969,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.countAutoAssignmentsForDistributionSet(ds2.getId())).isNull(); } - @Step private void createAndUpdateDistributionSetWithInvalidDescription(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create().name("a").version("a").description(randomString(513)); @@ -956,7 +994,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.update(distributionSetUpdate2)); } - @Step private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create() .version("a").name(randomString(NamedEntity.NAME_MAX_SIZE + 1)); @@ -991,7 +1028,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.update(distributionSetUpdate3)); } - @Step private void createAndUpdateDistributionSetWithInvalidVersion(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create() .name("a").version(randomString(NamedVersionedEntity.VERSION_MAX_SIZE + 1)); @@ -1016,13 +1052,11 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.update(distributionSetUpdate2)); } - @Step private void validateFindAll(final List expectedDistributionsets) { assertThatFilterContainsOnlyGivenDistributionSets(DistributionSetFilter.builder(), expectedDistributionsets); } - @Step private void validateDeleted(final DistributionSet deletedDistributionSet, final int notDeletedSize) { assertThatFilterContainsOnlyGivenDistributionSets(DistributionSetFilter.builder().isDeleted(Boolean.TRUE), @@ -1032,7 +1066,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { DistributionSetFilter.builder().isDeleted(Boolean.FALSE), notDeletedSize, deletedDistributionSet); } - @Step private void validateCompleted(final DistributionSet dsIncomplete, final int completedSize) { assertThatFilterHasSizeAndDoesNotContainDistributionSet( @@ -1042,7 +1075,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { DistributionSetFilter.builder().isComplete(Boolean.FALSE), singletonList(dsIncomplete)); } - @Step private void validateType(final DistributionSetType newType, final DistributionSet dsNewType, final int standardDsTypeSize) { assertThatFilterContainsOnlyGivenDistributionSets(DistributionSetFilter.builder().typeId(newType.getId()), @@ -1051,7 +1083,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { DistributionSetFilter.builder().typeId(standardDsType.getId()), standardDsTypeSize, dsNewType); } - @Step private void validateSearchText(final List allDistributionSets, final String dsNamePrefix) { final List withTestNamePrefix = allDistributionSets.stream() @@ -1093,7 +1124,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { allDistributionSets); } - @Step private void validateTags(final DistributionSetTag dsTagA, final DistributionSetTag dsTagB, final DistributionSetTag dsTagC, final List dsWithTagA, final List dsWithTagB) { @@ -1116,7 +1146,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { DistributionSetFilter.builder().tagNames(singletonList(dsTagC.getName()))); } - @Step private void validateDeletedAndCompleted(final List completedStandardType, final DistributionSet dsNewType, final DistributionSet dsDeleted) { @@ -1134,7 +1163,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { DistributionSetFilter.builder().isComplete(Boolean.FALSE).isDeleted(Boolean.TRUE)); } - @Step private void validateDeletedAndCompletedAndType(final List deletedAndCompletedAndStandardType, final DistributionSet dsDeleted, final DistributionSetType newType, final DistributionSet dsNewType) { assertThatFilterContainsOnlyGivenDistributionSets(DistributionSetFilter.builder().isDeleted(Boolean.FALSE) @@ -1148,7 +1176,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { singletonList(dsNewType)); } - @Step private void validateDeletedAndCompletedAndTypeAndSearchText( final List completedAndStandardTypeAndSearchText, final DistributionSetType newType, final String text) { @@ -1168,7 +1195,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { .searchText(text).isComplete(Boolean.TRUE).isDeleted(Boolean.FALSE)); } - @Step private void validateDeletedAndCompletedAndTypeAndSearchText( final List completedAndNotDeletedStandardTypeAndFilterString, final DistributionSet dsDeleted, final DistributionSet dsInComplete, final DistributionSet dsNewType, @@ -1200,7 +1226,6 @@ class DistributionSetManagementTest extends AbstractJpaIntegrationTest { singletonList(dsNewType)); } - @Step private void validateDeletedAndCompletedAndTypeAndSearchTextAndTag( final List completedAndStandartTypeAndSearchTextAndTagA, final DistributionSetTag dsTagA, final String text) { diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementSecurityTest.java index 91e1a2249..4e333b32d 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.eclipse.hawkbit.repository.builder.TagCreate; @@ -24,8 +21,10 @@ import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Pageable; -@Feature("SecurityTests - DistributionSetTagManagement") -@Story("SecurityTests DistributionSetTagManagement") +/** + * Feature: SecurityTests - DistributionSetTagManagement
+ * Story: SecurityTests DistributionSetTagManagement + */ class DistributionSetTagManagementSecurityTest extends AbstractRepositoryManagementSecurityTest { @Override @@ -43,22 +42,25 @@ class DistributionSetTagManagementSecurityTest extends AbstractRepositoryManagem return entityFactory.tag().update(1L).name("tag"); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNameWitPermissionWorks() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNameWitPermissionWorks() { assertPermissions(() -> distributionSetTagManagement.findByName("tagName"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByDistributionSetPermissionsCheck() { assertPermissions(() -> distributionSetTagManagement.findByDistributionSet(1L, Pageable.unpaged()), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteDistributionSetTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteDistributionSetTagPermissionsCheck() { assertPermissions(() -> { distributionSetTagManagement.delete("tagName"); return null; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementTest.java index e9f80a4be..1a5689b21 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTagManagementTest.java @@ -21,10 +21,6 @@ import java.util.List; import java.util.Random; import java.util.stream.Stream; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.DistributionSetTagManagement; import org.eclipse.hawkbit.repository.builder.TagCreate; import org.eclipse.hawkbit.repository.builder.TagUpdate; @@ -45,24 +41,28 @@ import org.springframework.data.domain.Pageable; /** * {@link DistributionSetTagManagement} tests. + *

+ * Feature: Component Tests - Repository
+ * Story: DistributionSet Tag Management */ -@Feature("Component Tests - Repository") -@Story("DistributionSet Tag Management") class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { private static final Random RND = new Random(); - @Test - @Description("Verifies that management get access reacts as specified on calls for non existing entities by means of Optional not present.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Verifies that management get access reacts as specified on calls for non existing entities by means of Optional not present. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(distributionSetTagManagement.findByName(NOT_EXIST_ID)).isNotPresent(); assertThat(distributionSetTagManagement.get(NOT_EXIST_IDL)).isNotPresent(); } + /** + * Verifies that management queries react as specified on calls for non existing entities by means of throwing + * EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities by means of throwing " + - "EntityNotFoundException.") @ExpectEvents({ @Expect(type = DistributionSetTagUpdatedEvent.class, count = 0), @Expect(type = TargetTagUpdatedEvent.class, count = 0) }) @@ -74,9 +74,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { "DistributionSetTag"); } - @Test - @Description("Full DS tag lifecycle tested. Create tags, assign them to sets and delete the tags.") - void createAndAssignAndDeleteDistributionSetTags() { + /** + * Full DS tag lifecycle tested. Create tags, assign them to sets and delete the tags. + */ + @Test void createAndAssignAndDeleteDistributionSetTags() { final Collection dsAs = testdataFactory.createDistributionSets("DS-A", 20); final Collection dsBs = testdataFactory.createDistributionSets("DS-B", 10); final Collection dsCs = testdataFactory.createDistributionSets("DS-C", 25); @@ -136,9 +137,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { Stream.of(dsCs, dsACs, dsBCs, dsABCs)); } - @Test - @Description("Verifies assign/unassign.") - void assignAndUnassignDistributionSetTags() { + /** + * Verifies assign/unassign. + */ + @Test void assignAndUnassignDistributionSetTags() { final Collection groupA = testdataFactory.createDistributionSets(20); final Collection groupB = testdataFactory.createDistributionSets("unassigned", 20); @@ -176,9 +178,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetManagement.findByTag(tag.getId(), Pageable.unpaged()).getContent()).isEmpty(); } - @Test - @Description("Verifies that tagging of set containing missing DS throws meaningful and correct exception.") - void failOnMissingDs() { + /** + * Verifies that tagging of set containing missing DS throws meaningful and correct exception. + */ + @Test void failOnMissingDs() { final Collection group = testdataFactory.createDistributionSets(5).stream().map(DistributionSet::getId).toList(); final DistributionSetTag tag = distributionSetTagManagement.create(entityFactory.tag().create().name("tag1").description("tagdesc1")); final List missing = new ArrayList<>(); @@ -204,9 +207,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Ensures that a created tag is persisted in the repository as defined.") - void createDistributionSetTag() { + /** + * Ensures that a created tag is persisted in the repository as defined. + */ + @Test void createDistributionSetTag() { final Tag tag = distributionSetTagManagement .create(entityFactory.tag().create().name("kai1").description("kai2").colour("colour")); @@ -218,9 +222,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { .isEqualTo("colour"); } - @Test - @Description("Ensures that a deleted tag is removed from the repository as defined.") - void deleteDistributionSetTag() { + /** + * Ensures that a deleted tag is removed from the repository as defined. + */ + @Test void deleteDistributionSetTag() { // create test data final Iterable tags = createDsSetsWithTags(); final DistributionSetTag toDelete = tags.iterator().next(); @@ -245,9 +250,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException).") - void failedDuplicateDsTagNameException() { + /** + * Ensures that a tag cannot be created if one exists already with that name (ecpects EntityAlreadyExistsException). + */ + @Test void failedDuplicateDsTagNameException() { final TagCreate tag = entityFactory.tag().create().name("A"); distributionSetTagManagement.create(tag); @@ -255,9 +261,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetTagManagement.create(tag)); } - @Test - @Description("Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException).") - void failedDuplicateDsTagNameExceptionAfterUpdate() { + /** + * Ensures that a tag cannot be updated to a name that already exists on another tag (ecpects EntityAlreadyExistsException). + */ + @Test void failedDuplicateDsTagNameExceptionAfterUpdate() { distributionSetTagManagement.create(entityFactory.tag().create().name("A")); final DistributionSetTag tag = distributionSetTagManagement.create(entityFactory.tag().create().name("B")); @@ -266,9 +273,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetTagManagement.update(tagUpdate)); } - @Test - @Description("Tests the name update of a target tag.") - void updateDistributionSetTag() { + /** + * Tests the name update of a target tag. + */ + @Test void updateDistributionSetTag() { // create test data final List tags = createDsSetsWithTags(); // change data @@ -282,9 +290,10 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { .as("Wrong ds tag found").isEqualTo("test123"); } - @Test - @Description("Ensures that all tags are retrieved through repository.") - void findDistributionSetTagsAll() { + /** + * Ensures that all tags are retrieved through repository. + */ + @Test void findDistributionSetTagsAll() { final List tags = createDsSetsWithTags(); // test @@ -293,14 +302,14 @@ class DistributionSetTagManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags").hasSize(20); } - @Test - @Description("Ensures that a created tags are persisted in the repository as defined.") - void createDistributionSetTags() { + /** + * Ensures that a created tags are persisted in the repository as defined. + */ + @Test void createDistributionSetTags() { final List tags = createDsSetsWithTags(); assertThat(distributionSetTagRepository.findAll()).as("Wrong size of tags created").hasSize(tags.size()); } - @Step private void verifyExpectedFilteredDistributionSets(final DistributionSetFilter.DistributionSetFilterBuilder distributionSetFilterBuilder, final Stream> expectedFilteredDistributionSets) { final Collection retrievedFilteredDsIds = distributionSetManagement diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementSecurityTest.java index b05c73415..112d92b18 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.eclipse.hawkbit.repository.builder.DistributionSetTypeCreate; @@ -23,8 +20,10 @@ import org.eclipse.hawkbit.repository.jpa.AbstractRepositoryManagementSecurityTe import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - DistributionSetTypeManagement") -@Story("SecurityTests DistributionSetTypeManagement") +/** + * Feature: SecurityTests - DistributionSetTypeManagement
+ * Story: SecurityTests DistributionSetTypeManagement + */ class DistributionSetTypeManagementSecurityTest extends AbstractRepositoryManagementSecurityTest { @@ -43,35 +42,40 @@ class DistributionSetTypeManagementSecurityTest return entityFactory.distributionSetType().update(1L).description("description"); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByKeyPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByKeyPermissionsCheck() { assertPermissions(() -> distributionSetTypeManagement.findByKey("key"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNamePermissionsCheck() { assertPermissions(() -> distributionSetTypeManagement.findByName("name"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignOptionalSoftwareModuleTypesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignOptionalSoftwareModuleTypesPermissionsCheck() { assertPermissions(() -> distributionSetTypeManagement.assignOptionalSoftwareModuleTypes(1L, List.of(1L)), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignMandatorySoftwareModuleTypesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignMandatorySoftwareModuleTypesPermissionsCheck() { assertPermissions(() -> distributionSetTypeManagement.assignMandatorySoftwareModuleTypes(1L, List.of(1L)), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignSoftwareModuleTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignSoftwareModuleTypePermissionsCheck() { assertPermissions(() -> distributionSetTypeManagement.unassignSoftwareModuleType(1L, 1L), List.of(SpPermission.UPDATE_REPOSITORY)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementTest.java index 882f76d94..50cd6cd53 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/DistributionSetTypeManagementTest.java @@ -21,10 +21,6 @@ import java.util.Set; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.builder.DistributionSetCreate; import org.eclipse.hawkbit.repository.builder.DistributionSetUpdate; @@ -48,14 +44,17 @@ import org.junit.jupiter.api.Test; /** * {@link DistributionSetManagement} tests. + *

+ * Feature: Component Tests - Repository
+ * Story: DistributionSet Management */ -@Feature("Component Tests - Repository") -@Story("DistributionSet Management") class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { + /** + * Verifies that management get access react as specfied on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access react as specfied on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 0) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(distributionSetTypeManagement.get(NOT_EXIST_IDL)).isNotPresent(); @@ -63,9 +62,11 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetTypeManagement.findByName(NOT_EXIST_ID)).isNotPresent(); } + /** + * Verifies that management queries react as specfied on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 0), @Expect(type = DistributionSetTypeCreatedEvent.class, count = 1) }) @@ -93,9 +94,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { "DistributionSet"); } - @Test - @Description("Verify that a DistributionSet with invalid properties cannot be created or updated") - @ExpectEvents({ + /** + * Verify that a DistributionSet with invalid properties cannot be created or updated + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @Expect(type = DistributionSetUpdatedEvent.class, count = 0) }) @@ -107,9 +109,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { createAndUpdateDistributionSetWithInvalidVersion(set); } - @Test - @Description("Tests the successful module update of unused distribution set type which is in fact allowed.") - void updateUnassignedDistributionSetTypeModules() { + /** + * Tests the successful module update of unused distribution set type which is in fact allowed. + */ + @Test void updateUnassignedDistributionSetTypeModules() { final DistributionSetType updatableType = distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("updatableType").name("to be deleted")); assertThat(distributionSetTypeManagement.findByKey("updatableType").get().getMandatoryModuleTypes()).isEmpty(); @@ -132,9 +135,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { .containsOnly(runtimeType); } - @Test - @Description("Verifies that the quota for software module types per distribution set type is enforced as expected.") - void quotaMaxSoftwareModuleTypes() { + /** + * Verifies that the quota for software module types per distribution set type is enforced as expected. + */ + @Test void quotaMaxSoftwareModuleTypes() { final int quota = quotaManagement.getMaxSoftwareModuleTypesPerDistributionSetType(); // create software module types final List moduleTypeIds = new ArrayList<>(); @@ -179,9 +183,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Tests the successfull update of used distribution set type meta data which is in fact allowed.") - void updateAssignedDistributionSetTypeMetaData() { + /** + * Tests the successfull update of used distribution set type meta data which is in fact allowed. + */ + @Test void updateAssignedDistributionSetTypeMetaData() { final DistributionSetType nonUpdatableType = createDistributionSetTypeUsedByDs(); distributionSetTypeManagement.update( @@ -192,9 +197,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetTypeManagement.findByKey("updatableType").get().getColour()).isEqualTo("test123"); } - @Test - @Description("Tests the unsuccessful update of used distribution set type (module addition).") - void addModuleToAssignedDistributionSetTypeFails() { + /** + * Tests the unsuccessful update of used distribution set type (module addition). + */ + @Test void addModuleToAssignedDistributionSetTypeFails() { final Long nonUpdatableTypeId = createDistributionSetTypeUsedByDs().getId(); final Set osTypeId = Set.of(osType.getId()); assertThatThrownBy(() -> distributionSetTypeManagement @@ -202,9 +208,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { .isInstanceOf(EntityReadOnlyException.class); } - @Test - @Description("Tests the unsuccessful update of used distribution set type (module removal).") - void removeModuleToAssignedDistributionSetTypeFails() { + /** + * Tests the unsuccessful update of used distribution set type (module removal). + */ + @Test void removeModuleToAssignedDistributionSetTypeFails() { DistributionSetType nonUpdatableType = distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("updatableType").name("to be deleted")); assertThat(distributionSetTypeManagement.findByKey("updatableType").get().getMandatoryModuleTypes()).isEmpty(); @@ -219,9 +226,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { .isInstanceOf(EntityReadOnlyException.class); } - @Test - @Description("Tests the successfull deletion of unused (hard delete) distribution set types.") - void deleteUnassignedDistributionSetType() { + /** + * Tests the successfull deletion of unused (hard delete) distribution set types. + */ + @Test void deleteUnassignedDistributionSetType() { final JpaDistributionSetType hardDelete = (JpaDistributionSetType) distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("delete").name("to be deleted")); @@ -231,9 +239,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetTypeRepository.findAll()).doesNotContain(hardDelete); } - @Test - @Description("Tests the successfull deletion of used (soft delete) distribution set types.") - void deleteAssignedDistributionSetType() { + /** + * Tests the successfull deletion of used (soft delete) distribution set types. + */ + @Test void deleteAssignedDistributionSetType() { final int existing = (int) distributionSetTypeManagement.count(); final JpaDistributionSetType toBeDeleted = (JpaDistributionSetType) distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("softdeleted").name("to be deleted")); @@ -251,9 +260,10 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(distributionSetTypeManagement.count()).isEqualTo(existing); } - @Test - @Description("Verifies that when no SoftwareModules are assigned to a Distribution then the DistributionSet is not complete.") - void shouldFailWhenDistributionSetHasNoSoftwareModulesAssigned() { + /** + * Verifies that when no SoftwareModules are assigned to a Distribution then the DistributionSet is not complete. + */ + @Test void shouldFailWhenDistributionSetHasNoSoftwareModulesAssigned() { final JpaDistributionSetType jpaDistributionSetType = (JpaDistributionSetType) distributionSetTypeManagement .create(entityFactory.distributionSetType().create().key("newType").name("new Type")); @@ -266,7 +276,6 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(jpaDistributionSetType.checkComplete(distributionSet)).isFalse(); } - @Step private void createAndUpdateDistributionSetWithInvalidDescription(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create() .name("a").version("a").description(randomString(513)); @@ -292,7 +301,6 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.update(distributionSetUpdate2)); } - @Step private void createAndUpdateDistributionSetWithInvalidName(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create() .version("a").name(randomString(NamedEntity.NAME_MAX_SIZE + 1)); @@ -332,7 +340,6 @@ class DistributionSetTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> distributionSetManagement.update(distributionSetUpdate3)); } - @Step private void createAndUpdateDistributionSetWithInvalidVersion(final DistributionSet set) { final DistributionSetCreate distributionSetCreate = entityFactory.distributionSet().create() .name("a").version(randomString(NamedVersionedEntity.VERSION_MAX_SIZE + 1)); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/LazyControllerManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/LazyControllerManagementTest.java index 0004d32d9..3b4f7232d 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/LazyControllerManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/LazyControllerManagementTest.java @@ -13,9 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.concurrent.TimeUnit; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.RepositoryProperties; import org.eclipse.hawkbit.repository.event.remote.TargetPollEvent; import org.eclipse.hawkbit.repository.event.remote.entity.TargetCreatedEvent; @@ -27,8 +24,10 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.TestPropertySource; -@Feature("Component Tests - Repository") -@Story("Controller Management") +/** + * Feature: Component Tests - Repository
+ * Story: Controller Management + */ @TestPropertySource(locations = "classpath:/jpa-test.properties", properties = { "hawkbit.server.repository.eagerPollPersistence=false", "hawkbit.server.repository.pollPersistenceFlushTime=1000" }) @@ -37,9 +36,10 @@ class LazyControllerManagementTest extends AbstractJpaIntegrationTest { @Autowired private RepositoryProperties repositoryProperties; - @Test - @Description("Verifies that lazy target poll update is executed as specified.") - @ExpectEvents({ + /** + * Verifies that lazy target poll update is executed as specified. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 2) }) void lazyFindOrRegisterTargetIfItDoesNotExist() throws InterruptedException { diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementSecurityTest.java index 5fd16ce13..2a18eef20 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementSecurityTest.java @@ -11,77 +11,86 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - RolloutGroupManagement") -@Story("SecurityTests RolloutGroupManagement") +/** + * Feature: SecurityTests - RolloutGroupManagement
+ * Story: SecurityTests RolloutGroupManagement + */ class RolloutGroupManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.get(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.getWithDetailedStatus(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRolloutPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRolloutPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.countByRollout(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countTargetsOfRolloutsGroupPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countTargetsOfRolloutsGroupPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.countTargetsOfRolloutsGroup(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRolloutPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRolloutPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRollout(1L, PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRolloutAndRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRolloutAndRsqlPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRolloutAndRsql(1L, "name==*", PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findTargetsOfRolloutGroupPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findTargetsOfRolloutGroupPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findTargetsOfRolloutGroup(1L, PAGE), List.of(SpPermission.READ_ROLLOUT, SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findTargetsOfRolloutGroupByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findTargetsOfRolloutGroupByRsqlPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findTargetsOfRolloutGroupByRsql(1L, "name==*", PAGE), List.of(SpPermission.READ_ROLLOUT, SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRolloutAndRsqlWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRolloutAndRsqlWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRolloutAndRsqlWithDetailedStatus(1L, "name==*", PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRolloutWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRolloutWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRolloutWithDetailedStatus(1L, PAGE), List.of(SpPermission.READ_ROLLOUT)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementTest.java index 594f3e641..ce46e4dc5 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutGroupManagementTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.event.remote.RolloutDeletedEvent; import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetCreatedEvent; import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetUpdatedEvent; @@ -31,22 +28,28 @@ import org.eclipse.hawkbit.repository.test.matcher.Expect; import org.eclipse.hawkbit.repository.test.matcher.ExpectEvents; import org.junit.jupiter.api.Test; -@Feature("Component Tests - Repository") -@Story("Rollout Management") +/** + * Feature: Component Tests - Repository
+ * Story: Rollout Management + */ class RolloutGroupManagementTest extends AbstractJpaIntegrationTest { + /** + * Verifies that management get access reacts as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access reacts as specified on calls for non existing entities by means " + - "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(rolloutGroupManagement.get(NOT_EXIST_IDL)).isNotPresent(); assertThat(rolloutGroupManagement.getWithDetailedStatus(NOT_EXIST_IDL)).isNotPresent(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " + - " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = RolloutCreatedEvent.class, count = 1), @Expect(type = RolloutUpdatedEvent.class, count = 1), @@ -70,9 +73,10 @@ class RolloutGroupManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> rolloutGroupManagement.findTargetsOfRolloutGroupByRsql(NOT_EXIST_IDL, "name==*", PAGE), "RolloutGroup"); } - @Test - @Description("Tests the rollout group status mapping.") - void testRolloutGroupStatusConvert() { + /** + * Tests the rollout group status mapping. + */ + @Test void testRolloutGroupStatusConvert() { final long id = rolloutGroupRepository.findByRolloutId( testdataFactory.createAndStartRollout(1, 0, 1, "100", "80").getId(), PAGE).getContent() .get(0).getId(); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementFlowTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementFlowTest.java index f5e7c4556..169c9e4d6 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementFlowTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementFlowTest.java @@ -14,9 +14,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.builder.DynamicRolloutGroupTemplate; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -35,9 +32,10 @@ import org.springframework.test.context.TestPropertySource; /** * Junit tests for RolloutManagement. + *

+ * Feature: Component Tests - Repository
+ * Story: Rollout Management (Flow) */ -@Feature("Component Tests - Repository") -@Story("Rollout Management (Flow)") @TestPropertySource(properties = { "hawkbit.server.repository.dynamicRolloutsMinInvolvePeriodMS=-1" }) class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { @@ -46,9 +44,10 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { this.approvalStrategy.setApprovalNeeded(false); } - @Test - @Description("Verifies a simple rollout flow") - void rolloutFlow() { + /** + * Verifies a simple rollout flow + */ + @Test void rolloutFlow() { final String rolloutName = "rollout-std"; final int amountGroups = 5; // static only final String targetPrefix = "controller-rollout-std-"; @@ -86,9 +85,10 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { assertAndGetRunning(rollout, 1); // keep running } - @Test - @Description("Verifies a simple dynamic rollout flow") - void dynamicRolloutFlow() { + /** + * Verifies a simple dynamic rollout flow + */ + @Test void dynamicRolloutFlow() { final String rolloutName = "dynamic-rollout-std"; final int amountGroups = 2; // static only final String targetPrefix = "controller-dynamic-rollout-std-"; @@ -200,9 +200,10 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { assertThat(refresh(dynamic2).getStatus()).isEqualTo(RolloutGroupStatus.FINISHED); } - @Test - @Description("Verifies a simple dynamic rollout flow with a dynamic group template") - void dynamicRolloutTemplateFlow() { + /** + * Verifies a simple dynamic rollout flow with a dynamic group template + */ + @Test void dynamicRolloutTemplateFlow() { final String rolloutName = "dynamic-template-rollout-std"; final int amountGroups = 3; // static only final String targetPrefix = "controller-template-dynamic-rollout-std-"; @@ -298,9 +299,10 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { assertGroup(dynamic2, true, RolloutGroupStatus.RUNNING, 4); // assign the target created when paused } - @Test - @Description("Verifies a simple pure (no static groups) dynamic rollout flow with a dynamic group template") - void dynamicRolloutPureFlow() { + /** + * Verifies a simple pure (no static groups) dynamic rollout flow with a dynamic group template + */ + @Test void dynamicRolloutPureFlow() { final String rolloutName = "pure-dynamic-rollout-std"; final String targetPrefix = "controller-pure-dynamic-rollout-std-"; final DistributionSet distributionSet = testdataFactory.createDistributionSet("dsFor" + rolloutName); @@ -379,9 +381,10 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest { assertGroup(dynamic2, true, RolloutGroupStatus.RUNNING, 4); // assign the target created when paused } - @Test - @Description("Verifies a simple rollout flow") - void rollout0ThresholdFlow() { + /** + * Verifies a simple rollout flow + */ + @Test void rollout0ThresholdFlow() { final String rolloutName = "rollout-std-0threshold"; final int amountGroups = 5; // static only final String targetPrefix = "controller-rollout-std-0threshold-"; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementSecurityTest.java index e037cb3a1..76585a310 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementSecurityTest.java @@ -13,9 +13,6 @@ import java.util.List; import jakarta.validation.ConstraintDeclarationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.builder.DistributionSetCreate; @@ -29,63 +26,73 @@ import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - RolloutManagement") -@Story("SecurityTests RolloutManagement") +/** + * Feature: SecurityTests - RolloutManagement
+ * Story: SecurityTests RolloutManagement + */ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getPermissionsCheck() { assertPermissions(() -> rolloutManagement.get(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNamePermissionsCheck() { assertPermissions(() -> rolloutManagement.getByName("name"), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutManagement.getWithDetailedStatus(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void approveOrDenyPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void approveOrDenyPermissionsCheck() { assertPermissions(() -> rolloutManagement.approveOrDeny(1L, Rollout.ApprovalDecision.APPROVED), List.of(SpPermission.APPROVE_ROLLOUT)); assertPermissions(() -> rolloutManagement.approveOrDeny(1L, Rollout.ApprovalDecision.APPROVED, "comment"), List.of(SpPermission.APPROVE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void pauseRolloutPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void pauseRolloutPermissionsCheck() { assertPermissions(() -> { rolloutManagement.pauseRollout(1L); return null; }, List.of(SpPermission.HANDLE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void resumeRolloutPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void resumeRolloutPermissionsCheck() { assertPermissions(() -> { rolloutManagement.resumeRollout(1L); return null; }, List.of(SpPermission.HANDLE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findActiveRolloutsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findActiveRolloutsPermissionsCheck() { assertPermissions(() -> rolloutManagement.findActiveRollouts(), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void cancelRolloutsForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void cancelRolloutsForDistributionSetPermissionsCheck() { final DistributionSetTypeCreate key = entityFactory.distributionSetType().create().name("type").key("type"); distributionSetTypeManagement.create(key); final DistributionSetCreate dsCreate = entityFactory.distributionSet().create().name("name").version("1.0.0").type("type"); @@ -96,21 +103,24 @@ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest { }, List.of(SpPermission.UPDATE_ROLLOUT, SpPermission.READ_REPOSITORY, SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countPermissionsCheck() { assertPermissions(() -> rolloutManagement.count(), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByDistributionSetIdAndRolloutIsStoppablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByDistributionSetIdAndRolloutIsStoppablePermissionsCheck() { assertPermissions(() -> rolloutManagement.countByDistributionSetIdAndRolloutIsStoppable(1L), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionsCheck() { assertPermissions(() -> rolloutManagement.create(entityFactory.rollout().create().distributionSetId(1L), 1, false, new RolloutGroupConditionBuilder().withDefaults().build()), List.of(SpPermission.CREATE_ROLLOUT, SpPermission.READ_REPOSITORY)); assertPermissions(() -> rolloutManagement.create(entityFactory.rollout().create().distributionSetId(1L), 1, false, @@ -123,64 +133,73 @@ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest { List.of(SpPermission.CREATE_ROLLOUT, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllPermissionsCheck() { assertPermissions(() -> rolloutManagement.findAll(false, PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlPermissionsCheck() { assertPermissions(() -> rolloutManagement.findByRsql("id==1", false, PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutManagement.findAllWithDetailedStatus(false, PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutManagement.findByRsqlWithDetailedStatus("name==*", false, PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void startPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void startPermissionsCheck() { assertPermissions(() -> rolloutManagement.start(1L), List.of(SpPermission.HANDLE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionsCheck() { assertPermissions(() -> rolloutManagement.update(entityFactory.rollout().update(1L)), List.of(SpPermission.UPDATE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionsCheck() { assertPermissions(() -> { rolloutManagement.delete(1L); return null; }, List.of(SpPermission.DELETE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void triggerNextGroupPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void triggerNextGroupPermissionsCheck() { assertPermissions(() -> { rolloutManagement.triggerNextGroup(1L); return null; }, List.of(SpPermission.UPDATE_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") -// @WithUser(principal = "user", authorities = { SpPermission.CREATE_TARGET, SpPermission.CREATE_ROLLOUT, SpPermission.READ_ROLLOUT, + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test// @WithUser(principal = "user", authorities = { SpPermission.CREATE_TARGET, SpPermission.CREATE_ROLLOUT, SpPermission.READ_ROLLOUT, // SpPermission.READ_TARGET }) void validateTargetsInGroupsPermissionsCheck() { try { @@ -196,17 +215,19 @@ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - @WithUser(principal = "user", authorities = { SpPermission.READ_ROLLOUT }) + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test @WithUser(principal = "user", authorities = { SpPermission.READ_ROLLOUT }) void findByRolloutAndRsqlWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRolloutAndRsqlWithDetailedStatus(1L, "name==*", PAGE), List.of(SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRolloutWithDetailedStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRolloutWithDetailedStatusPermissionsCheck() { assertPermissions(() -> rolloutGroupManagement.findByRolloutWithDetailedStatus(1L, PAGE), List.of(SpPermission.READ_ROLLOUT)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementTest.java index 846f110bf..d6d926c63 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/RolloutManagementTest.java @@ -28,10 +28,6 @@ import java.util.stream.Stream; import jakarta.validation.ConstraintViolationException; import jakarta.validation.ValidationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.assertj.core.api.Assertions; import org.assertj.core.api.Condition; import org.awaitility.Awaitility; @@ -103,17 +99,19 @@ import org.springframework.data.domain.Sort.Direction; /** * Junit tests for RolloutManagement. + *

+ * Feature: Component Tests - Repository
+ * Story: Rollout Management */ -@Feature("Component Tests - Repository") -@Story("Rollout Management") class RolloutManagementTest extends AbstractJpaIntegrationTest { /** * Tests static assignment aspects of the dynamic group assignment filters. */ - @Test - @Description("Dynamic group doesn't override newer static group assignments") - void dynamicGroupDoesntOverrideItsOrNewerStaticGroups() { + /** + * Dynamic group doesn't override newer static group assignments + */ + @Test void dynamicGroupDoesntOverrideItsOrNewerStaticGroups() { final int amountGroups = 1; // static only final String targetPrefix = "controller-dynamic-rollout-"; final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds"); @@ -175,9 +173,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { this.approvalStrategy.setApprovalNeeded(false); } - @Test - @Description("Verifies that a running action with distribution-set (A) is not canceled by a rollout which tries to also assign a distribution-set (A)") - void rolloutShouldNotCancelRunningActionWithTheSameDistributionSet() { + /** + * Verifies that a running action with distribution-set (A) is not canceled by a rollout which tries to also assign a distribution-set (A) + */ + @Test void rolloutShouldNotCancelRunningActionWithTheSameDistributionSet() { // manually assign distribution set to target final String knownControllerId = "controller12345"; final DistributionSet knownDistributionSet = testdataFactory.createDistributionSet(); @@ -209,9 +208,11 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rolloutCreatedAction.getStatus()).isEqualTo(Status.FINISHED); } + /** + * Verifies that action states are correctly initialized after starting a rollout with different options in regard to the confirmation. + */ @ParameterizedTest @MethodSource("simpleRolloutsPossibilities") - @Description("Verifies that action states are correctly initialized after starting a rollout with different options in regard to the confirmation.") void runRolloutWithConfirmationFlagAndCoonfirmationFlowOptions(final boolean confirmationFlowActive, final boolean confirmationRequired, final Status expectedStatus) { // manually assign distribution set to target @@ -238,9 +239,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(actionsByKnownTarget.get(0).getStatus()).isEqualTo(expectedStatus); } - @Test - @Description("Verifies that a running action is auto canceled by a rollout which assigns another distribution-set.") - void rolloutAssignsNewDistributionSetAndAutoCloseActiveActions() { + /** + * Verifies that a running action is auto canceled by a rollout which assigns another distribution-set. + */ + @Test void rolloutAssignsNewDistributionSetAndAutoCloseActiveActions() { tenantConfigurationManagement .addOrUpdateConfiguration(TenantConfigurationKey.REPOSITORY_ACTIONS_AUTOCLOSE_ENABLED, true); @@ -281,9 +283,11 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } + /** + * Verifies that management get access reacts as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access reacts as specified on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(rolloutManagement.get(NOT_EXIST_IDL)).isNotPresent(); @@ -291,9 +295,11 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rolloutManagement.getWithDetailedStatus(NOT_EXIST_IDL)).isNotPresent(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = RolloutDeletedEvent.class, count = 0), @Expect(type = RolloutGroupCreatedEvent.class, count = 5), @@ -319,9 +325,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> rolloutManagement.triggerNextGroup(NOT_EXIST_IDL), "Rollout"); } - @Test - @Description("Verifying that the rollout is created correctly, executing the filter and split up the targets in the correct group size.") - void creatingRolloutIsCorrectPersisted() { + /** + * Verifying that the rollout is created correctly, executing the filter and split up the targets in the correct group size. + */ + @Test void creatingRolloutIsCorrectPersisted() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -338,9 +345,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rolloutGroups).hasSize(amountGroups); } - @Test - @Description("Verifying that when the rollout is started the actions for all targets in the rollout is created and the state of the first group is running as well as the corresponding actions") - void startRolloutSetFirstGroupAndActionsInRunningStateAndOthersInScheduleState() { + /** + * Verifying that when the rollout is started the actions for all targets in the rollout is created and the state of the first group is running as well as the corresponding actions + */ + @Test void startRolloutSetFirstGroupAndActionsInRunningStateAndOthersInScheduleState() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -374,9 +382,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .hasSize(amountTargetsForRollout - (amountTargetsForRollout / amountGroups)); } - @Test - @Description("Verifying that a finish condition of a group is hit the next group of the rollout is also started") - void checkRunningRolloutsDoesNotStartNextGroupIfFinishConditionIsNotHit() { + /** + * Verifying that a finish condition of a group is hit the next group of the rollout is also started + */ + @Test void checkRunningRolloutsDoesNotStartNextGroupIfFinishConditionIsNotHit() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -416,9 +425,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(RolloutGroupStatus.SCHEDULED)); } - @Test - @Description("Verifying that next group is started when targets of the group have been deleted.") - void checkRunningRolloutsStartsNextGroupIfTargetsDeleted() { + /** + * Verifying that next group is started when targets of the group have been deleted. + */ + @Test void checkRunningRolloutsStartsNextGroupIfTargetsDeleted() { final int amountTargetsForRollout = 15; final int amountOtherTargets = 0; final int amountGroups = 3; @@ -436,9 +446,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { verifyRolloutAndAllGroupsAreFinished(createdRollout); } - @Test - @Description("Verifying that the error handling action of a group is executed to pause the current rollout") - void checkErrorHitOfGroupCallsErrorActionToPauseTheRollout() { + /** + * Verifying that the error handling action of a group is executed to pause the current rollout + */ + @Test void checkErrorHitOfGroupCallsErrorActionToPauseTheRollout() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -480,9 +491,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { scheduleGroups.forEach(group -> assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.SCHEDULED)); } - @Test - @Description("Verifying a paused rollout in case of error action hit can be resumed again") - void errorActionPausesRolloutAndRolloutGetsResumedStartsNextScheduledGroup() { + /** + * Verifying a paused rollout in case of error action hit can be resumed again + */ + @Test void errorActionPausesRolloutAndRolloutGetsResumedStartsNextScheduledGroup() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -532,9 +544,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(resumedGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING); } - @Test - @Description("Verifying that the rollout is starting group after group and gets finished at the end") - void rolloutStartsGroupAfterGroupAndGetsFinished() { + /** + * Verifying that the rollout is starting group after group and gets finished at the end + */ + @Test void rolloutStartsGroupAfterGroupAndGetsFinished() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 15; final int amountGroups = 5; @@ -570,9 +583,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(findRolloutById.getStatus()).isEqualTo(RolloutStatus.FINISHED); } - @Test - @Description("Verify that the targets have the right status during the rollout.") - void countCorrectStatusForEachTargetDuringRollout() { + /** + * Verify that the targets have the right status during the rollout. + */ + @Test void countCorrectStatusForEachTargetDuringRollout() { final int amountTargetsForRollout = 8; final int amountOtherTargets = 15; @@ -634,9 +648,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify that the targets have the right status during a download_only rollout.") - void countCorrectStatusForEachTargetDuringDownloadOnlyRollout() { + /** + * Verify that the targets have the right status during a download_only rollout. + */ + @Test void countCorrectStatusForEachTargetDuringDownloadOnlyRollout() { final int amountTargetsForRollout = 8; final int amountOtherTargets = 15; @@ -702,9 +717,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify that the targets have the right status during the rollout when an error emerges.") - void countCorrectStatusForEachTargetDuringRolloutWithError() { + /** + * Verify that the targets have the right status during the rollout when an error emerges. + */ + @Test void countCorrectStatusForEachTargetDuringRolloutWithError() { final int amountTargetsForRollout = 8; final int amountOtherTargets = 15; @@ -740,9 +756,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(createdRollout.getId(), validationMap); } - @Test - @Description("Verify that the targets have the right status during the rollout when receiving the status of rollout groups.") - void countCorrectStatusForEachTargetGroupDuringRollout() { + /** + * Verify that the targets have the right status during the rollout when receiving the status of rollout groups. + */ + @Test void countCorrectStatusForEachTargetGroupDuringRollout() { final int amountTargetsForRollout = 9; final int amountOtherTargets = 15; @@ -782,9 +799,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify that target actions of rollout get canceled when a manuel distribution sets assignment is done.") - void targetsOfRolloutGetsManuelDsAssignment() { + /** + * Verify that target actions of rollout get canceled when a manuel distribution sets assignment is done. + */ + @Test void targetsOfRolloutGetsManuelDsAssignment() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 0; @@ -826,9 +844,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(createdRollout.getId(), validationMap); } - @Test - @Description("Verify that target actions of a rollout get cancelled when another rollout with same targets gets started.") - void targetsOfRolloutGetDistributionSetAssignmentByOtherRollout() { + /** + * Verify that target actions of a rollout get cancelled when another rollout with same targets gets started. + */ + @Test void targetsOfRolloutGetDistributionSetAssignmentByOtherRollout() { final int amountTargetsForRollout = 15; final int amountOtherTargets = 5; @@ -868,9 +887,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(rolloutOne.getId(), expectedTargetCountStatus); } - @Test - @Description("Verify that error status of DistributionSet installation during rollout can get rerun with second rollout so that all targets have some DistributionSet installed at the end.") - void startSecondRolloutAfterFirstRolloutEndsWithErrors() { + /** + * Verify that error status of DistributionSet installation during rollout can get rerun with second rollout so that all targets have some DistributionSet installed at the end. + */ + @Test void startSecondRolloutAfterFirstRolloutEndsWithErrors() { final int amountTargetsForRollout = 15; final int amountOtherTargets = 0; @@ -927,9 +947,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .forEach(d -> assertThat(d).contains(distributionSet)); } - @Test - @Description("Verify that the rollout moves to the next group when the success condition was achieved and the error condition was not exceeded.") - void successConditionAchievedAndErrorConditionNotExceeded() { + /** + * Verify that the rollout moves to the next group when the success condition was achieved and the error condition was not exceeded. + */ + @Test void successConditionAchievedAndErrorConditionNotExceeded() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 0; @@ -953,9 +974,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify that the rollout does not move to the next group when the success condition was not achieved.") - void successConditionNotAchieved() { + /** + * Verify that the rollout does not move to the next group when the success condition was not achieved. + */ + @Test void successConditionNotAchieved() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 0; @@ -979,9 +1001,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutGroupActionStatus(rolloutGruops.get(1), expectedTargetCountStatus); } - @Test - @Description("Verify that the rollout pauses when the error condition was exceeded.") - void errorConditionExceeded() { + /** + * Verify that the rollout pauses when the error condition was exceeded. + */ + @Test void errorConditionExceeded() { final int amountTargetsForRollout = 10; final int amountOtherTargets = 0; @@ -1001,9 +1024,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rolloutOne.getStatus()).isEqualTo(RolloutStatus.PAUSED); } - @Test - @Description("Verify that all rollouts are return with expected target statuses.") - void findAllRolloutsWithDetailedStatus() { + /** + * Verify that all rollouts are return with expected target statuses. + */ + @Test void findAllRolloutsWithDetailedStatus() { final int amountTargetsForRollout = 12; final int amountGroups = 2; @@ -1077,9 +1101,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(rolloutList.get(3).getId(), expectedTargetCountStatus); } - @Test - @Description("Verify the count of existing rollouts.") - void rightCountForAllRollouts() { + /** + * Verify the count of existing rollouts. + */ + @Test void rightCountForAllRollouts() { final int amountTargetsForRollout = 6; final int amountGroups = 2; @@ -1093,9 +1118,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(count).isEqualTo(10L); } - @Test - @Description("Verify that the filtering and sorting ascending for rollout is working correctly.") - void findRolloutByFilters() { + /** + * Verify that the filtering and sorting ascending for rollout is working correctly. + */ + @Test void findRolloutByFilters() { final int amountTargetsForRollout = 6; final int amountGroups = 2; final String successCondition = "50"; @@ -1120,9 +1146,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Verify that the expected rollout is found by name.") - void findRolloutByName() { + /** + * Verify that the expected rollout is found by name. + */ + @Test void findRolloutByName() { final int amountTargetsForRollout = 12; final int amountGroups = 2; @@ -1137,9 +1164,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify that the percent count is acting like aspected when targets move to the status finished or error.") - void getFinishedPercentForRunningGroup() { + /** + * Verify that the percent count is acting like aspected when targets move to the status finished or error. + */ + @Test void getFinishedPercentForRunningGroup() { final int amountTargetsForRollout = 10; final int amountGroups = 2; @@ -1183,9 +1211,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(percent).isEqualTo(80); } - @Test - @Description("Verify that the expected targets are returned for the rollout groups.") - void findRolloutGroupTargetsWithRsqlParam() { + /** + * Verify that the expected targets are returned for the rollout groups. + */ + @Test void findRolloutGroupTargetsWithRsqlParam() { final int amountTargetsForRollout = 15; final int amountGroups = 3; @@ -1234,9 +1263,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify the creation of a Rollout without targets throws an Exception.") - void createRolloutNotMatchingTargets() { + /** + * Verify the creation of a Rollout without targets throws an Exception. + */ + @Test void createRolloutNotMatchingTargets() { final int amountGroups = 5; final String successCondition = "50"; final String errorCondition = "80"; @@ -1251,9 +1281,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify the creation of a Rollout with the same name throws an Exception.") - void createDuplicateRollout() { + /** + * Verify the creation of a Rollout with the same name throws an Exception. + */ + @Test void createDuplicateRollout() { final int amountGroups = 5; final int amountTargetsForRollout = 10; final String successCondition = "50"; @@ -1272,9 +1303,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .withMessageContaining("already exists in database"); } - @Test - @Description("Verify the creation and the start of a Rollout with more groups than targets.") - void createAndStartRolloutWithEmptyGroups() { + /** + * Verify the creation and the start of a Rollout with more groups than targets. + */ + @Test void createAndStartRolloutWithEmptyGroups() { final int amountTargetsForRollout = 3; final int amountGroups = 5; final String successCondition = "50"; @@ -1317,9 +1349,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(myRolloutId, expectedTargetCountStatus); } - @Test - @Description("Verify the creation and the start of a rollout.") - void createAndStartRollout() { + /** + * Verify the creation and the start of a rollout. + */ + @Test void createAndStartRollout() { final int amountTargetsForRollout = 50; final int amountGroups = 5; @@ -1355,9 +1388,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { validateRolloutActionStatus(myRolloutId, expectedTargetCountStatus); } - @Test - @Description("Verify the creation and the start of a rollout.") - void createScheduledRollout() throws Exception { + /** + * Verify the creation and the start of a rollout. + */ + @Test void createScheduledRollout() throws Exception { final String rolloutName = "scheduledRolloutTest"; testdataFactory.createTargets(50, rolloutName + "-", rolloutName); final DistributionSet distributionSet = testdataFactory.createDistributionSet("dsFor" + rolloutName); @@ -1414,9 +1448,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .errorAction(RolloutGroupErrorAction.PAUSE, null).build(), null); } - @Test - @Description("Verify that a rollout cannot be created if the 'max targets per rollout group' quota is violated.") - void createRolloutFailsIfQuotaGroupQuotaIsViolated() { + /** + * Verify that a rollout cannot be created if the 'max targets per rollout group' quota is violated. + */ + @Test void createRolloutFailsIfQuotaGroupQuotaIsViolated() { final int maxTargets = quotaManagement.getMaxTargetsPerRolloutGroup(); @@ -1441,9 +1476,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> rolloutManagement.create(rollout, amountGroups, false, conditions)); } - @Test - @Description("Verify that a rollout cannot be created based on group definitions if the 'max targets per rollout group' quota is violated for one of the groups.") - void createRolloutWithGroupDefinitionsFailsIfQuotaGroupQuotaIsViolated() { + /** + * Verify that a rollout cannot be created based on group definitions if the 'max targets per rollout group' quota is violated for one of the groups. + */ + @Test void createRolloutWithGroupDefinitionsFailsIfQuotaGroupQuotaIsViolated() { final int maxTargets = quotaManagement.getMaxTargetsPerRolloutGroup(); final int amountTargetsForRollout = maxTargets * 2 + 2; @@ -1487,9 +1523,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { Arrays.asList(group5, group6, group7), conditions)).isNotNull(); } - @Test - @Description("Verify the update of a rollout") - void updateRollout() { + /** + * Verify the update of a rollout + */ + @Test void updateRollout() { final int amountTargetsForRollout = 50; final int amountGroups = 5; final String successCondition = "50"; @@ -1515,9 +1552,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(myRollout.getDescription()).isEqualTo("newDesc"); } - @Test - @Description("Verify the creation of a rollout with a groups definition.") - void createRolloutWithGroupDefinition() throws Exception { + /** + * Verify the creation of a rollout with a groups definition. + */ + @Test void createRolloutWithGroupDefinition() throws Exception { final String rolloutName = "rolloutTest3"; final int amountTargetsInGroup1 = 10; @@ -1575,9 +1613,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify rollout execution with advanced group definition and confirmation flow active.") - void createRolloutWithGroupDefinitionAndConfirmationFlowActive() { + /** + * Verify rollout execution with advanced group definition and confirmation flow active. + */ + @Test void createRolloutWithGroupDefinitionAndConfirmationFlowActive() { final String rolloutName = "rolloutTest4"; final int amountTargetsInGroup1 = 10; @@ -1651,9 +1690,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify rollout creation fails if group definition does not address all targets") - void createRolloutWithGroupsNotMatchingTargets() { + /** + * Verify rollout creation fails if group definition does not address all targets + */ + @Test void createRolloutWithGroupsNotMatchingTargets() { final String rolloutName = "rolloutTest4"; final int amountTargetsForRollout = 500; final int percentTargetsInGroup1 = 20; @@ -1672,9 +1712,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify rollout creation fails if group definition specifies illegal target percentage") - void createRolloutWithIllegalPercentage() { + /** + * Verify rollout creation fails if group definition specifies illegal target percentage + */ + @Test void createRolloutWithIllegalPercentage() { final String rolloutName = "rolloutTest6"; final int amountTargetsForRollout = 10; final int percentTargetsInGroup1 = 101; @@ -1693,9 +1734,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verify rollout creation fails if the 'max rollout groups per rollout' quota is violated.") - void createRolloutWithIllegalAmountOfGroups() { + /** + * Verify rollout creation fails if the 'max rollout groups per rollout' quota is violated. + */ + @Test void createRolloutWithIllegalAmountOfGroups() { final String rolloutName = "rolloutTest5"; final int targets = 10; final int maxGroups = quotaManagement.getMaxRolloutGroupsPerRollout(); @@ -1708,9 +1750,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .withMessageContaining("not be greater than " + maxGroups); } - @Test - @Description("Verify the start of a Rollout does not work during creation phase.") - void createAndStartRolloutDuringCreationFails() { + /** + * Verify the start of a Rollout does not work during creation phase. + */ + @Test void createAndStartRolloutDuringCreationFails() { final int amountTargetsForRollout = 3; final int amountGroups = 5; final String successCondition = "50"; @@ -1737,9 +1780,11 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .withMessageContaining("can only be started in state ready"); } + /** + * Creating a rollout with approval role or approval engine disabled results in the rollout being in + * READY state. + */ @Test - @Description("Creating a rollout with approval role or approval engine disabled results in the rollout being in " - + "READY state.") void createdRolloutWithApprovalRoleOrApprovalDisabledTransitionsToReadyState() { approvalStrategy.setApprovalNeeded(false); final String successCondition = "50"; @@ -1750,9 +1795,11 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rollout.getStatus()).isEqualTo(Rollout.RolloutStatus.READY); } + /** + * Creating a rollout without approve role and approval enabled leads to transition to + * WAITING_FOR_APPROVAL state. + */ @Test - @Description("Creating a rollout without approve role and approval enabled leads to transition to " - + "WAITING_FOR_APPROVAL state.") void createdRolloutWithoutApprovalRoleTransitionsToWaitingForApprovalState() { approvalStrategy.setApprovalNeeded(true); final String successCondition = "50"; @@ -1763,9 +1810,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rollout.getStatus()).isEqualTo(Rollout.RolloutStatus.WAITING_FOR_APPROVAL); } - @Test - @Description("Approving a rollout leads to transition to READY state.") - void approvedRolloutTransitionsToReadyState() { + /** + * Approving a rollout leads to transition to READY state. + */ + @Test void approvedRolloutTransitionsToReadyState() { approvalStrategy.setApprovalNeeded(true); final String successCondition = "50"; final String errorCondition = "80"; @@ -1778,9 +1826,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(resultingRollout.getStatus()).isEqualTo(Rollout.RolloutStatus.READY); } - @Test - @Description("Denying approval for a rollout leads to transition to APPROVAL_DENIED state.") - void deniedRolloutTransitionsToApprovalDeniedState() { + /** + * Denying approval for a rollout leads to transition to APPROVAL_DENIED state. + */ + @Test void deniedRolloutTransitionsToApprovalDeniedState() { approvalStrategy.setApprovalNeeded(true); final String successCondition = "50"; final String errorCondition = "80"; @@ -1890,9 +1939,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .getNumberOfElements()).isEqualTo(2); } - @Test - @Description("Verifies that returned result considers provided sort parameter.") - void findAllRolloutsConsidersSorting() { + /** + * Verifies that returned result considers provided sort parameter. + */ + @Test void findAllRolloutsConsidersSorting() { final String randomString = randomString(5); final DistributionSet testDs = testdataFactory.createDistributionSet(randomString + "-testDs"); testdataFactory.createTargets(10, randomString + "-testTarget-"); @@ -1929,9 +1979,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rolloutsOrderedByName).containsSubsequence(List.of(rolloutRunning, rolloutReady)); } - @Test - @Description("Creating a rollout without weight value when multi assignment in enabled.") - void weightNotRequiredInMultiAssignmentMode() { + /** + * Creating a rollout without weight value when multi assignment in enabled. + */ + @Test void weightNotRequiredInMultiAssignmentMode() { enableMultiAssignments(); final Rollout rollout = testdataFactory.createSimpleTestRolloutWithTargetsAndDistributionSet(10, 10, 2, "50", "80", @@ -1939,18 +1990,20 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(rollout).isNotNull(); } - @Test - @Description("Creating a rollout with a weight causes an error when multi assignment in disabled.") - void weightAllowedWhenMultiAssignmentModeNotEnabled() { + /** + * Creating a rollout with a weight causes an error when multi assignment in disabled. + */ + @Test void weightAllowedWhenMultiAssignmentModeNotEnabled() { assertThat( testdataFactory.createSimpleTestRolloutWithTargetsAndDistributionSet( 10, 10, 2, "50", "80", ActionType.FORCED, 66)) .isNotNull(); } - @Test - @Description("Weight is validated and saved to the Rollout.") - void weightValidatedAndSaved() { + /** + * Weight is validated and saved to the Rollout. + */ + @Test void weightValidatedAndSaved() { final String targetPrefix = UUID.randomUUID().toString(); testdataFactory.createTargets(4, targetPrefix); enableMultiAssignments(); @@ -1976,9 +2029,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(Action.WEIGHT_MIN); } - @Test - @Description("A Rollout with weight creates actions with weights") - void actionsWithWeightAreCreated() { + /** + * A Rollout with weight creates actions with weights + */ + @Test void actionsWithWeightAreCreated() { final int amountOfTargets = 5; final int weight = 99; enableMultiAssignments(); @@ -1993,9 +2047,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .allMatch(action -> action.getWeight().get() == weight); } - @Test - @Description("Rollout can be created without weight in single assignment and be started in multi assignment") - void createInSingleStartInMultiassignMode() { + /** + * Rollout can be created without weight in single assignment and be started in multi assignment + */ + @Test void createInSingleStartInMultiassignMode() { final int amountOfTargets = 5; final Long rolloutId = testdataFactory.createSimpleTestRolloutWithTargetsAndDistributionSet(amountOfTargets, 2, amountOfTargets, @@ -2009,9 +2064,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(actions).hasSize(5).allMatch(action -> action.getWeight().isPresent()); } - @Test - @Description("Verifies that an exception is thrown when trying to create a rollout with an invalidated distribution set.") - void createRolloutWithInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to create a rollout with an invalidated distribution set. + */ + @Test void createRolloutWithInvalidDistributionSet() { final DistributionSet distributionSet = testdataFactory.createAndInvalidateDistributionSet(); assertThatExceptionOfType(InvalidDistributionSetException.class) @@ -2020,9 +2076,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { "desc", 2, "name==*", distributionSet, "50", "80")); } - @Test - @Description("Verifies that an exception is thrown when trying to create a rollout with an incomplete distribution set.") - void createRolloutWithIncompleteDistributionSet() { + /** + * Verifies that an exception is thrown when trying to create a rollout with an incomplete distribution set. + */ + @Test void createRolloutWithIncompleteDistributionSet() { final DistributionSet distributionSet = testdataFactory.createIncompleteDistributionSet(); assertThatExceptionOfType(IncompleteDistributionSetException.class) @@ -2031,9 +2088,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { "desc", 2, "name==*", distributionSet, "50", "80")); } - @Test - @Description("Verify the that only compatible targets are part of a Rollout.") - void createAndStartRolloutWithTargetTypes() { + /** + * Verify the that only compatible targets are part of a Rollout. + */ + @Test void createAndStartRolloutWithTargetTypes() { final String rolloutName = "rolloutTestCompatibility"; final DistributionSet testDs = testdataFactory.createDistributionSet("test-ds"); @@ -2074,9 +2132,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { .doesNotContainAnyElementsOf(incompatibleTargets); } - @Test - @Description("Verifying that next group is started on manual trigger next group.") - void checkRunningRolloutsManualTriggerNextGroup() { + /** + * Verifying that next group is started on manual trigger next group. + */ + @Test void checkRunningRolloutsManualTriggerNextGroup() { final int amountTargetsForRollout = 15; final int amountOtherTargets = 0; final int amountGroups = 3; @@ -2116,9 +2175,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { verifyRolloutAndAllGroupsAreFinished(createdRollout); } - @Test - @Description("Tests the rollout status mapping.") - void testRolloutStatusConvert() { + /** + * Tests the rollout status mapping. + */ + @Test void testRolloutStatusConvert() { final long id = testdataFactory.createAndStartRollout(1, 0, 1, "100", "80").getId(); for (final RolloutStatus status : RolloutStatus.values()) { final JpaRollout rollout = ((JpaRollout) rolloutManagement.get(id).orElseThrow()); @@ -2128,9 +2188,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Tests the rollout action type mapping.") - void testActionTypeConvert() { + /** + * Tests the rollout action type mapping. + */ + @Test void testActionTypeConvert() { final long id = testdataFactory.createAndStartRollout(1, 0, 1, "100", "80").getId(); for (final ActionType actionType : ActionType.values()) { final JpaRollout rollout = ((JpaRollout) rolloutManagement.get(id).orElseThrow()); @@ -2140,9 +2201,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Trigger next rollout group if rollout is in wrong state") - void triggeringNextGroupRolloutWrongState() { + /** + * Trigger next rollout group if rollout is in wrong state + */ + @Test void triggeringNextGroupRolloutWrongState() { final int amountTargetsForRollout = 15; final int amountOtherTargets = 0; @@ -2203,7 +2265,6 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { return map; } - @Step("Finish three actions of the rollout group and delete two targets") private void finishActionAndDeleteTargetsOfFirstRunningGroup(final Rollout createdRollout) { // finish group one by finishing targets and deleting targets final Slice runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE, @@ -2216,7 +2277,6 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { Arrays.asList(runningActions.get(3).getTarget().getId(), runningActions.get(4).getTarget().getId())); } - @Step("Check the status of the rollout groups, second group should be in running status") private void checkSecondGroupStatusIsRunning(final Rollout createdRollout) { rolloutHandler.handleAll(); final List runningRolloutGroups = rolloutGroupManagement @@ -2227,7 +2287,6 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { assertThat(runningRolloutGroups.get(2).getStatus()).isEqualTo(RolloutGroupStatus.SCHEDULED); } - @Step("Finish one action of the rollout group and delete four targets") private void finishActionAndDeleteTargetsOfSecondRunningGroup(final Rollout createdRollout) { final Slice runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE, createdRollout.getId(), Status.RUNNING); @@ -2239,7 +2298,6 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { } - @Step("Delete all targets of the rollout group") private void deleteAllTargetsFromThirdGroup(final Rollout createdRollout) { final Slice runningActionsSlice = actionRepository.findByRolloutIdAndStatus(PAGE, createdRollout.getId(), Status.SCHEDULED); @@ -2249,7 +2307,6 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest { runningActions.get(3).getTarget().getId(), runningActions.get(4).getTarget().getId())); } - @Step("Check the status of the rollout groups and the rollout") private void verifyRolloutAndAllGroupsAreFinished(final Rollout createdRollout) { rolloutHandler.handleAll(); final List runningRolloutGroups = rolloutGroupManagement diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareManagementSecurityTest.java index dc9720ffc..952439d9c 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareManagementSecurityTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.eclipse.hawkbit.repository.builder.SoftwareModuleCreate; @@ -22,8 +19,10 @@ import org.eclipse.hawkbit.repository.jpa.AbstractRepositoryManagementSecurityTe import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - SoftwareManagement") -@Story("SecurityTests SoftwareManagement") +/** + * Feature: SecurityTests - SoftwareManagement
+ * Story: SecurityTests SoftwareManagement + */ class SoftwareManagementSecurityTest extends AbstractRepositoryManagementSecurityTest { @@ -42,9 +41,10 @@ class SoftwareManagementSecurityTest return entityFactory.softwareModule().update(1L).locked(true); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createMetaDataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createMetaDataPermissionsCheck() { assertPermissions( () -> softwareModuleManagement.updateMetadata(entityFactory.softwareModuleMetadata().create(1L).key("key").value("value")), List.of(SpPermission.UPDATE_REPOSITORY)); @@ -55,30 +55,34 @@ class SoftwareManagementSecurityTest }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteMetaDataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteMetaDataPermissionsCheck() { assertPermissions(() -> { softwareModuleManagement.deleteMetadata(1L, "key"); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByAssignedToPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByAssignedToPermissionsCheck() { assertPermissions(() -> softwareModuleManagement.findByAssignedTo(1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByAssignedToPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByAssignedToPermissionsCheck() { assertPermissions(() -> softwareModuleManagement.countByAssignedTo(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTextAndTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTextAndTypePermissionsCheck() { assertPermissions(() -> softwareModuleManagement.findByTextAndType("text", 1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } @@ -88,60 +92,68 @@ class SoftwareManagementSecurityTest List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getMetaDataBySoftwareModuleIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getMetaDataBySoftwareModuleIdPermissionsCheck() { assertPermissions(() -> softwareModuleManagement.getMetadata(1L, "key"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findMetaDataBySoftwareModuleIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findMetaDataBySoftwareModuleIdPermissionsCheck() { assertPermissions(() -> softwareModuleManagement.getMetadata(1L), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findMetaDataBySoftwareModuleIdAndTargetVisiblePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findMetaDataBySoftwareModuleIdAndTargetVisiblePermissionsCheck() { assertPermissions(() -> softwareModuleManagement.findMetaDataBySoftwareModuleIdAndTargetVisible(1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTypePermissionsCheck() { assertPermissions(() -> softwareModuleManagement.findByType(1L, PAGE), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void lockPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void lockPermissionsCheck() { assertPermissions(() -> { softwareModuleManagement.lock(1L); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unlockPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unlockPermissionsCheck() { assertPermissions(() -> { softwareModuleManagement.unlock(1L); return null; }, List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updateMetaDataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updateMetaDataPermissionsCheck() { assertPermissions( () -> softwareModuleManagement.updateMetadata(entityFactory.softwareModuleMetadata().update(1L, "key").value("value")), List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findMetaDataBySoftwareModuleIdsAndTargetVisiblePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findMetaDataBySoftwareModuleIdsAndTargetVisiblePermissionsCheck() { assertPermissions(() -> softwareModuleManagement.findMetaDataBySoftwareModuleIdsAndTargetVisible(List.of(1L)), List.of(SpPermission.READ_REPOSITORY)); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleManagementTest.java index da5694f82..5f6141f80 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleManagementTest.java @@ -22,9 +22,6 @@ import java.util.List; import java.util.Optional; import java.util.Set; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.builder.SoftwareModuleMetadataCreate; import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleCreatedEvent; import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException; @@ -55,15 +52,19 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -@Feature("Component Tests - Repository") -@Story("Software Module Management") +/** + * Feature: Component Tests - Repository
+ * Story: Software Module Management + */ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { private static final PageRequest PAGE_REQUEST_100 = PageRequest.of(0, 100); + /** + * Verifies that management get access reacts as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access reacts as specified on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) void nonExistingEntityAccessReturnsNotPresent() { final SoftwareModule module = testdataFactory.createSoftwareModuleApp(); @@ -77,9 +78,11 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> softwareModuleManagement.getMetadata(module.getId(), NOT_EXIST_ID)); } + /** + * Verifies that management queries react as specfied on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 1) }) void entityQueriesReferringToNotExistingEntitiesThrowsException() { final SoftwareModule module = testdataFactory.createSoftwareModuleApp(); @@ -122,9 +125,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> softwareModuleManagement.update(entityFactory.softwareModule().update(NOT_EXIST_IDL)), "SoftwareModule"); } - @Test - @Description("Calling update without changing fields results in no recorded change in the repository including unchanged audit fields.") - void updateNothingResultsInUnchangedRepository() { + /** + * Calling update without changing fields results in no recorded change in the repository including unchanged audit fields. + */ + @Test void updateNothingResultsInUnchangedRepository() { final SoftwareModule ah = testdataFactory.createSoftwareModuleOs(); final SoftwareModule updated = softwareModuleManagement @@ -135,9 +139,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(ah.getOptLockRevision()); } - @Test - @Description("Calling update for changed fields results in change in the repository.") - void updateSoftwareModuleFieldsToNewValue() { + /** + * Calling update for changed fields results in change in the repository. + */ + @Test void updateSoftwareModuleFieldsToNewValue() { final SoftwareModule ah = testdataFactory.createSoftwareModuleOs(); final SoftwareModule updated = softwareModuleManagement @@ -150,18 +155,20 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(updated.getVendor()).as("Updated vendor is").isEqualTo("changed"); } - @Test - @Description("Create Software Module call fails when called for existing entity.") - void createModuleCallFailsForExistingModule() { + /** + * Create Software Module call fails when called for existing entity. + */ + @Test void createModuleCallFailsForExistingModule() { testdataFactory.createSoftwareModuleOs(); assertThatExceptionOfType(EntityAlreadyExistsException.class) .as("Should not have worked as module already exists.") .isThrownBy(() -> testdataFactory.createSoftwareModuleOs()); } - @Test - @Description("searched for software modules based on the various filter options, e.g. name,desc,type, version.") - void findSoftwareModuleByFilters() { + /** + * searched for software modules based on the various filter options, e.g. name,desc,type, version. + */ + @Test void findSoftwareModuleByFilters() { final SoftwareModule ah = softwareModuleManagement .create(entityFactory.softwareModule().create().type(appType).name("agent-hub").version("1.0.1")); final SoftwareModule jvm = softwareModuleManagement @@ -201,9 +208,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(ah); } - @Test - @Description("Searches for software modules based on a list of IDs.") - void findSoftwareModulesById() { + /** + * Searches for software modules based on a list of IDs. + */ + @Test void findSoftwareModulesById() { final List modules = Arrays.asList(testdataFactory.createSoftwareModuleOs().getId(), testdataFactory.createSoftwareModuleApp().getId(), 624355263L); @@ -211,9 +219,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleManagement.get(modules)).hasSize(2); } - @Test - @Description("Searches for software modules by type.") - void findSoftwareModulesByType() { + /** + * Searches for software modules by type. + */ + @Test void findSoftwareModulesByType() { // found in test final SoftwareModule one = testdataFactory.createSoftwareModuleOs("one"); final SoftwareModule two = testdataFactory.createSoftwareModuleOs("two"); @@ -226,9 +235,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .contains(two, one); } - @Test - @Description("Counts all software modules in the repsitory that are not marked as deleted.") - void countSoftwareModulesAll() { + /** + * Counts all software modules in the repsitory that are not marked as deleted. + */ + @Test void countSoftwareModulesAll() { // found in test testdataFactory.createSoftwareModuleOs("one"); testdataFactory.createSoftwareModuleOs("two"); @@ -240,9 +250,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(2); } - @Test - @Description("Deletes an artifact, which is not assigned to a Distribution Set") - void hardDeleteOfNotAssignedArtifact() { + /** + * Deletes an artifact, which is not assigned to a Distribution Set + */ + @Test void hardDeleteOfNotAssignedArtifact() { // [STEP1]: Create SoftwareModuleX with Artifacts final SoftwareModule unassignedModule = createSoftwareModuleWithArtifacts(osType, "moduleX", "3.0.2", 2); @@ -266,9 +277,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactRepository.findById(artifact2.getId())).isNotPresent(); } - @Test - @Description("Deletes an artifact, which is assigned to a DistributionSet") - void softDeleteOfAssignedArtifact() { + /** + * Deletes an artifact, which is assigned to a DistributionSet + */ + @Test void softDeleteOfAssignedArtifact() { // [STEP1]: Create SoftwareModuleX with ArtifactX SoftwareModule assignedModule = createSoftwareModuleWithArtifacts(osType, "moduleX", "3.0.2", 2); @@ -298,9 +310,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactRepository.findById(artifact2.getId())).isNotNull(); } - @Test - @Description("Delete an artifact, which has been assigned to a rolled out DistributionSet in the past") - void softDeleteOfHistoricalAssignedArtifact() { + /** + * Delete an artifact, which has been assigned to a rolled out DistributionSet in the past + */ + @Test void softDeleteOfHistoricalAssignedArtifact() { // Init target final Target target = testdataFactory.createTarget(); @@ -338,9 +351,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactRepository.findById(artifact2.getId())).isNotNull(); } - @Test - @Description("Delete an software module with an artifact, which is also used by another software module.") - void deleteSoftwareModulesWithSharedArtifact() { + /** + * Delete an software module with an artifact, which is also used by another software module. + */ + @Test void deleteSoftwareModulesWithSharedArtifact() { // Init artifact binary data, target and DistributionSets final int artifactSize = 1024; @@ -384,9 +398,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Delete two assigned softwaremodules which share an artifact.") - void deleteMultipleSoftwareModulesWhichShareAnArtifact() { + /** + * Delete two assigned softwaremodules which share an artifact. + */ + @Test void deleteMultipleSoftwareModulesWhichShareAnArtifact() { // Init artifact binary data, target and DistributionSets final int artifactSize = 1024; final byte[] source = randomBytes(artifactSize); @@ -443,9 +458,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(artifactRepository.findById(artifactY.getId())).isNotNull(); } - @Test - @Description("Verifies that all undeleted software modules are found in the repository.") - void countSoftwareModuleTypesAll() { + /** + * Verifies that all undeleted software modules are found in the repository. + */ + @Test void countSoftwareModuleTypesAll() { testdataFactory.createSoftwareModuleOs(); // one soft deleted @@ -457,9 +473,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleRepository.count()).as("Number of all modules").isEqualTo(2); } - @Test - @Description("Verifies that software modules are returned that are assigned to given DS.") - void findSoftwareModuleByAssignedTo() { + /** + * Verifies that software modules are returned that are assigned to given DS. + */ + @Test void findSoftwareModuleByAssignedTo() { // test modules final SoftwareModule one = testdataFactory.createSoftwareModuleOs(); testdataFactory.createSoftwareModuleOs("notassigned"); @@ -474,9 +491,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .as("Found this number of modules").hasSize(2); } - @Test - @Description("Checks that metadata for a software module can be created.") - void createSoftwareModuleMetadata() { + /** + * Checks that metadata for a software module can be created. + */ + @Test void createSoftwareModuleMetadata() { final String knownKey1 = "myKnownKey1"; final String knownValue1 = "myKnownValue1"; @@ -516,9 +534,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { }); } - @Test - @Description("Verifies the enforcement of the metadata quota per software module.") - void createSoftwareModuleMetadataUntilQuotaIsExceeded() { + /** + * Verifies the enforcement of the metadata quota per software module. + */ + @Test void createSoftwareModuleMetadataUntilQuotaIsExceeded() { // add meta data one by one final SoftwareModule module = testdataFactory.createSoftwareModuleApp("m1"); @@ -563,9 +582,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Checks that metadata for a software module cannot be created for an existing key.") - void createSoftwareModuleMetadataFailsIfKeyExists() { + /** + * Checks that metadata for a software module cannot be created for an existing key. + */ + @Test void createSoftwareModuleMetadataFailsIfKeyExists() { final String knownKey1 = "myKnownKey1"; final String knownValue1 = "myKnownValue1"; @@ -591,9 +611,11 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .withMessageContaining("Metadata").withMessageContaining(knownKey2); } + /** + * Checks that metadata for a software module can be updated. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that metadata for a software module can be updated.") void updateSoftwareModuleMetadata() { final String knownKey = "myKnownKey"; final String knownValue = "myKnownValue"; @@ -632,9 +654,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(((JpaSoftwareModuleMetadata) updated).getSoftwareModule().getId()).isEqualTo(ah.getId()); } - @Test - @Description("Verifies that existing metadata can be deleted.") - void deleteSoftwareModuleMetadata() { + /** + * Verifies that existing metadata can be deleted. + */ + @Test void deleteSoftwareModuleMetadata() { final String knownKey1 = "myKnownKey1"; final String knownValue1 = "myKnownValue1"; @@ -654,9 +677,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleManagement.getMetadata(swModule.getId())).as("Metadata elements are").isEmpty(); } - @Test - @Description("Verifies that non existing metadata find results in exception.") - void findSoftwareModuleMetadataFailsIfEntryDoesNotExist() { + /** + * Verifies that non existing metadata find results in exception. + */ + @Test void findSoftwareModuleMetadataFailsIfEntryDoesNotExist() { final String knownKey1 = "myKnownKey1"; final String knownValue1 = "myKnownValue1"; @@ -669,9 +693,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> softwareModuleManagement.getMetadata(ah.getId(), "doesnotexist")); } - @Test - @Description("Queries and loads the metadata related to a given software module.") - void findAllSoftwareModuleMetadataBySwId() { + /** + * Queries and loads the metadata related to a given software module. + */ + @Test void findAllSoftwareModuleMetadataBySwId() { final SoftwareModule sw1 = testdataFactory.createSoftwareModuleApp(); final int metadataCountSw1 = 8; @@ -703,9 +728,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { assertThat(metadataSw2V.getTotalElements()).isZero(); } - @Test - @Description("Locks a SM.") - void lockSoftwareModule() { + /** + * Locks a SM. + */ + @Test void lockSoftwareModule() { final SoftwareModule softwareModule = testdataFactory.createSoftwareModule("sm-1"); assertThat( softwareModuleManagement.get(softwareModule.getId()).map(SoftwareModule::isLocked).orElse(true)) @@ -716,9 +742,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isTrue(); } - @Test - @Description("Unlocks a SM.") - void unlockSoftwareModule() { + /** + * Unlocks a SM. + */ + @Test void unlockSoftwareModule() { final SoftwareModule softwareModule = testdataFactory.createSoftwareModule("sm-1"); softwareModuleManagement.lock(softwareModule.getId()); assertThat( @@ -730,9 +757,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isFalse(); } - @Test - @Description("Artifacts of a locked SM can't be modified. Expected behaviour is to throw an exception and to do not modify them.") - void lockSoftwareModuleApplied() { + /** + * Artifacts of a locked SM can't be modified. Expected behaviour is to throw an exception and to do not modify them. + */ + @Test void lockSoftwareModuleApplied() { final Long softwareModuleId = testdataFactory.createSoftwareModule("sm-1").getId(); artifactManagement.create( new ArtifactUpload(new ByteArrayInputStream(new byte[] { 1 }), softwareModuleId, "artifact1", false, 1)); @@ -765,9 +793,10 @@ class SoftwareModuleManagementTest extends AbstractJpaIntegrationTest { .isPresent(); } - @Test - @Description("Artifacts of a locked SM can't be modified. Expected behaviour is to throw an exception and to do not modify them.") - void lockedContainingDistributionSetApplied() { + /** + * Artifacts of a locked SM can't be modified. Expected behaviour is to throw an exception and to do not modify them. + */ + @Test void lockedContainingDistributionSetApplied() { final DistributionSet distributionSet = testdataFactory.createDistributionSet("ds-1"); final List modules = distributionSet.getModules().stream().toList(); assertThat(modules).hasSizeGreaterThan(1); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementSecurityTest.java index efc0002e4..0daef9aa2 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.RepositoryManagement; import org.eclipse.hawkbit.repository.builder.SoftwareModuleTypeCreate; @@ -23,8 +20,10 @@ import org.eclipse.hawkbit.repository.jpa.AbstractRepositoryManagementSecurityTe import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - SoftwareModuleTypeManagement") -@Story("SecurityTests SoftwareModuleTypeManagement") +/** + * Feature: SecurityTests - SoftwareModuleTypeManagement
+ * Story: SecurityTests SoftwareModuleTypeManagement + */ class SoftwareModuleTypeManagementSecurityTest extends AbstractRepositoryManagementSecurityTest { @@ -43,15 +42,17 @@ class SoftwareModuleTypeManagementSecurityTest return entityFactory.softwareModuleType().update(1L).description("description"); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByKeyPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByKeyPermissionsCheck() { assertPermissions(() -> softwareModuleTypeManagement.findByKey("key"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNamePermissionsCheck() { assertPermissions(() -> softwareModuleTypeManagement.findByName("name"), List.of(SpPermission.READ_REPOSITORY)); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementTest.java index d0e6a0ff5..61ad12524 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SoftwareModuleTypeManagementTest.java @@ -17,9 +17,6 @@ import java.util.List; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.builder.SoftwareModuleTypeCreate; import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleCreatedEvent; import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException; @@ -30,13 +27,17 @@ import org.eclipse.hawkbit.repository.test.matcher.Expect; import org.eclipse.hawkbit.repository.test.matcher.ExpectEvents; import org.junit.jupiter.api.Test; -@Feature("Component Tests - Repository") -@Story("Software Module Management") +/** + * Feature: Component Tests - Repository
+ * Story: Software Module Management + */ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { + /** + * Verifies that management get access reacts as specfied on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access reacts as specfied on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 0) }) void nonExistingEntityAccessReturnsNotPresent() { @@ -45,9 +46,11 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleTypeManagement.findByName(NOT_EXIST_ID)).isNotPresent(); } + /** + * Verifies that management queries react as specfied on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = SoftwareModuleCreatedEvent.class, count = 0) }) void entityQueriesReferringToNotExistingEntitiesThrowsException() { verifyThrownExceptionBy(() -> softwareModuleTypeManagement.delete(NOT_EXIST_IDL), "SoftwareModuleType"); @@ -57,9 +60,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { "SoftwareModuleType"); } - @Test - @Description("Calling update without changing fields results in no recorded change in the repository including unchanged audit fields.") - void updateNothingResultsInUnchangedRepositoryForType() { + /** + * Calling update without changing fields results in no recorded change in the repository including unchanged audit fields. + */ + @Test void updateNothingResultsInUnchangedRepositoryForType() { final SoftwareModuleType created = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("test-key").name("test-name")); @@ -71,9 +75,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(created.getOptLockRevision()); } - @Test - @Description("Calling update for changed fields results in change in the repository.") - void updateSoftwareModuleTypeFieldsToNewValue() { + /** + * Calling update for changed fields results in change in the repository. + */ + @Test void updateSoftwareModuleTypeFieldsToNewValue() { final SoftwareModuleType created = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("test-key").name("test-name")); @@ -86,9 +91,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(updated.getColour()).as("Updated vendor is").isEqualTo("changed"); } - @Test - @Description("Create Software Module Types call fails when called for existing entities.") - void createModuleTypesCallFailsForExistingTypes() { + /** + * Create Software Module Types call fails when called for existing entities. + */ + @Test void createModuleTypesCallFailsForExistingTypes() { final List created = Arrays.asList( entityFactory.softwareModuleType().create().key("test-key").name("test-name"), entityFactory.softwareModuleType().create().key("test-key2").name("test-name2")); @@ -98,9 +104,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> softwareModuleTypeManagement.create(created)); } - @Test - @Description("Tests the successfull deletion of software module types. Both unused (hard delete) and used ones (soft delete).") - void deleteAssignedAndUnassignedSoftwareModuleTypes() { + /** + * Tests the successfull deletion of software module types. Both unused (hard delete) and used ones (soft delete). + */ + @Test void deleteAssignedAndUnassignedSoftwareModuleTypes() { assertThat(softwareModuleTypeManagement.findAll(PAGE)).hasSize(3).contains(osType, runtimeType, appType); SoftwareModuleType type = softwareModuleTypeManagement @@ -134,9 +141,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { softwareModuleTypeRepository.findById(type.getId()).get()); } - @Test - @Description("Checks that software module typeis found based on given name.") - void findSoftwareModuleTypeByName() { + /** + * Checks that software module typeis found based on given name. + */ + @Test void findSoftwareModuleTypeByName() { testdataFactory.createSoftwareModuleOs(); final SoftwareModuleType found = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("thetype").name("thename")); @@ -146,9 +154,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(softwareModuleTypeManagement.findByName("thename")).as("Type with given name").contains(found); } - @Test - @Description("Verifies that it is not possible to create a type that alrady exists.") - void createSoftwareModuleTypeFailsWithExistingEntity() { + /** + * Verifies that it is not possible to create a type that alrady exists. + */ + @Test void createSoftwareModuleTypeFailsWithExistingEntity() { final SoftwareModuleTypeCreate create = entityFactory.softwareModuleType().create().key("thetype").name("thename"); softwareModuleTypeManagement.create(create); assertThatExceptionOfType(EntityAlreadyExistsException.class) @@ -157,9 +166,10 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { .create(create)); } - @Test - @Description("Verifies that it is not possible to create a list of types where one already exists.") - void createSoftwareModuleTypesFailsWithExistingEntity() { + /** + * Verifies that it is not possible to create a list of types where one already exists. + */ + @Test void createSoftwareModuleTypesFailsWithExistingEntity() { softwareModuleTypeManagement.create(entityFactory.softwareModuleType().create().key("thetype").name("thename")); final List creates = List.of( entityFactory.softwareModuleType().create().key("thetype").name("thename"), @@ -169,18 +179,20 @@ class SoftwareModuleTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> softwareModuleTypeManagement.create(creates)); } - @Test - @Description("Verifies that the creation of a softwareModuleType is failing because of invalid max assignment") - void createSoftwareModuleTypesFailsWithInvalidMaxAssignment() { + /** + * Verifies that the creation of a softwareModuleType is failing because of invalid max assignment + */ + @Test void createSoftwareModuleTypesFailsWithInvalidMaxAssignment() { final SoftwareModuleTypeCreate create = entityFactory.softwareModuleType().create().key("type").name("name").maxAssignments(0); assertThatExceptionOfType(ConstraintViolationException.class) .as("should not have worked as max assignment is invalid. Should be greater than 0") .isThrownBy(() -> softwareModuleTypeManagement.create(create)); } - @Test - @Description("Verifies that multiple types are created as requested.") - void createMultipleSoftwareModuleTypes() { + /** + * Verifies that multiple types are created as requested. + */ + @Test void createMultipleSoftwareModuleTypes() { final List created = softwareModuleTypeManagement .create(Arrays.asList(entityFactory.softwareModuleType().create().key("thetype").name("thename"), entityFactory.softwareModuleType().create().key("thetype2").name("thename2"))); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementSecurityTest.java index 87ebfbeb3..6b451d520 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementSecurityTest.java @@ -11,88 +11,97 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - SystemManagement") -@Story("SecurityTests SystemManagement") +/** + * Feature: SecurityTests - SystemManagement
+ * Story: SecurityTests SystemManagement + */ class SystemManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findTenantsPermissionWorks() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findTenantsPermissionWorks() { assertPermissions(() -> systemManagement.findTenants(PAGE), List.of(SpPermission.SYSTEM_ADMIN)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteTenantPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteTenantPermissionsCheck() { assertPermissions(() -> { systemManagement.deleteTenant("tenant"); return null; }, List.of(SpPermission.SYSTEM_ADMIN)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void forEachTenantTenantPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void forEachTenantTenantPermissionsCheck() { assertPermissions(() -> { systemManagement.forEachTenant(log::info); return null; }, List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getSystemUsageStatisticsWithTenantsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getSystemUsageStatisticsWithTenantsPermissionsCheck() { assertPermissions(() -> systemManagement.getSystemUsageStatisticsWithTenants(), List.of(SpPermission.SYSTEM_ADMIN)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getSystemUsageStatisticsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getSystemUsageStatisticsPermissionsCheck() { assertPermissions(() -> systemManagement.getSystemUsageStatistics(), List.of(SpPermission.SYSTEM_ADMIN)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTenantMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTenantMetadataPermissionsCheck() { assertPermissions(() -> systemManagement.getTenantMetadata(), List.of(SpPermission.READ_REPOSITORY), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadata(), List.of(SpPermission.READ_TARGET), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadata(), List.of(SpPermission.READ_TENANT_CONFIGURATION), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadata(), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTenantMetadataWithoutDetailsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTenantMetadataWithoutDetailsPermissionsCheck() { assertPermissions(() -> systemManagement.getTenantMetadataWithoutDetails(), List.of(SpPermission.READ_REPOSITORY), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadataWithoutDetails(), List.of(SpPermission.READ_TARGET), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadataWithoutDetails(), List.of(SpPermission.READ_TENANT_CONFIGURATION), List.of(SpPermission.CREATE_REPOSITORY)); assertPermissions(() -> systemManagement.getTenantMetadataWithoutDetails(), List.of(SpPermission.SpringEvalExpressions.CONTROLLER_ROLE), List.of(SpPermission.CREATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTenantMetadataByTenantPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTenantMetadataByTenantPermissionsCheck() { assertPermissions(() -> systemManagement.getTenantMetadata(1L), List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createTenantMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createTenantMetadataPermissionsCheck() { assertPermissions(() -> systemManagement.createTenantMetadata("tenant"), List.of(SpPermission.SpringEvalExpressions.SYSTEM_ROLE)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updateTenantMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updateTenantMetadataPermissionsCheck() { assertPermissions(() -> systemManagement.updateTenantMetadata(1L), List.of(SpPermission.TENANT_CONFIGURATION)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementTest.java index 1856d75b8..172a3b469 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/SystemManagementTest.java @@ -15,9 +15,6 @@ import java.io.ByteArrayInputStream; import java.util.List; import java.util.Random; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.ArtifactUpload; @@ -30,14 +27,17 @@ import org.eclipse.hawkbit.repository.test.util.SecurityContextSwitch; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -@Feature("Component Tests - Repository") -@Story("System Management") +/** + * Feature: Component Tests - Repository
+ * Story: System Management + */ @ExtendWith(DisposableSqlTestDatabaseExtension.class) class SystemManagementTest extends AbstractJpaIntegrationTest { - @Test - @Description("Ensures that findTenants returns all tenants and not only restricted to the tenant which currently is logged in") - void findTenantsReturnsAllTenantsNotOnlyWhichLoggedIn() throws Exception { + /** + * Ensures that findTenants returns all tenants and not only restricted to the tenant which currently is logged in + */ + @Test void findTenantsReturnsAllTenantsNotOnlyWhichLoggedIn() throws Exception { assertThat(systemManagement.findTenants(PAGE).getContent()).hasSize(1); createTestTenantsForSystemStatistics(2, 0, 0, 0); @@ -45,9 +45,10 @@ class SystemManagementTest extends AbstractJpaIntegrationTest { assertThat(systemManagement.findTenants(PAGE).getContent()).hasSize(3); } - @Test - @Description("Ensures that getSystemUsageStatisticsWithTenants returns the usage of all tenants and not only the first 1000 (max page size).") - void systemUsageReportCollectsStatisticsOfManyTenants() throws Exception { + /** + * Ensures that getSystemUsageStatisticsWithTenants returns the usage of all tenants and not only the first 1000 (max page size). + */ + @Test void systemUsageReportCollectsStatisticsOfManyTenants() throws Exception { // Prepare tenants createTestTenantsForSystemStatistics(1050, 0, 0, 0); @@ -55,9 +56,10 @@ class SystemManagementTest extends AbstractJpaIntegrationTest { assertThat(tenants).hasSize(1051); // +1 from the setup } - @Test - @Description("Checks that the system report calculates correctly the artifact size of all tenants in the system. It ignores deleted software modules with their artifacts.") - void systemUsageReportCollectsArtifactsOfAllTenants() throws Exception { + /** + * Checks that the system report calculates correctly the artifact size of all tenants in the system. It ignores deleted software modules with their artifacts. + */ + @Test void systemUsageReportCollectsArtifactsOfAllTenants() throws Exception { // Prepare tenants createTestTenantsForSystemStatistics(2, 1234, 0, 0); @@ -79,9 +81,10 @@ class SystemManagementTest extends AbstractJpaIntegrationTest { tenantUsage1); } - @Test - @Description("Checks that the system report calculates correctly the targets size of all tenants in the system") - void systemUsageReportCollectsTargetsOfAllTenants() throws Exception { + /** + * Checks that the system report calculates correctly the targets size of all tenants in the system + */ + @Test void systemUsageReportCollectsTargetsOfAllTenants() throws Exception { // Prepare tenants createTestTenantsForSystemStatistics(2, 0, 100, 0); @@ -99,9 +102,10 @@ class SystemManagementTest extends AbstractJpaIntegrationTest { assertThat(tenants).containsOnly(new TenantUsage("DEFAULT"), tenantUsage0, tenantUsage1); } - @Test - @Description("Checks that the system report calculates correctly the actions size of all tenants in the system") - void systemUsageReportCollectsActionsOfAllTenants() throws Exception { + /** + * Checks that the system report calculates correctly the actions size of all tenants in the system + */ + @Test void systemUsageReportCollectsActionsOfAllTenants() throws Exception { // Prepare tenants createTestTenantsForSystemStatistics(2, 0, 20, 2); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementSecurityTest.java index 3074bb3a9..6e5ed76b6 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementSecurityTest.java @@ -11,133 +11,150 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.builder.AutoAssignDistributionSetUpdate; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; -@Feature("SecurityTests - TargetFilterQueryManagement") -@Story("SecurityTests TargetFilterQueryManagement") +/** + * Feature: SecurityTests - TargetFilterQueryManagement
+ * Story: SecurityTests TargetFilterQueryManagement + */ class TargetFilterQueryManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionsCheck() { assertPermissions( () -> targetFilterQueryManagement.create(entityFactory.targetFilterQuery().create().name("name").query("controllerId==id")), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionsCheck() { assertPermissions(() -> { targetFilterQueryManagement.delete(1L); return null; }, List.of(SpPermission.DELETE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void verifyTargetFilterQuerySyntaxPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void verifyTargetFilterQuerySyntaxPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.verifyTargetFilterQuerySyntax("controllerId==id"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findAll(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.count(), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByAutoAssignDistributionSetIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByAutoAssignDistributionSetIdPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.countByAutoAssignDistributionSetId(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByNamePermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findByName("filterName", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByNamePermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.countByName("filterName"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findByRsql("name==id", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByQueryPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByQueryPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findByQuery("controllerId==id", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByAutoAssignDistributionSetIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByAutoAssignDistributionSetIdPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findByAutoAssignDistributionSetId(1L, PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByAutoAssignDSAndRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByAutoAssignDSAndRsqlPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findByAutoAssignDSAndRsql(1L, "rsqlParam", PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findWithAutoAssignDSPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findWithAutoAssignDSPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.findWithAutoAssignDS(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTargetFilterQueryByIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTargetFilterQueryByIdPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.get(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTargetFilterQueryByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTargetFilterQueryByNamePermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.getByName("filterName"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.update(entityFactory.targetFilterQuery().update(1L)), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updateAutoAssignDSPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updateAutoAssignDSPermissionsCheck() { assertPermissions(() -> targetFilterQueryManagement.updateAutoAssignDS(new AutoAssignDistributionSetUpdate(1L).weight(1)), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void cancelAutoAssignmentForDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void cancelAutoAssignmentForDistributionSetPermissionsCheck() { assertPermissions(() -> { targetFilterQueryManagement.cancelAutoAssignmentForDistributionSet(1L); return null; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementTest.java index 66af9aa73..fdd48ab38 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetFilterQueryManagementTest.java @@ -23,10 +23,6 @@ import java.util.function.Supplier; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.assertj.core.api.Assertions; import org.eclipse.hawkbit.exception.AbstractServerRtException; import org.eclipse.hawkbit.repository.TargetFilterQueryManagement; @@ -60,22 +56,25 @@ import org.springframework.data.domain.Slice; /** * Test class for {@link TargetFilterQueryManagement}. + *

+ * Feature: Component Tests - Repository
+ * Story: Target Filter Query Management */ -@Feature("Component Tests - Repository") -@Story("Target Filter Query Management") class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verifies that management get access reacts as specfied on calls for non existing entities by means of Optional not present.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) + /** + * Verifies that management get access reacts as specfied on calls for non existing entities by means of Optional not present. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 0) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(targetFilterQueryManagement.get(NOT_EXIST_IDL)).isNotPresent(); assertThat(targetFilterQueryManagement.getByName(NOT_EXIST_ID)).isNotPresent(); } - @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities by means of throwing EntityNotFoundException.") - @ExpectEvents({ + /** + * Verifies that management queries react as specfied on calls for non existing entities by means of throwing EntityNotFoundException. + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 1), @Expect(type = SoftwareModuleCreatedEvent.class, count = 3), @Expect(type = TargetFilterQueryCreatedEvent.class, count = 1) }) @@ -108,9 +107,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { "DistributionSet"); } - @Test - @Description("Test creation of target filter query.") - void createTargetFilterQuery() { + /** + * Test creation of target filter query. + */ + @Test void createTargetFilterQuery() { final String filterName = "new target filter"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name(filterName).query("name==PendingTargets001")); @@ -118,9 +118,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { "Retrieved newly created custom target filter"); } - @Test - @Description("Create a target filter query with an auto-assign distribution set and a query string that addresses too many targets.") - void createTargetFilterQueryThatExceedsQuota() { + /** + * Create a target filter query with an auto-assign distribution set and a query string that addresses too many targets. + */ + @Test void createTargetFilterQueryThatExceedsQuota() { // create targets final int maxTargets = quotaManagement.getMaxTargetsPerAutoAssignment(); @@ -134,9 +135,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.create(targetFilterQueryCreate)); } - @Test - @Description("Test searching a target filter query.") - void searchTargetFilterQuery() { + /** + * Test searching a target filter query. + */ + @Test void searchTargetFilterQuery() { final String filterName = "targetFilterQueryName"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name(filterName).query("name==PendingTargets001")); @@ -150,17 +152,19 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { assertEquals(targetFilterQuery, results.get(0), "Retrieved newly created custom target filter"); } - @Test - @Description("Test searching a target filter query with an invalid filter.") - void searchTargetFilterQueryInvalidField() { + /** + * Test searching a target filter query with an invalid filter. + */ + @Test void searchTargetFilterQueryInvalidField() { final PageRequest pageRequest = PageRequest.of(0, 10); Assertions.assertThatExceptionOfType(RSQLParameterUnsupportedFieldException.class) .isThrownBy(() -> targetFilterQueryManagement.findByRsql("unknownField==testValue", pageRequest)); } - @Test - @Description("Checks if the EntityAlreadyExistsException is thrown if a targetFilterQuery with the same name are created more than once.") - void createDuplicateTargetFilterQuery() { + /** + * Checks if the EntityAlreadyExistsException is thrown if a targetFilterQuery with the same name are created more than once. + */ + @Test void createDuplicateTargetFilterQuery() { final String filterName = "new target filter duplicate"; final TargetFilterQueryCreate targetFilterQueryCreate = entityFactory.targetFilterQuery().create() .name(filterName).query("name==PendingTargets001"); @@ -172,9 +176,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.create(targetFilterQueryCreate)); } - @Test - @Description("Test deletion of target filter query.") - void deleteTargetFilterQuery() { + /** + * Test deletion of target filter query. + */ + @Test void deleteTargetFilterQuery() { final String filterName = "delete_target_filter_query"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement.create(entityFactory.targetFilterQuery() .create().name(filterName).query("name==PendingTargets001")); @@ -184,9 +189,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { "Returns null as the target filter is deleted"); } - @Test - @Description("Test update of a target filter query.") - void updateTargetFilterQuery() { + /** + * Test update of a target filter query. + */ + @Test void updateTargetFilterQuery() { final String filterName = "target_filter_01"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name(filterName).query("name==PendingTargets001")); @@ -197,9 +203,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { "Returns updated target filter query"); } - @Test - @Description("Test assigning a distribution set for auto assignment with different action types") - void assignDistributionSet() { + /** + * Test assigning a distribution set for auto assignment with different action types + */ + @Test void assignDistributionSet() { final String filterName = "target_filter_02"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name(filterName).query("name==PendingTargets001")); @@ -213,9 +220,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { verifyAutoAssignmentWithSoftDeletedDs(targetFilterQuery); } - @Test - @Description("Assigns a distribution set to an existing filter query and verifies that the quota 'max targets per auto assignment' is enforced.") - void assignDistributionSetToTargetFilterQueryThatExceedsQuota() { + /** + * Assigns a distribution set to an existing filter query and verifies that the quota 'max targets per auto assignment' is enforced. + */ + @Test void assignDistributionSetToTargetFilterQueryThatExceedsQuota() { // create targets final int maxTargets = quotaManagement.getMaxTargetsPerAutoAssignment(); testdataFactory.createTargets(maxTargets + 1, "target%s"); @@ -233,9 +241,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Test - @Description("Updates an existing filter query with a query string that addresses too many targets.") - void updateTargetFilterQueryWithQueryThatExceedsQuota() { + /** + * Updates an existing filter query with a query string that addresses too many targets. + */ + @Test void updateTargetFilterQueryWithQueryThatExceedsQuota() { // create targets final int maxTargets = quotaManagement.getMaxTargetsPerAutoAssignment(); testdataFactory.createTargets(maxTargets + 1, "target%s"); @@ -252,9 +261,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.update(targetFilterQueryUpdate)); } - @Test - @Description("Test removing distribution set while it has a relation to a target filter query") - void removeAssignDistributionSet() { + /** + * Test removing distribution set while it has a relation to a target filter query + */ + @Test void removeAssignDistributionSet() { final String filterName = "target_filter_03"; final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name(filterName).query("name==PendingTargets001")); @@ -279,9 +289,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { assertNull(tfq.getAutoAssignActionType(), "Returns action type as null"); } - @Test - @Description("Test to implicitly remove the auto assign distribution set when the ds is soft deleted") - void implicitlyRemoveAssignDistributionSet() { + /** + * Test to implicitly remove the auto assign distribution set when the ds is soft deleted + */ + @Test void implicitlyRemoveAssignDistributionSet() { final String filterName = "target_filter_03"; final DistributionSet distributionSet = testdataFactory.createDistributionSet("dist_set"); final Target target = testdataFactory.createTarget(); @@ -313,9 +324,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { assertNull(tfq.getAutoAssignActionType(), "Returns action type as null"); } - @Test - @Description("Test finding and auto assign distribution set") - void findFiltersWithDistributionSet() { + /** + * Test finding and auto assign distribution set + */ + @Test void findFiltersWithDistributionSet() { final String filterName = "d"; assertEquals(0L, targetFilterQueryManagement.count()); targetFilterQueryManagement.create(entityFactory.targetFilterQuery().create().name("a").query("name==*")); @@ -344,9 +356,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { verifyFindForAllWithAutoAssignDs(tfq, tfq2); } - @Test - @Description("Creating or updating a target filter query with autoassignment and no-value weight when multi assignment in enabled.") - void weightNotRequiredInMultiAssignmentMode() { + /** + * Creating or updating a target filter query with autoassignment and no-value weight when multi assignment in enabled. + */ + @Test void weightNotRequiredInMultiAssignmentMode() { enableMultiAssignments(); final DistributionSet ds = testdataFactory.createDistributionSet(); final Long filterId = targetFilterQueryManagement.create(entityFactory.targetFilterQuery().create().name("a").query("name==*")).getId(); @@ -361,9 +374,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isNotNull(); } - @Test - @Description("Creating or updating a target filter query with autoassignment with a weight causes an error when multi assignment in disabled.") - void weightAllowedWhenMultiAssignmentModeNotEnabled() { + /** + * Creating or updating a target filter query with autoassignment with a weight causes an error when multi assignment in disabled. + */ + @Test void weightAllowedWhenMultiAssignmentModeNotEnabled() { final DistributionSet ds = testdataFactory.createDistributionSet(); final Long filterId = targetFilterQueryManagement.create(entityFactory.targetFilterQuery().create().name("a").query("name==*")).getId(); @@ -378,9 +392,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isNotNull(); } - @Test - @Description("Auto assignment can be removed from filter when multi assignment in enabled.") - void removeDsFromFilterWhenMultiAssignmentModeNotEnabled() { + /** + * Auto assignment can be removed from filter when multi assignment in enabled. + */ + @Test void removeDsFromFilterWhenMultiAssignmentModeNotEnabled() { enableMultiAssignments(); final DistributionSet ds = testdataFactory.createDistributionSet(); final Long filterId = targetFilterQueryManagement.create( @@ -391,9 +406,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isNotNull(); } - @Test - @Description("Weight is validated and saved to the Filter.") - void weightValidatedAndSaved() { + /** + * Weight is validated and saved to the Filter. + */ + @Test void weightValidatedAndSaved() { enableMultiAssignments(); final DistributionSet ds = testdataFactory.createDistributionSet(); @@ -421,9 +437,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { assertThat(targetFilterQueryManagement.get(filterId).get().getAutoAssignWeight()).contains(Action.WEIGHT_MIN); } - @Test - @Description("Verifies that an exception is thrown when trying to create a target filter with an invalidated distribution set.") - void createTargetFilterWithInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to create a target filter with an invalidated distribution set. + */ + @Test void createTargetFilterWithInvalidDistributionSet() { final DistributionSet distributionSet = testdataFactory.createAndInvalidateDistributionSet(); final TargetFilterQueryCreate targetFilterQueryCreate = entityFactory.targetFilterQuery().create() @@ -433,9 +450,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.create(targetFilterQueryCreate)); } - @Test - @Description("Verifies that an exception is thrown when trying to create a target filter with an incomplete distribution set.") - void createTargetFilterWithIncompleteDistributionSet() { + /** + * Verifies that an exception is thrown when trying to create a target filter with an incomplete distribution set. + */ + @Test void createTargetFilterWithIncompleteDistributionSet() { final DistributionSet distributionSet = testdataFactory.createIncompleteDistributionSet(); final TargetFilterQueryCreate targetFilterQueryCreate = entityFactory.targetFilterQuery().create() @@ -446,9 +464,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.create(targetFilterQueryCreate)); } - @Test - @Description("Verifies that an exception is thrown when trying to update a target filter with an invalidated distribution set.") - void updateAutoAssignDsWithInvalidDistributionSet() { + /** + * Verifies that an exception is thrown when trying to update a target filter with an invalidated distribution set. + */ + @Test void updateAutoAssignDsWithInvalidDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name("updateAutoAssignDsWithInvalidDistributionSet") @@ -462,9 +481,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Test - @Description("Verifies that an exception is thrown when trying to update a target filter with an incomplete distribution set.") - void updateAutoAssignDsWithIncompleteDistributionSet() { + /** + * Verifies that an exception is thrown when trying to update a target filter with an incomplete distribution set. + */ + @Test void updateAutoAssignDsWithIncompleteDistributionSet() { final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement.create( entityFactory.targetFilterQuery().create().name("updateAutoAssignDsWithIncompleteDistributionSet") @@ -478,9 +498,10 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Test - @Description("Tests the auto assign action type mapping.") - void testAutoAssignActionTypeConvert() { + /** + * Tests the auto assign action type mapping. + */ + @Test void testAutoAssignActionTypeConvert() { for (final ActionType actionType : ActionType.values()) { final Supplier create = () -> targetFilterQueryManagement.create( @@ -506,7 +527,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { jpaTargetFilterQuery.setAutoAssignActionType(ActionType.TIMEFORCED)); } - @Step private void verifyAutoAssignmentWithDefaultActionType(final String filterName, final TargetFilterQuery targetFilterQuery, final DistributionSet distributionSet) { targetFilterQueryManagement.updateAutoAssignDS(entityFactory.targetFilterQuery() @@ -515,7 +535,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { verifyAutoAssignDsAndActionType(filterName, distributionSet, ActionType.FORCED); } - @Step private void verifyAutoAssignmentWithSoftActionType(final String filterName, final TargetFilterQuery targetFilterQuery, final DistributionSet distributionSet) { targetFilterQueryManagement.updateAutoAssignDS(entityFactory.targetFilterQuery() @@ -523,7 +542,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { verifyAutoAssignDsAndActionType(filterName, distributionSet, ActionType.SOFT); } - @Step private void verifyAutoAssignmentWithDownloadOnlyActionType(final String filterName, final TargetFilterQuery targetFilterQuery, final DistributionSet distributionSet) { targetFilterQueryManagement @@ -532,7 +550,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { verifyAutoAssignDsAndActionType(filterName, distributionSet, ActionType.DOWNLOAD_ONLY); } - @Step private void verifyAutoAssignmentWithInvalidActionType(final TargetFilterQuery targetFilterQuery, final DistributionSet distributionSet) { // assigning a distribution set with TIMEFORCED action is supposed to @@ -545,7 +562,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Step private void verifyAutoAssignmentWithIncompleteDs(final TargetFilterQuery targetFilterQuery) { final DistributionSet incompleteDistributionSet = distributionSetManagement .create(entityFactory.distributionSet().create().name("incomplete").version("1") @@ -557,7 +573,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Step private void verifyAutoAssignmentWithSoftDeletedDs(final TargetFilterQuery targetFilterQuery) { final DistributionSet softDeletedDs = testdataFactory.createDistributionSet("softDeleted"); assignDistributionSet(softDeletedDs, testdataFactory.createTarget("forSoftDeletedDs")); @@ -569,7 +584,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetFilterQueryManagement.updateAutoAssignDS(autoAssignDistributionSetUpdate)); } - @Step private void verifyFindByDistributionSetAndRsql(final DistributionSet distributionSet, final String rsql, final TargetFilterQuery... expectedFilterQueries) { final Page tfqList = targetFilterQueryManagement @@ -585,7 +599,6 @@ class TargetFilterQueryManagementTest extends AbstractJpaIntegrationTest { Arrays.stream(expectedFilterQueries).map(TargetFilterQuery::getId).toArray(Long[]::new)); } - @Step private void verifyFindForAllWithAutoAssignDs(final TargetFilterQuery... expectedFilterQueries) { final Slice tfqList = targetFilterQueryManagement .findWithAutoAssignDS(PageRequest.of(0, 500)); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSearchTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSearchTest.java index 2aa67ea5b..33f113d7e 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSearchTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSearchTest.java @@ -16,10 +16,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.FilterParams; import org.eclipse.hawkbit.repository.builder.DistributionSetCreate; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -33,15 +29,18 @@ import org.eclipse.hawkbit.repository.model.TargetType; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; import org.junit.jupiter.api.Test; -@Feature("Component Tests - Repository") -@Story("Target Management Searches") +/** + * Feature: Component Tests - Repository
+ * Story: Target Management Searches + */ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { private static final String SPACE_AND_DESCRIPTION = " description"; - @Test - @Description("Verifies that targets with given target type are returned from repository.") - void findTargetByTargetType() { + /** + * Verifies that targets with given target type are returned from repository. + */ + @Test void findTargetByTargetType() { final TargetType testType = testdataFactory.createTargetType("testType", Collections.singletonList(standardDsType)); final List unassigned = testdataFactory.createTargets(9, "unassigned"); @@ -61,10 +60,11 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { } + /** + * Tests different parameter combinations for target search operations. + * and query definitions by RSQL (named and un-named). + */ @Test - @Description("Tests different parameter combinations for target search operations. " - + "That includes both the test itself, as a count operation with the same filters " - + "and query definitions by RSQL (named and un-named).") void targetSearchWithVariousFilterCombinations() { final TargetTag targTagX = targetTagManagement.create(entityFactory.tag().create().name("TargTag-X")); final TargetTag targTagY = targetTagManagement.create(entityFactory.tag().create().name("TargTag-Y")); @@ -187,9 +187,10 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { verifyThat198TargetsAreInStatusUnknownAndOverdue(unknown, expected); } - @Test - @Description("Verifies that targets with given assigned DS are returned from repository.") - void findTargetByAssignedDistributionSet() { + /** + * Verifies that targets with given assigned DS are returned from repository. + */ + @Test void findTargetByAssignedDistributionSet() { final DistributionSet assignedSet = testdataFactory.createDistributionSet(""); testdataFactory.createTargets(10, "unassigned", "unassigned"); List assignedtargets = testdataFactory.createTargets(10, "assigned", "assigned"); @@ -205,9 +206,10 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verifies that targets without given assigned DS are returned from repository.") - void findTargetWithoutAssignedDistributionSet() { + /** + * Verifies that targets without given assigned DS are returned from repository. + */ + @Test void findTargetWithoutAssignedDistributionSet() { final DistributionSet assignedSet = testdataFactory.createDistributionSet(""); final TargetFilterQuery tfq = targetFilterQueryManagement .create(entityFactory.targetFilterQuery().create().name("tfq").query("name==*")); @@ -223,9 +225,10 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verifies that targets with given installed DS are returned from repository.") - void findTargetByInstalledDistributionSet() { + /** + * Verifies that targets with given installed DS are returned from repository. + */ + @Test void findTargetByInstalledDistributionSet() { final DistributionSet assignedSet = testdataFactory.createDistributionSet(""); final DistributionSet installedSet = testdataFactory.createDistributionSet("another"); testdataFactory.createTargets(10, "unassigned", "unassigned"); @@ -245,9 +248,10 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Verifies that all compatible targets are returned from repository.") - void shouldFindAllTargetsCompatibleWithDS() { + /** + * Verifies that all compatible targets are returned from repository. + */ + @Test void shouldFindAllTargetsCompatibleWithDS() { final DistributionSet testDs = testdataFactory.createDistributionSet(); final TargetType targetType = testdataFactory.createTargetType("testType", Collections.singletonList(testDs.getType())); @@ -264,9 +268,10 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .as("contains all targets").containsAll(targetWithCompatibleTypes).containsAll(targets); } - @Test - @Description("Verifies that incompatible targets are not returned from repository.") - void shouldNotFindTargetsIncompatibleWithDS() { + /** + * Verifies that incompatible targets are not returned from repository. + */ + @Test void shouldNotFindTargetsIncompatibleWithDS() { final DistributionSetType dsType = testdataFactory.findOrCreateDistributionSetType("test-ds-type", "test-ds-type"); final DistributionSet testDs = createDistSetWithType(dsType); @@ -295,7 +300,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .doesNotContainAnyElementsOf(targetsWithIncompatibleType); } - @Step private void verifyThat1TargetAIsInStatusPendingAndHasDSInstalled(final DistributionSet installedSet, final List pending, final Target expected) { final FilterParams filterParams = new FilterParams(pending, null, null, installedSet.getId(), Boolean.FALSE); @@ -308,7 +312,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat200targetsWithGivenTagAreInStatusPendingOrUnknown(final TargetTag targTagW, final List both, final List expected) { final FilterParams filterParams = new FilterParams(both, null, null, null, Boolean.FALSE, targTagW.getName()); @@ -322,7 +325,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat2TargetsWithGivenTagAreInPending(final TargetTag targTagW, final List pending, final List expected) { final FilterParams filterParams = new FilterParams(pending, null, null, null, Boolean.FALSE, @@ -337,7 +339,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat2TargetsWithGivenTagAndDSIsInPending(final TargetTag targTagW, final DistributionSet setA, final List pending, final List expected) { final FilterParams filterParams = new FilterParams(pending, null, null, setA.getId(), Boolean.FALSE, @@ -353,7 +354,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat1TargetWithGivenNameOrDescAndTagAndDSIsInPending(final TargetTag targTagW, final DistributionSet setA, final List pending, final Target expected) { final FilterParams filterParams = new FilterParams(pending, null, "%targ-B%", setA.getId(), Boolean.FALSE, @@ -369,7 +369,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat1TargetWithGivenNameOrDescAndDSIsInPending(final DistributionSet setA, final List pending, final Target expected) { final FilterParams filterParams = new FilterParams(pending, null, "%targ-A%", setA.getId(), Boolean.FALSE); @@ -384,7 +383,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat3TargetsWithGivenDSAreInPending(final DistributionSet setA, final List pending, final List expected) { final FilterParams filterParams = new FilterParams(pending, null, null, setA.getId(), Boolean.FALSE); @@ -399,7 +397,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat4TargetsAreInStatusPending(final List pending, final List expected) { final FilterParams filterParams = new FilterParams(pending, null, null, null, Boolean.FALSE); @@ -413,7 +410,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat99TargetsWithGivenNameOrDescAndTagAreInStatusUnknown(final TargetTag targTagW, final List unknown, final List expected) { final FilterParams filterParams = new FilterParams(unknown, null, "%targ-B%", null, Boolean.FALSE, @@ -429,7 +425,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat99TargetsWithNameOrDescriptionAreInGivenStatus(final List unknown, final List expected) { final FilterParams filterParams = new FilterParams(unknown, null, "%targ-A%", null, Boolean.FALSE); @@ -443,7 +438,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat0TargetsAreInStatusUnknownAndHaveDSAssigned(final DistributionSet setA, final List unknown) { final FilterParams filterParams = new FilterParams(unknown, null, null, setA.getId(), Boolean.FALSE); @@ -459,7 +453,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .isEmpty(); } - @Step private void verifyThat198TargetsAreInStatusUnknownAndHaveGivenTags(final TargetTag targTagY, final TargetTag targTagW, final List unknown, final List expected) { final FilterParams filterParams = new FilterParams(unknown, null, null, null, Boolean.FALSE, targTagY.getName(), @@ -475,7 +468,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat496TargetsAreInStatusUnknown(final List unknown, final List expected) { final FilterParams filterParams = new FilterParams(unknown, null, null, null, Boolean.FALSE); @@ -489,7 +481,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat198TargetsAreInStatusUnknownAndOverdue(final List unknown, final List expected) { final FilterParams filterParams = new FilterParams(unknown, Boolean.TRUE, null, null, Boolean.FALSE); @@ -504,7 +495,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat1TargetWithDescOrNameHasDS(final DistributionSet setA, final Target expected) { final FilterParams filterParams = new FilterParams(null, null, "%targ-A%", setA.getId(), Boolean.FALSE); final String query = "(name==*targ-A* or description==*targ-A*) and (assignedds.name==" + setA.getName() @@ -518,7 +508,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat3TargetsHaveDSAssigned(final DistributionSet setA, final List expected) { final FilterParams filterParams = new FilterParams(null, null, null, setA.getId(), Boolean.FALSE); final String query = "assignedds.name==" + setA.getName() + " or installedds.name==" + setA.getName(); @@ -531,7 +520,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat0TargetsWithNameOrdescAndDSHaveTag(final TargetTag targTagX, final DistributionSet setA) { final FilterParams filterParams = new FilterParams(null, null, "%targ-C%", setA.getId(), Boolean.FALSE, targTagX.getName()); @@ -546,7 +534,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .isEmpty(); } - @Step private void verifyThat0TargetsWithTagAndDescOrNameHasDS(final TargetTag targTagW, final DistributionSet setA) { final FilterParams filterParams = new FilterParams(null, null, "%targ-A%", setA.getId(), Boolean.FALSE, targTagW.getName()); @@ -560,7 +547,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .isEmpty(); } - @Step private void verifyThat1TargetHasTagHasDescOrNameAndDs(final TargetTag targTagW, final DistributionSet setA, final Target expected) { final FilterParams filterParams = new FilterParams(null, null, "%targ-C%", setA.getId(), Boolean.FALSE, @@ -575,7 +561,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThat1TargetHasNameAndId(final String name, final String controllerId) { final FilterParams filterParamsByName = new FilterParams(null, null, name, null, Boolean.FALSE); assertThat(targetManagement.findByFilters(filterParamsByName, PAGE).getContent()).as("has number of elements") @@ -588,7 +573,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .hasSize((int) targetManagement.countByFilters(filterParamsByControllerId)); } - @Step private void verifyThat100TargetsContainsGivenTextAndHaveTagAssigned(final TargetTag targTagY, final TargetTag targTagW, final List expected) { final FilterParams filterParams = new FilterParams(null, null, "%targ-B%", null, Boolean.FALSE, @@ -610,7 +594,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { return result; } - @Step private void verifyThat200TargetsHaveTagD(final TargetTag targTagD, final List expected) { final FilterParams filterParams = new FilterParams(null, null, null, null, Boolean.FALSE, targTagD.getName()); final String query = "tag==" + targTagD.getName(); @@ -622,7 +605,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findByRsql(query, PAGE).getContent()); } - @Step private void verifyThatRepositoryContains500Targets() { final FilterParams filterParams = new FilterParams(null, null, null, null, null); assertThat(targetManagement.findByFilters(filterParams, PAGE).getContent()) @@ -632,7 +614,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(targetManagement.findAll(PAGE).getContent()); } - @Step private void verifyThat1TargetHasTypeAndDSAssigned(final TargetType type, final DistributionSet set, final Target expected) { final FilterParams filterParams = new FilterParams(null, set.getId(), Boolean.FALSE, type.getId()); @@ -642,7 +623,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .as("and contains the following elements").containsExactly(expected); } - @Step private void verifyThatTargetsHasNoTypeAndDSAssignedOrInstalled(final DistributionSet set, final List expected) { final FilterParams filterParams = new FilterParams(null, set.getId(), Boolean.TRUE, null); @@ -652,7 +632,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .as("and contains the following elements").containsAll(expected); } - @Step private void verifyThat100TargetsContainsGivenTextAndHaveTypeAssigned(final TargetType targetType, final List expected) { final FilterParams filterParams = new FilterParams("%targ-E%", null, Boolean.FALSE, targetType.getId()); @@ -667,7 +646,6 @@ class TargetManagementSearchTest extends AbstractJpaIntegrationTest { .containsAll(expected.stream().map(Target::getControllerId).toList()); } - @Step private void verifyThat400TargetsContainsGivenTextAndHaveNoTypeAssigned(final List expected) { final FilterParams filterParams = new FilterParams("%targ-%", null, Boolean.TRUE, null); assertThat(targetManagement.findByFilters(filterParams, PAGE).getContent()).as("has number of elements") diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSecurityTest.java index 2ab31e1a6..7fcdedd52 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementSecurityTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.FilterParams; @@ -24,372 +21,429 @@ import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - TargetManagement") -@Story("SecurityTests TargetManagement") +/** + * Feature: SecurityTests - TargetManagement
+ * Story: SecurityTests TargetManagement + */ class TargetManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByAssignedDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByAssignedDistributionSetPermissionsCheck() { assertPermissions(() -> targetManagement.countByAssignedDistributionSet(1L), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByFiltersPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByFiltersPermissionsCheck() { assertPermissions(() -> targetManagement.countByFilters(new FilterParams(null, null, null, null, null, null)), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByInstalledDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByInstalledDistributionSetPermissionsCheck() { assertPermissions(() -> targetManagement.countByInstalledDistributionSet(1L), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void existsByInstalledOrAssignedDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void existsByInstalledOrAssignedDistributionSetPermissionsCheck() { assertPermissions(() -> targetManagement.existsByInstalledOrAssignedDistributionSet(1L), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlPermissionsCheck() { assertPermissions(() -> targetManagement.countByRsql("controllerId==id"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlAndUpdatablePermissionsCheck() { assertPermissions(() -> targetManagement.countByRsqlAndUpdatable("controllerId==id"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlAndCompatiblePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlAndCompatiblePermissionsCheck() { assertPermissions(() -> targetManagement.countByRsqlAndCompatible("controllerId==id", 1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions(() -> targetManagement.countByRsqlAndCompatibleAndUpdatable("controllerId==id", 1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByFailedInRolloutPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByFailedInRolloutPermissionsCheck() { assertPermissions(() -> targetManagement.countByFailedInRollout("1", 1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countPermissionsCheck() { assertPermissions(() -> targetManagement.count(), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionsCheck() { assertPermissions(() -> targetManagement.create(entityFactory.target().create().controllerId("controller").name("name")), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createCollectionPermissionsCheck() { assertPermissions(() -> targetManagement.create(List.of(entityFactory.target().create().controllerId("controller").name("name"))), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionsCheck() { assertPermissions(() -> { targetManagement.delete(List.of(1L)); return null; }, List.of(SpPermission.DELETE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteByControllerIDPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteByControllerIDPermissionsCheck() { assertPermissions(() -> { targetManagement.deleteByControllerID("controllerId"); return null; }, List.of(SpPermission.DELETE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByTargetFilterQueryPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByTargetFilterQueryPermissionsCheck() { assertPermissions(() -> targetManagement.countByTargetFilterQuery(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions(() -> targetManagement.findByTargetFilterQueryAndNonDSAndCompatibleAndUpdatable(1L, "controllerId==id", PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlAndNonDSAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlAndNonDSAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions(() -> targetManagement.countByRsqlAndNonDSAndCompatibleAndUpdatable(1L, "controllerId==id"), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions( () -> targetManagement.findByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatable(List.of(1L), "controllerId==id", entityFactory.distributionSetType().create().build(), PAGE ), List.of(SpPermission.READ_TARGET, SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByActionsInRolloutGroupPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByActionsInRolloutGroupPermissionsCheck() { assertPermissions(() -> targetManagement.countByActionsInRolloutGroup(1L), List.of(SpPermission.READ_TARGET, SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions(() -> targetManagement.countByRsqlAndNotInRolloutGroupsAndCompatibleAndUpdatable("controllerId==id", List.of(1L), entityFactory.distributionSetType().create().build()), List.of(SpPermission.READ_TARGET, SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByFailedRolloutAndNotInRolloutGroupsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByFailedRolloutAndNotInRolloutGroupsPermissionsCheck() { assertPermissions(() -> targetManagement.findByFailedRolloutAndNotInRolloutGroups("1", List.of(1L), PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByFailedRolloutAndNotInRolloutGroupsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByFailedRolloutAndNotInRolloutGroupsPermissionsCheck() { assertPermissions(() -> targetManagement.countByFailedRolloutAndNotInRolloutGroups("1", List.of(1L)), List.of(SpPermission.READ_TARGET, SpPermission.READ_ROLLOUT)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByInRolloutGroupWithoutActionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByInRolloutGroupWithoutActionPermissionsCheck() { assertPermissions(() -> targetManagement.findByInRolloutGroupWithoutAction(1L, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByAssignedDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByAssignedDistributionSetPermissionsCheck() { assertPermissions(() -> targetManagement.findByAssignedDistributionSet(1L, PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByAssignedDistributionSetAndRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByAssignedDistributionSetAndRsqlPermissionsCheck() { assertPermissions(() -> targetManagement.findByAssignedDistributionSetAndRsql(1L, "controllerId==id", PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByControllerCollectionIDPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByControllerCollectionIDPermissionsCheck() { assertPermissions(() -> targetManagement.getByControllerID(List.of("controllerId")), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByControllerIDPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByControllerIDPermissionsCheck() { assertPermissions(() -> targetManagement.getByControllerID("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByFiltersPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByFiltersPermissionsCheck() { assertPermissions(() -> targetManagement.findByFilters(new FilterParams(null, null, null, null, null, null), PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByInstalledDistributionSetPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByInstalledDistributionSetPermissionsCheck() { assertPermissions(() -> targetManagement.findByInstalledDistributionSet(1L, PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByInstalledDistributionSetAndRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByInstalledDistributionSetAndRsqlPermissionsCheck() { assertPermissions(() -> targetManagement.findByInstalledDistributionSetAndRsql(1L, "controllerId==id", PAGE), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByUpdateStatusPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByUpdateStatusPermissionsCheck() { assertPermissions(() -> targetManagement.findByUpdateStatus(TargetUpdateStatus.IN_SYNC, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllPermissionsCheck() { assertPermissions(() -> targetManagement.findAll(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlPermissionsCheck() { assertPermissions(() -> targetManagement.findByRsql("controllerId==id", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTargetFilterQueryPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTargetFilterQueryPermissionsCheck() { assertPermissions(() -> targetManagement.findByTargetFilterQuery(1L, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByTagPermissionsCheck() { assertPermissions(() -> targetManagement.findByTag(1L, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlAndTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlAndTagPermissionsCheck() { assertPermissions(() -> targetManagement.findByRsqlAndTag("controllerId==id", 1L, PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignTypePermissionsCheck() { assertPermissions(() -> targetManagement.assignType(List.of("controllerId"), 1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignTypeByIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignTypeByIdPermissionsCheck() { assertPermissions(() -> targetManagement.unassignType("controllerId"), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignTagWithHandlerPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignTagWithHandlerPermissionsCheck() { assertPermissions(() -> targetManagement.assignTag(List.of("controllerId"), 1L, strings -> {}), List.of(SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignTagPermissionsCheck() { assertPermissions(() -> targetManagement.assignTag(List.of("controllerId"), 1L), List.of(SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignTagPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignTagPermissionsCheck() { assertPermissions(() -> targetManagement.unassignTag(List.of("controllerId"), 1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignTagWithHandlerPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignTagWithHandlerPermissionsCheck() { assertPermissions(() -> targetManagement.unassignTag(List.of("controllerId"), 1L, strings -> {}), List.of(SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void unassignTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void unassignTypePermissionsCheck() { assertPermissions(() -> targetManagement.unassignType(List.of("controllerId")), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignTypeByIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignTypeByIdPermissionsCheck() { assertPermissions(() -> targetManagement.assignType("controllerId", 1L), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionsCheck() { assertPermissions(() -> targetManagement.update(entityFactory.target().update("controllerId")), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getPermissionsCheck() { assertPermissions(() -> targetManagement.get(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getCollectionPermissionsCheck() { assertPermissions(() -> targetManagement.get(List.of(1L)), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void existsByControllerIdPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void existsByControllerIdPermissionsCheck() { assertPermissions(() -> targetManagement.existsByControllerId("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatablePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatablePermissionsCheck() { assertPermissions( () -> targetManagement.isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatable("controllerId", 1L, "controllerId==id"), List.of(SpPermission.READ_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getTagsPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getTagsPermissionsCheck() { assertPermissions(() -> targetManagement.getTags("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getControllerAttributesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getControllerAttributesPermissionsCheck() { assertPermissions(() -> targetManagement.getControllerAttributes("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void requestControllerAttributesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void requestControllerAttributesPermissionsCheck() { assertPermissions(() -> { targetManagement.requestControllerAttributes("controllerId"); return null; }, List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void isControllerAttributesRequestedPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void isControllerAttributesRequestedPermissionsCheck() { assertPermissions(() -> targetManagement.isControllerAttributesRequested("controllerId"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByControllerAttributesRequestedPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByControllerAttributesRequestedPermissionsCheck() { assertPermissions(() -> targetManagement.findByControllerAttributesRequested(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createMetadataPermissionsCheck() { assertPermissions( () -> { targetManagement.createMetadata("controllerId", Map.of("key", "value")); @@ -398,15 +452,17 @@ class TargetManagementSecurityTest extends AbstractJpaIntegrationTest { List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getMetadataPermissionsCheck() { assertPermissions(() -> targetManagement.getMetadata("controllerId"), List.of(SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - @WithUser(principal = "user", authorities = { SpPermission.UPDATE_REPOSITORY }) + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test @WithUser(principal = "user", authorities = { SpPermission.UPDATE_REPOSITORY }) void updateMetadataPermissionsCheck() { assertPermissions(() -> { targetManagement.updateMetadata("controllerId", "key", "value"); @@ -415,9 +471,10 @@ class TargetManagementSecurityTest extends AbstractJpaIntegrationTest { List.of(SpPermission.UPDATE_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteMetadataPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteMetadataPermissionsCheck() { assertPermissions(() -> { targetManagement.deleteMetadata("controllerId", "key"); return null; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementTest.java index 0dada8570..769fb0ba8 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetManagementTest.java @@ -27,10 +27,6 @@ import java.util.Optional; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.awaitility.Awaitility; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.im.authentication.SpRole; @@ -82,15 +78,19 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; -@Feature("Component Tests - Repository") -@Story("Target Management") +/** + * Feature: Component Tests - Repository
+ * Story: Target Management + */ class TargetManagementTest extends AbstractJpaIntegrationTest { private static final String WHITESPACE_ERROR = "target with whitespaces in controller id should not be created"; + /** + * Verifies that management get access react as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access react as specified on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) void nonExistingEntityAccessReturnsNotPresent() { final Target target = testdataFactory.createTarget(); @@ -99,9 +99,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetManagement.getMetadata(target.getControllerId()).get(NOT_EXIST_ID)).isNull(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetTagCreatedEvent.class, count = 1) }) @@ -155,9 +157,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> targetManagement.updateMetadata(NOT_EXIST_ID, "xxx", "xxx"), "Target"); } - @Test - @Description("Ensures that retrieving the target security is only permitted with the necessary permissions.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) + /** + * Ensures that retrieving the target security is only permitted with the necessary permissions. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) void getTargetSecurityTokenOnlyWithCorrectPermission() throws Exception { final Target createdTarget = targetManagement .create(entityFactory.target().create().controllerId("targetWithSecurityToken").securityToken("token")); @@ -191,9 +194,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(securityTokenWithoutPermission).isNull(); } - @Test - @Description("Verify that a target with same controller ID than another device cannot be created.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) + /** + * Verify that a target with same controller ID than another device cannot be created. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) void createTargetThatViolatesUniqueConstraintFails() { final TargetCreate targetCreate = entityFactory.target().create().controllerId("123"); targetManagement.create(targetCreate); @@ -202,9 +206,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.create(targetCreate)); } - @Test - @Description("Verify that a target with with invalid properties cannot be created or updated") - @ExpectEvents({ + /** + * Verify that a target with with invalid properties cannot be created or updated + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class) }) void createAndUpdateTargetWithInvalidFields() { @@ -217,9 +222,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { createAndUpdateTargetWithInvalidAddress(target); } - @Test - @Description("Ensures that targets can assigned and unassigned to a target tag. Not exists target will be ignored for the assignment.") - @ExpectEvents({ + /** + * Ensures that targets can assigned and unassigned to a target tag. Not exists target will be ignored for the assignment. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 4), @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 5) }) @@ -253,9 +259,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Ensures that targets can deleted e.g. test all cascades") - @ExpectEvents({ + /** + * Ensures that targets can deleted e.g. test all cascades + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 12), @Expect(type = TargetDeletedEvent.class, count = 12), @Expect(type = TargetUpdatedEvent.class, count = 6) }) @@ -283,9 +290,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetManagement.count()).as("target count is wrong").isZero(); } - @Test - @Description("Finds a target by given ID and checks if all data is in the response (including the data defined as lazy).") - @ExpectEvents({ + /** + * Finds a target by given ID and checks if all data is in the response (including the data defined as lazy). + */ + @Test @ExpectEvents({ @Expect(type = DistributionSetCreatedEvent.class, count = 2), @Expect(type = SoftwareModuleCreatedEvent.class, count = 6), @Expect(type = DistributionSetUpdatedEvent.class, count = 2), // implicit lock @@ -353,9 +361,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(installedDs).as("Installed ds is wrong").isEqualTo(testDs1); } - @Test - @Description("Checks if the EntityAlreadyExistsException is thrown if the targets with the same controller ID are created twice.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 5) }) + /** + * Checks if the EntityAlreadyExistsException is thrown if the targets with the same controller ID are created twice. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 5) }) void createMultipleTargetsDuplicate() { testdataFactory.createTargets(5, "mySimpleTargs", "my simple targets"); assertThatExceptionOfType(EntityAlreadyExistsException.class) @@ -363,9 +372,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> testdataFactory.createTargets(5, "mySimpleTargs", "my simple targets")); } - @Test - @Description("Checks if the EntityAlreadyExistsException is thrown if a single target with the same controller ID are created twice.") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) + /** + * Checks if the EntityAlreadyExistsException is thrown if a single target with the same controller ID are created twice. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1) }) void createTargetDuplicate() { final TargetCreate targetCreate = entityFactory.target().create().controllerId("4711"); targetManagement.create(targetCreate); @@ -374,9 +384,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.create(targetCreate)); } + /** + * Creates and updates a target and verifies the changes in the repository. + */ @Test @WithUser(allSpPermissions = true) - @Description("Creates and updates a target and verifies the changes in the repository.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetUpdatedEvent.class, count = 1) }) @@ -412,9 +424,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(foundTarget.getLastModifiedAt()); } + /** + * Create multiple targets as bulk operation and delete them in bulk. + */ @Test @WithUser(allSpPermissions = true) - @Description("Create multiple targets as bulk operation and delete them in bulk.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 101), @Expect(type = TargetUpdatedEvent.class, count = 100), @@ -480,9 +494,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetsLeft).as("Not all undeleted found").doesNotContain(deletedTargets); } - @Test - @Description("Tests the assignment of tags to the a single target.") - @ExpectEvents({ + /** + * Tests the assignment of tags to the a single target. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 2), @Expect(type = TargetTagCreatedEvent.class, count = 7), @Expect(type = TargetUpdatedEvent.class, count = 7) }) @@ -513,9 +528,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .hasSize(noT2Tags).doesNotContain(toArray(t1Tags, TargetTag.class)); } - @Test - @Description("Tests the assignment of tags to multiple targets.") - @ExpectEvents({ + /** + * Tests the assignment of tags to multiple targets. + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 50), @Expect(type = TargetTagCreatedEvent.class, count = 4), @Expect(type = TargetUpdatedEvent.class, count = 80) }) @@ -583,9 +599,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .as("Target count is wrong").isEqualTo(targetWithTagC.size()); } - @Test - @Description("Tests the unassigment of tags to multiple targets.") - @ExpectEvents({ + /** + * Tests the unassigment of tags to multiple targets. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 3), @Expect(type = TargetCreatedEvent.class, count = 109), @Expect(type = TargetUpdatedEvent.class, count = 227) }) @@ -642,9 +659,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { checkTargetHasNotTags(targABCs, targTagC); } - @Test - @Description("Test that NO TAG functionality which gives all targets with no tag assigned.") - @ExpectEvents({ + /** + * Test that NO TAG functionality which gives all targets with no tag assigned. + */ + @Test @ExpectEvents({ @Expect(type = TargetTagCreatedEvent.class, count = 1), @Expect(type = TargetCreatedEvent.class, count = 50), @Expect(type = TargetUpdatedEvent.class, count = 25) }) @@ -664,9 +682,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Tests the a target can be read with only the read target permission") - @ExpectEvents({ + /** + * Tests the a target can be read with only the read target permission + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 1), @Expect(type = TargetPollEvent.class, count = 1) }) void targetCanBeReadWithOnlyReadTargetPermission() throws Exception { @@ -683,9 +702,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Test that RSQL filter finds targets with tags or specific ids.") - void findTargetsWithTagOrId() { + /** + * Test that RSQL filter finds targets with tags or specific ids. + */ + @Test void findTargetsWithTagOrId() { final String rsqlFilter = "tag==Targ-A-Tag,id==target-id-B-00001,id==target-id-B-00008"; final TargetTag targTagA = targetTagManagement.create(entityFactory.tag().create().name("Targ-A-Tag")); final List targAs = testdataFactory.createTargets(25, "target-id-A", "first description").stream() @@ -702,9 +722,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(27L); } - @Test - @Description("Verify that the find all targets by ids method contains the entities that we are looking for") - @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 12) }) + /** + * Verify that the find all targets by ids method contains the entities that we are looking for + */ + @Test @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 12) }) void verifyFindTargetAllById() { final List searchIds = Arrays.asList(testdataFactory.createTarget("target-4").getId(), testdataFactory.createTarget("target-5").getId(), testdataFactory.createTarget("target-6").getId()); @@ -720,9 +741,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(collect).containsAll(searchIds); } - @Test - @Description("Verify that the flag for requesting controller attributes is set correctly.") - void verifyRequestControllerAttributes() { + /** + * Verify that the flag for requesting controller attributes is set correctly. + */ + @Test void verifyRequestControllerAttributes() { final String knownControllerId = "KnownControllerId"; final Target target = createTargetWithAttributes(knownControllerId); @@ -738,17 +760,19 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Checks that metadata for a target can be created.") - void createMetadata() { + /** + * Checks that metadata for a target can be created. + */ + @Test void createMetadata() { insertMetadata( "targetMetaKnownKey", "targetMetaKnownValue", testdataFactory.createTarget("targetIdWithMetadata")); // and validate } - @Test - @Description("Verifies the enforcement of the metadata quota per target.") - void createMetadataUntilQuotaIsExceeded() { + /** + * Verifies the enforcement of the metadata quota per target. + */ + @Test void createMetadataUntilQuotaIsExceeded() { // add meta-data one by one final Target target1 = testdataFactory.createTarget("target1"); final int maxMetaData = quotaManagement.getMaxMetaDataEntriesPerTarget(); @@ -789,18 +813,21 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.createMetadata(target3ControllerId, metaData3)); } - @Test - @Description("Queries and loads the metadata related to a given target.") - void getMetadata() { + /** + * Queries and loads the metadata related to a given target. + */ + @Test void getMetadata() { // create targets assertThat(targetManagement.getMetadata(testdataFactory.createTarget("target0").getControllerId())).isEmpty(); assertThat(targetManagement.getMetadata(createTargetWithMetadata("target1", 10).getControllerId())).hasSize(10); assertThat(targetManagement.getMetadata(createTargetWithMetadata("target2", 8).getControllerId())).hasSize(8); } + /** + * Checks that metadata for a target can be updated. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that metadata for a target can be updated.") void updateMetadata() { final String knownKey = "myKnownKey"; final String knownValue = "myKnownValue"; @@ -828,9 +855,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetManagement.getMetadata(target.getControllerId())).containsEntry(knownKey, knownUpdateValue); } - @Test - @Description("Queries and loads the metadata related to a given target.") - void deleteMetadata() { + /** + * Queries and loads the metadata related to a given target. + */ + @Test void deleteMetadata() { final String knownKey = "myKnownKey"; final String knownValue = "myKnownValue"; @@ -844,9 +872,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.deleteMetadata(controllerId, knownKey)); } + /** + * Checks that target type for a target can be created, updated and unassigned. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that target type for a target can be created, updated and unassigned.") void createAndUpdateTargetTypeInTarget() { // create a target type final List targetTypes = testdataFactory.createTargetTypes("targettype", 2); @@ -880,9 +910,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetFound2.get().getTargetType()).isNull(); } + /** + * Checks that target type to a target can be assigned. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that target type to a target can be assigned.") void assignTargetTypeInTarget() { // create a target final Target target = testdataFactory.createTarget("target1", "testtarget"); @@ -906,9 +938,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetFound1.get().getTargetType().getId()).isEqualTo(targetType.getId()); } + /** + * Tests the assignment of types to multiple targets. + */ @Test @WithUser(allSpPermissions = true) - @Description("Tests the assignment of types to multiple targets.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class, count = 20), @Expect(type = TargetTypeCreatedEvent.class, count = 2), @@ -949,9 +983,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { checkTargetsHaveType(typeATargets, typeB); } + /** + * Checks that target type is not assigned to target if invalid. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that target type is not assigned to target if invalid.") void assignInvalidTargetTypeToTarget() { // create a target final Target target = testdataFactory.createTarget("target1", "testtarget"); @@ -977,9 +1013,11 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetFound1.get().getOptLockRevision()).isEqualTo(1); } + /** + * Checks that target type can be unassigned from target. + */ @Test @WithUser(allSpPermissions = true) - @Description("Checks that target type can be unassigned from target.") void unAssignTargetTypeFromTarget() { // create a target type final TargetType targetType = testdataFactory.findOrCreateTargetType("targettype"); @@ -1002,9 +1040,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { assertThat(targetFound1.get().getTargetType()).isNull(); } - @Test - @Description("Test that RSQL filter finds targets with metadata and/or controllerId.") - void findTargetsByRsqlWithMetadata() { + /** + * Test that RSQL filter finds targets with metadata and/or controllerId. + */ + @Test void findTargetsByRsqlWithMetadata() { final String controllerId1 = "target1"; final String controllerId2 = "target2"; createTargetWithMetadata(controllerId1, 2); @@ -1026,9 +1065,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { validateFoundTargetsByRsql(rsqlOrControllerIdNotEqualFilter, controllerId1, controllerId2); } - @Test - @Description("Test that RSQL filter finds targets with tag and metadata.") - void findTargetsByRsqlWithTypeAndMetadata() { + /** + * Test that RSQL filter finds targets with tag and metadata. + */ + @Test void findTargetsByRsqlWithTypeAndMetadata() { if (RsqlConfigHolder.getInstance().getRsqlToSpecBuilder() == LEGACY_G1) { // legacy visitor fail with that return; @@ -1048,9 +1088,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { validateFoundTargetsByRsql(rsqlAndControllerIdFilter); } - @Test - @Description("Target matches filter.") - void matchesFilter() { + /** + * Target matches filter. + */ + @Test void matchesFilter() { final Target target = createTargetWithMetadata("target1", 2); final DistributionSet ds = testdataFactory.createDistributionSet(); final String filter = "metadata.key1==target1-value1"; @@ -1059,9 +1100,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { ds.getId(), filter)).isTrue(); } - @Test - @Description("Target does not matches filter.") - void matchesFilterWrongFilter() { + /** + * Target does not matches filter. + */ + @Test void matchesFilterWrongFilter() { final Target target = testdataFactory.createTarget(); final DistributionSet ds = testdataFactory.createDistributionSet(); final String filter = "metadata.key==not_existing"; @@ -1070,9 +1112,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { ds.getId(), filter)).isFalse(); } - @Test - @Description("Target matches filter but DS already assigned.") - void matchesFilterDsAssigned() { + /** + * Target matches filter but DS already assigned. + */ + @Test void matchesFilterDsAssigned() { final Target target = testdataFactory.createTarget(); final DistributionSet ds1 = testdataFactory.createDistributionSet(); final DistributionSet ds2 = testdataFactory.createDistributionSet(); @@ -1084,9 +1127,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { ds1.getId(), filter)).isFalse(); } - @Test - @Description("Target matches filter for DS with wrong type.") - void matchesFilterWrongType() { + /** + * Target matches filter for DS with wrong type. + */ + @Test void matchesFilterWrongType() { final TargetType type = testdataFactory.createTargetType("type", Collections.emptyList()); final Target target = testdataFactory.createTarget("target", "target", type.getId()); final DistributionSet ds = testdataFactory.createDistributionSet(); @@ -1095,9 +1139,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { ds.getId(), "name==*")).isFalse(); } - @Test - @Description("Target matches filter that is invalid.") - void matchesFilterInvalidFilter() { + /** + * Target matches filter that is invalid. + */ + @Test void matchesFilterInvalidFilter() { final String target = testdataFactory.createTarget().getControllerId(); final Long ds = testdataFactory.createDistributionSet().getId(); @@ -1107,9 +1152,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatable(target, ds, "invalid_field==1")); } - @Test - @Description("Target matches filter for not existing target.") - void matchesFilterTargetNotExists() { + /** + * Target matches filter for not existing target. + */ + @Test void matchesFilterTargetNotExists() { final DistributionSet ds = testdataFactory.createDistributionSet(); assertThat(targetManagement.isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatable( @@ -1119,9 +1165,10 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { /** * Tests action based aspects of the dynamic group assignment filters. */ - @Test - @Description("Target matches filter no active action with ge weight.") - void findByTargetFilterQueryAndNoOverridingActionsAndNotInRolloutAndCompatibleAndUpdatable() { + /** + * Target matches filter no active action with ge weight. + */ + @Test void findByTargetFilterQueryAndNoOverridingActionsAndNotInRolloutAndCompatibleAndUpdatable() { final String targetPrefix = "dyn_action_filter_"; final DistributionSet distributionSet = testdataFactory.createDistributionSet(); final List targets = testdataFactory.createTargets(targetPrefix, 10); @@ -1170,18 +1217,20 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .toList()).isEqualTo(expected); } - @Test - @Description("Target matches filter for not existing DS.") - void matchesFilterDsNotExists() { + /** + * Target matches filter for not existing DS. + */ + @Test void matchesFilterDsNotExists() { final String target = testdataFactory.createTarget().getControllerId(); assertThatExceptionOfType(EntityNotFoundException.class).isThrownBy( () -> targetManagement.isTargetMatchingQueryAndDSNotAssignedAndCompatibleAndUpdatable(target, 123, "name==*")); } - @Test - @Description("Test update status convert") - void testUpdateStatusConvert() { + /** + * Test update status convert + */ + @Test void testUpdateStatusConvert() { final long id = testdataFactory.createTarget().getId(); for (final TargetUpdateStatus status : TargetUpdateStatus.values()) { final JpaTarget target = targetRepository.findById(id).orElseThrow(() -> new IllegalStateException("Target not found")); @@ -1192,7 +1241,6 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } } - @Step private void createAndUpdateTargetWithInvalidDescription(final Target target) { final TargetCreate targetCreateTooLong = entityFactory.target().create().controllerId("a") .description(randomString(513)); @@ -1217,7 +1265,6 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.update(targetUpdateInvalidHtml)); } - @Step private void createAndUpdateTargetWithInvalidName(final Target target) { final TargetCreate targetCreateTooLong = entityFactory.target().create().controllerId("a") .name(randomString(NamedEntity.NAME_MAX_SIZE + 1)); @@ -1248,7 +1295,6 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { } - @Step private void createAndUpdateTargetWithInvalidSecurityToken(final Target target) { final TargetCreate targetCreateTooLong = entityFactory.target().create().controllerId("a") .securityToken(randomString(Target.SECURITY_TOKEN_MAX_SIZE + 1)); @@ -1278,7 +1324,6 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetManagement.update(targetUpdateEmpty)); } - @Step private void createAndUpdateTargetWithInvalidAddress(final Target target) { final TargetCreate targetCreate = entityFactory.target().create().controllerId("a").address(randomString(513)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -1301,7 +1346,6 @@ class TargetManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetUpdate2.address(INVALID_TEXT_HTML)); } - @Step private void createTargetWithInvalidControllerId() { final TargetCreate targetCreateEmpty = entityFactory.target().create().controllerId(""); assertThatExceptionOfType(ConstraintViolationException.class) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementSecurityTest.java index 14c21dd1a..7f0aac91b 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementSecurityTest.java @@ -11,80 +11,89 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - TargetTagManagement") -@Story("SecurityTests TargetTagManagement") +/** + * Feature: SecurityTests - TargetTagManagement
+ * Story: SecurityTests TargetTagManagement + */ class TargetTagManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countPermissionsCheck() { assertPermissions(() -> targetTagManagement.count(), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionsCheck() { assertPermissions(() -> targetTagManagement.create(entityFactory.tag().create().name("name")), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createCollectionPermissionsCheck() { assertPermissions(() -> targetTagManagement.create(List.of(entityFactory.tag().create().name("name"))), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionsCheck() { assertPermissions(() -> { targetTagManagement.delete("tag"); return null; }, List.of(SpPermission.DELETE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllPermissionsCheck() { assertPermissions(() -> targetTagManagement.findAll(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlPermissionsCheck() { assertPermissions(() -> targetTagManagement.findByRsql("name==tag", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNamePermissionsCheck() { assertPermissions(() -> targetTagManagement.getByName("tag"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getPermissionsCheck() { assertPermissions(() -> targetTagManagement.get(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getCollectionPermissionsCheck() { assertPermissions(() -> targetTagManagement.get(List.of(1L)), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionsCheck() { assertPermissions(() -> targetTagManagement.update(entityFactory.tag().update(1L)), List.of(SpPermission.UPDATE_TARGET)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementTest.java index af37c61a0..e89d60392 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTagManagementTest.java @@ -22,10 +22,6 @@ import java.util.Random; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TargetTagManagement; import org.eclipse.hawkbit.repository.builder.TagCreate; import org.eclipse.hawkbit.repository.builder.TagUpdate; @@ -47,16 +43,18 @@ import org.springframework.data.domain.Pageable; /** * Test class for {@link TargetTagManagement}. + *

+ * Feature: Component Tests - Repository
+ * Story: Target Tag Management */ -@Feature("Component Tests - Repository") -@Story("Target Tag Management") class TargetTagManagementTest extends AbstractJpaIntegrationTest { private static final Random RND = new Random(); - @Test - @Description("Verifies that tagging of set containing missing DS throws meaningful and correct exception.") - void failOnMissingDs() { + /** + * Verifies that tagging of set containing missing DS throws meaningful and correct exception. + */ + @Test void failOnMissingDs() { final Collection group = testdataFactory.createTargets(5).stream() .map(Target::getControllerId) .toList(); @@ -85,18 +83,22 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { }); } + /** + * Verifies that management get access reacts as specfied on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access reacts as specfied on calls for non existing entities by means " + - "of Optional not present.") @ExpectEvents({ @Expect(type = TargetCreatedEvent.class) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(targetTagManagement.getByName(NOT_EXIST_ID)).isNotPresent(); assertThat(targetTagManagement.get(NOT_EXIST_IDL)).isNotPresent(); } + /** + * Verifies that management queries react as specfied on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specfied on calls for non existing entities " + - " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = DistributionSetTagUpdatedEvent.class), @Expect(type = TargetTagUpdatedEvent.class) }) @@ -106,18 +108,20 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { verifyThrownExceptionBy(() -> getTargetTags(NOT_EXIST_ID), "Target"); } - @Test - @Description("Verify that a tag with with invalid properties cannot be created or updated") - void createAndUpdateTagWithInvalidFields() { + /** + * Verify that a tag with with invalid properties cannot be created or updated + */ + @Test void createAndUpdateTagWithInvalidFields() { final TargetTag tag = targetTagManagement.create(entityFactory.tag().create().name("tag1").description("tagdesc1")); createAndUpdateTagWithInvalidDescription(tag); createAndUpdateTagWithInvalidColour(tag); createAndUpdateTagWithInvalidName(tag); } - @Test - @Description("Verifies assign/unassign.") - void assignAndUnassignTargetTags() { + /** + * Verifies assign/unassign. + */ + @Test void assignAndUnassignTargetTags() { final List groupA = testdataFactory.createTargets(20); final List groupB = testdataFactory.createTargets(20, "groupb", "groupb"); @@ -152,18 +156,20 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { assertThat(targetManagement.findByTag(tag.getId(), Pageable.unpaged()).getContent()).isEmpty(); } - @Test - @Description("Ensures that all tags are retrieved through repository.") - void findAllTargetTags() { + /** + * Ensures that all tags are retrieved through repository. + */ + @Test void findAllTargetTags() { final List tags = createTargetsWithTags(); assertThat(targetTagRepository.findAll()).isEqualTo(targetTagRepository.findAll()).isEqualTo(tags) .as("Wrong tag size").hasSize(20); } - @Test - @Description("Ensures that a created tag is persisted in the repository as defined.") - void createTargetTag() { + /** + * Ensures that a created tag is persisted in the repository as defined. + */ + @Test void createTargetTag() { final Tag tag = targetTagManagement .create(entityFactory.tag().create().name("kai1").description("kai2").colour("colour")); @@ -173,9 +179,10 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { assertThat(targetTagManagement.get(tag.getId()).get().getColour()).as("wrong tag found").isEqualTo("colour"); } - @Test - @Description("Ensures that a deleted tag is removed from the repository as defined.") - void deleteTargetTags() { + /** + * Ensures that a deleted tag is removed from the repository as defined. + */ + @Test void deleteTargetTags() { // create test data final Iterable tags = createTargetsWithTags(); final TargetTag toDelete = tags.iterator().next(); @@ -196,9 +203,10 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { assertThat(targetTagRepository.findAll()).as("Wrong target tag size").hasSize(19); } - @Test - @Description("Tests the name update of a target tag.") - void updateTargetTag() { + /** + * Tests the name update of a target tag. + */ + @Test void updateTargetTag() { final List tags = createTargetsWithTags(); // change data @@ -216,17 +224,19 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { .isEqualTo(2); } - @Test - @Description("Ensures that a tag cannot be created if one exists already with that name (expects EntityAlreadyExistsException).") - void failedDuplicateTargetTagNameException() { + /** + * Ensures that a tag cannot be created if one exists already with that name (expects EntityAlreadyExistsException). + */ + @Test void failedDuplicateTargetTagNameException() { final TagCreate tagCreate = entityFactory.tag().create().name("A"); targetTagManagement.create(tagCreate); assertThatExceptionOfType(EntityAlreadyExistsException.class).isThrownBy(() -> targetTagManagement.create(tagCreate)); } - @Test - @Description("Ensures that a tag cannot be updated to a name that already exists on another tag (expects EntityAlreadyExistsException).") - void failedDuplicateTargetTagNameExceptionAfterUpdate() { + /** + * Ensures that a tag cannot be updated to a name that already exists on another tag (expects EntityAlreadyExistsException). + */ + @Test void failedDuplicateTargetTagNameExceptionAfterUpdate() { targetTagManagement.create(entityFactory.tag().create().name("A")); final TargetTag tag = targetTagManagement.create(entityFactory.tag().create().name("B")); @@ -234,7 +244,6 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { assertThatExceptionOfType(EntityAlreadyExistsException.class).isThrownBy(() -> targetTagManagement.update(tagUpdate)); } - @Step private void createAndUpdateTagWithInvalidDescription(final Tag tag) { final TagCreate tagCraeteTooLong = entityFactory.tag().create().name("a").description(randomString(513)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -254,7 +263,6 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetTagManagement.update(tagUpdateInvalidHtml)); } - @Step private void createAndUpdateTagWithInvalidColour(final Tag tag) { final TagCreate tagCreateTooLong = entityFactory.tag().create().name("a").colour(randomString(17)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -275,7 +283,6 @@ class TargetTagManagementTest extends AbstractJpaIntegrationTest { .update(tagUpdateInvalidHtml)); } - @Step private void createAndUpdateTagWithInvalidName(final Tag tag) { final TagCreate tagCreateTooLong = entityFactory.tag().create().name(randomString(NamedEntity.NAME_MAX_SIZE + 1)); assertThatExceptionOfType(ConstraintViolationException.class) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementSecurityTest.java index 47c88a675..87dd976f8 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementSecurityTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -21,103 +18,120 @@ import org.eclipse.hawkbit.repository.test.util.WithUser; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - TargetTypeManagement") -@Story("SecurityTests TargetTypeManagement") +/** + * Feature: SecurityTests - TargetTypeManagement
+ * Story: SecurityTests TargetTypeManagement + */ class TargetTypeManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByKeyPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByKeyPermissionsCheck() { assertPermissions(() -> targetTypeManagement.getByKey("key"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getByNamePermissionsCheck() { assertPermissions(() -> targetTypeManagement.getByName("name"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countPermissionsCheck() { assertPermissions(() -> targetTypeManagement.count(), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void countByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void countByNamePermissionsCheck() { assertPermissions(() -> targetTypeManagement.countByName("name"), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createPermissionsCheck() { assertPermissions(() -> targetTypeManagement.create(entityFactory.targetType().create().name("name")), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void createCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void createCollectionPermissionsCheck() { assertPermissions(() -> targetTypeManagement.create(List.of(entityFactory.targetType().create().name("name"))), List.of(SpPermission.CREATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deletePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deletePermissionsCheck() { assertPermissions(() -> { targetTypeManagement.delete(1L); return null; }, List.of(SpPermission.DELETE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findAllPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findAllPermissionsCheck() { assertPermissions(() -> targetTypeManagement.findAll(PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByRsqlPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByRsqlPermissionsCheck() { assertPermissions(() -> targetTypeManagement.findByRsql("name==tag", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void findByNamePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void findByNamePermissionsCheck() { assertPermissions(() -> targetTypeManagement.findByName("name", PAGE), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getPermissionsCheck() { assertPermissions(() -> targetTypeManagement.get(1L), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getCollectionPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getCollectionPermissionsCheck() { assertPermissions(() -> targetTypeManagement.get(List.of(1L)), List.of(SpPermission.READ_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void updatePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void updatePermissionsCheck() { assertPermissions(() -> targetTypeManagement.update(entityFactory.targetType().update(1L)), List.of(SpPermission.UPDATE_TARGET)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void assignCompatibleDistributionSetTypesPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void assignCompatibleDistributionSetTypesPermissionsCheck() { assertPermissions(() -> targetTypeManagement.assignCompatibleDistributionSetTypes(1L, List.of(1L)), List.of(SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - @WithUser(principal = "user", authorities = { SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY }) + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test @WithUser(principal = "user", authorities = { SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY }) void unassignDistributionSetTypePermissionsCheck() { assertPermissions(() -> targetTypeManagement.unassignDistributionSetType(1L, 1L), List.of(SpPermission.UPDATE_TARGET, SpPermission.READ_REPOSITORY)); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementTest.java index e94ccb2e7..270a60947 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TargetTypeManagementTest.java @@ -18,10 +18,6 @@ import java.util.Optional; import jakarta.validation.ConstraintViolationException; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Step; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.builder.TargetTypeCreate; import org.eclipse.hawkbit.repository.builder.TargetTypeUpdate; import org.eclipse.hawkbit.repository.event.remote.entity.TargetTypeCreatedEvent; @@ -37,22 +33,28 @@ import org.eclipse.hawkbit.repository.test.matcher.Expect; import org.eclipse.hawkbit.repository.test.matcher.ExpectEvents; import org.junit.jupiter.api.Test; -@Feature("Component Tests - Repository") -@Story("Target Type Management") +/** + * Feature: Component Tests - Repository
+ * Story: Target Type Management + */ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { + /** + * Verifies that management get access react as specified on calls for non existing entities by means + * of Optional not present. + */ @Test - @Description("Verifies that management get access react as specified on calls for non existing entities by means " - + "of Optional not present.") @ExpectEvents({ @Expect(type = TargetTypeCreatedEvent.class) }) void nonExistingEntityAccessReturnsNotPresent() { assertThat(targetTypeManagement.get(NOT_EXIST_IDL)).isNotPresent(); assertThat(targetTypeManagement.getByName(NOT_EXIST_ID)).isNotPresent(); } + /** + * Verifies that management queries react as specified on calls for non existing entities + * by means of throwing EntityNotFoundException. + */ @Test - @Description("Verifies that management queries react as specified on calls for non existing entities " - + " by means of throwing EntityNotFoundException.") @ExpectEvents({ @Expect(type = TargetTypeUpdatedEvent.class) }) void entityQueriesReferringToNotExistingEntitiesThrowsException() { verifyThrownExceptionBy(() -> targetTypeManagement.delete(NOT_EXIST_IDL), "TargetType"); @@ -60,9 +62,10 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { "TargetType"); } - @Test - @Description("Verify that a target type with invalid properties cannot be created or updated") - void createAndUpdateTargetTypeWithInvalidFields() { + /** + * Verify that a target type with invalid properties cannot be created or updated + */ + @Test void createAndUpdateTargetTypeWithInvalidFields() { final TargetType targetType = targetTypeManagement .create(entityFactory.targetType().create() .name("targettype1").description("targettypedes1") @@ -74,7 +77,6 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { createAndUpdateTargetTypeWithInvalidName(targetType); } - @Step void createAndUpdateTargetTypeWithInvalidDescription(final TargetType targetType) { final TargetTypeCreate targetTypeCreateTooLong = entityFactory.targetType().create().name("a").description(randomString(TargetType.DESCRIPTION_MAX_SIZE + 1)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -98,9 +100,10 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetTypeManagement.update(targetTypeUpdateInvalidHtml)); } - @Test - @Description("Tests the successful assignment of compatible distribution set types to a target type") - void assignCompatibleDistributionSetTypesToTargetType() { + /** + * Tests the successful assignment of compatible distribution set types to a target type + */ + @Test void assignCompatibleDistributionSetTypesToTargetType() { final TargetType targetType = targetTypeManagement .create(entityFactory.targetType().create() .name("targettype1").description("targettypedes1") @@ -113,9 +116,10 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(targetTypeWithDsTypes.get().getCompatibleDistributionSetTypes()).extracting("key").contains("testDst"); } - @Test - @Description("Tests the successful removal of compatible distribution set types to a target type") - void unassignCompatibleDistributionSetTypesToTargetType() { + /** + * Tests the successful removal of compatible distribution set types to a target type + */ + @Test void unassignCompatibleDistributionSetTypesToTargetType() { final TargetType targetType = targetTypeManagement .create(entityFactory.targetType().create() .name("targettype1").description("targettypedes1") @@ -131,16 +135,18 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(targetTypeWithDsTypes1.get().getCompatibleDistributionSetTypes()).isEmpty(); } - @Test - @Description("Ensures that all types are retrieved through repository.") - void findAllTargetTypes() { + /** + * Ensures that all types are retrieved through repository. + */ + @Test void findAllTargetTypes() { testdataFactory.createTargetTypes("targettype", 10); assertThat(targetTypeRepository.findAll()).as("Target type size").hasSize(10); } - @Test - @Description("Ensures that a created target type is persisted in the repository as defined.") - void createTargetType() { + /** + * Ensures that a created target type is persisted in the repository as defined. + */ + @Test void createTargetType() { final String name = "targettype1"; final String key = "targettype1.key"; targetTypeManagement @@ -168,9 +174,10 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { .isEqualTo("colour1"); } - @Test - @Description("Ensures that a deleted target type is removed from the repository as defined.") - void deleteTargetType() { + /** + * Ensures that a deleted target type is removed from the repository as defined. + */ + @Test void deleteTargetType() { // create test data final TargetType targetType = targetTypeManagement .create(entityFactory.targetType().create().name("targettype11").description("targettypedes11")); @@ -181,9 +188,10 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Tests the name update of a target type.") - void updateTargetType() { + /** + * Tests the name update of a target type. + */ + @Test void updateTargetType() { final TargetType targetType = targetTypeManagement .create(entityFactory.targetType().create().name("targettype111").description("targettypedes111")); assertThat(findByName("targettype111").get().getDescription()).as("type found") @@ -192,24 +200,25 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { assertThat(findByName("updatedtargettype111")).as("Updated target type should be found").isPresent(); } - @Test - @Description("Ensures that a target type cannot be created if one exists already with that name (expects EntityAlreadyExistsException).") - void failedDuplicateTargetTypeNameException() { + /** + * Ensures that a target type cannot be created if one exists already with that name (expects EntityAlreadyExistsException). + */ + @Test void failedDuplicateTargetTypeNameException() { final TargetTypeCreate targetTypeCreate = entityFactory.targetType().create().name("targettype123"); targetTypeManagement.create(targetTypeCreate); assertThrows(EntityAlreadyExistsException.class, () -> targetTypeManagement.create(targetTypeCreate)); } - @Test - @Description("Ensures that a target type cannot be updated to a name that already exists (expects EntityAlreadyExistsException).") - void failedDuplicateTargetTypeNameExceptionAfterUpdate() { + /** + * Ensures that a target type cannot be updated to a name that already exists (expects EntityAlreadyExistsException). + */ + @Test void failedDuplicateTargetTypeNameExceptionAfterUpdate() { targetTypeManagement.create(entityFactory.targetType().create().name("targettype1234")); TargetType targetType = targetTypeManagement.create(entityFactory.targetType().create().name("targettype12345")); assertThrows(EntityAlreadyExistsException.class, () -> targetTypeManagement.update(entityFactory.targetType().update(targetType.getId()).name("targettype1234"))); } - @Step private void createAndUpdateTargetTypeWithInvalidColour(final TargetType targetType) { final TargetTypeCreate targetTypeCreateTooLong = entityFactory.targetType().create().name("a").colour(randomString(Type.COLOUR_MAX_SIZE + 1)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -232,7 +241,6 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetTypeManagement.update(targetTypeUpdateInvalidHtml)); } - @Step private void createTargetTypeWithInvalidKey() { final TargetTypeCreate targetTypeCreateTooLong = entityFactory.targetType().create().name(randomString(Type.KEY_MAX_SIZE + 1)); assertThatExceptionOfType(ConstraintViolationException.class) @@ -245,7 +253,6 @@ class TargetTypeManagementTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> targetTypeManagement.create(targetTypeCreateInvalidHtmle)); } - @Step private void createAndUpdateTargetTypeWithInvalidName(final TargetType targetType) { final TargetTypeCreate targetTypeCreateTooLong = entityFactory.targetType().create().name(randomString(NamedEntity.NAME_MAX_SIZE + 1)); assertThatExceptionOfType(ConstraintViolationException.class) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementSecurityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementSecurityTest.java index da80f2f5f..93998f4f8 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementSecurityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementSecurityTest.java @@ -12,66 +12,72 @@ package org.eclipse.hawkbit.repository.jpa.management; import java.util.List; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.junit.jupiter.api.Test; @Slf4j -@Feature("SecurityTests - TargetManagement") -@Story("SecurityTests TargetManagement") +/** + * Feature: SecurityTests - TargetManagement
+ * Story: SecurityTests TargetManagement + */ class TenantConfigurationManagementSecurityTest extends AbstractJpaIntegrationTest { - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void addOrUpdateConfigurationPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void addOrUpdateConfigurationPermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.addOrUpdateConfiguration("authentication.header.enabled", true), List.of(SpPermission.TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void addOrUpdateConfigurationWithMapPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void addOrUpdateConfigurationWithMapPermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.addOrUpdateConfiguration(Map.of("authentication.header.enabled", true)), List.of(SpPermission.TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void deleteConfigurationPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void deleteConfigurationPermissionsCheck() { assertPermissions(() -> { tenantConfigurationManagement.deleteConfiguration("authentication.header.enabled"); return null; }, List.of(SpPermission.TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getConfigurationValuePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getConfigurationValuePermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.getConfigurationValue("authentication.header.enabled"), List.of(SpPermission.READ_TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getConfigurationValueWithTypePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getConfigurationValueWithTypePermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.getConfigurationValue("authentication.header.enabled", Boolean.class), List.of(SpPermission.READ_TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void getGlobalConfigurationValuePermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void getGlobalConfigurationValuePermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.getGlobalConfigurationValue("authentication.header.enabled", Boolean.class), List.of(SpPermission.READ_TENANT_CONFIGURATION)); } - @Test - @Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.") - void pollStatusResolverPermissionsCheck() { + /** + * Tests ManagementAPI PreAuthorized method with correct and insufficient permissions. + */ + @Test void pollStatusResolverPermissionsCheck() { assertPermissions(() -> tenantConfigurationManagement.pollStatusResolver(), List.of(SpPermission.READ_TARGET)); } } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementTest.java index 7e1908c04..74c4de302 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/TenantConfigurationManagementTest.java @@ -18,9 +18,6 @@ import java.time.Duration; import java.util.HashMap; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.InvalidTenantConfigurationKeyException; import org.eclipse.hawkbit.repository.exception.TenantConfigurationValidatorException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -31,8 +28,10 @@ import org.junit.jupiter.api.Test; import org.springframework.context.EnvironmentAware; import org.springframework.core.env.Environment; -@Feature("Component Tests - Repository") -@Story("Tenant Configuration Management") +/** + * Feature: Component Tests - Repository
+ * Story: Tenant Configuration Management + */ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest implements EnvironmentAware { private Environment environment; @@ -42,9 +41,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple this.environment = environment; } - @Test - @Description("Tests that tenant specific configuration can be persisted and in case the tenant does not have specific configuration the default from environment is used instead.") - void storeTenantSpecificConfigurationAsString() { + /** + * Tests that tenant specific configuration can be persisted and in case the tenant does not have specific configuration the default from environment is used instead. + */ + @Test void storeTenantSpecificConfigurationAsString() { final String envPropertyDefault = environment.getProperty("hawkbit.server.ddi.security.authentication.gatewaytoken.key"); assertThat(envPropertyDefault).isNotNull(); @@ -70,9 +70,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple // assertThat(tenantConfigurationManagement.getTenantConfigurations()).hasSize(1); } - @Test - @Description("Tests that the tenant specific configuration can be updated") - void updateTenantSpecificConfiguration() { + /** + * Tests that the tenant specific configuration can be updated + */ + @Test void updateTenantSpecificConfiguration() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY; final String value1 = "firstValue"; final String value2 = "secondValue"; @@ -86,9 +87,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple assertThat(tenantConfigurationManagement.getConfigurationValue(configKey, String.class).getValue()).isEqualTo(value2); } - @Test - @Description("Tests that the tenant specific configuration can be batch updated") - void batchUpdateTenantSpecificConfiguration() { + /** + * Tests that the tenant specific configuration can be batch updated + */ + @Test void batchUpdateTenantSpecificConfiguration() { Map configuration = new HashMap<>() {{ put(TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, "token_123"); put(TenantConfigurationKey.ROLLOUT_APPROVAL_ENABLED, true); @@ -104,9 +106,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isTrue(); } - @Test - @Description("Tests that the configuration value can be converted from String to Integer automatically") - void storeAndUpdateTenantSpecificConfigurationAsBoolean() { + /** + * Tests that the configuration value can be converted from String to Integer automatically + */ + @Test void storeAndUpdateTenantSpecificConfigurationAsBoolean() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED; final Boolean value1 = true; tenantConfigurationManagement.addOrUpdateConfiguration(configKey, value1); @@ -116,9 +119,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple assertThat(tenantConfigurationManagement.getConfigurationValue(configKey, Boolean.class).getValue()).isEqualTo(value2); } - @Test - @Description("Tests that the get configuration throws exception in case the value cannot be automatically converted from String to Boolean") - void wrongTenantConfigurationValueTypeThrowsException() { + /** + * Tests that the get configuration throws exception in case the value cannot be automatically converted from String to Boolean + */ + @Test void wrongTenantConfigurationValueTypeThrowsException() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED; final String value1 = "thisIsNotABoolean"; @@ -128,9 +132,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Tests that the get configuration throws exception in case the value is the wrong type") - void batchWrongTenantConfigurationValueTypeThrowsException() { + /** + * Tests that the get configuration throws exception in case the value is the wrong type + */ + @Test void batchWrongTenantConfigurationValueTypeThrowsException() { final Map configuration = new HashMap<>() {{ put(TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, "token_123"); put(TenantConfigurationKey.ROLLOUT_APPROVAL_ENABLED, true); @@ -152,9 +157,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple } } - @Test - @Description("Tests that a deletion of a tenant specific configuration deletes it from the database.") - void deleteConfigurationReturnNullConfiguration() { + /** + * Tests that a deletion of a tenant specific configuration deletes it from the database. + */ + @Test void deleteConfigurationReturnNullConfiguration() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY; // gateway token does not have default value so no configuration value should be available @@ -177,9 +183,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple assertThat(tenantConfigurationManagement.getConfigurationValue(configKey, String.class).getValue()).isEmpty(); } - @Test - @Description("Test that an Exception is thrown, when an integer is stored but a string expected.") - void storesIntegerWhenStringIsExpected() { + /** + * Test that an Exception is thrown, when an integer is stored but a string expected. + */ + @Test void storesIntegerWhenStringIsExpected() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY; final Integer wrongDatType = 123; assertThatThrownBy(() -> tenantConfigurationManagement.addOrUpdateConfiguration(configKey, wrongDatType)) @@ -187,9 +194,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Test that an Exception is thrown, when an integer is stored but a boolean expected.") - void storesIntegerWhenBooleanIsExpected() { + /** + * Test that an Exception is thrown, when an integer is stored but a boolean expected. + */ + @Test void storesIntegerWhenBooleanIsExpected() { final String configKey = TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED; final Integer wrongDataType = 123; assertThatThrownBy(() -> tenantConfigurationManagement.addOrUpdateConfiguration(configKey, wrongDataType)) @@ -197,9 +205,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Test that an Exception is thrown, when an integer is stored as PollingTime.") - void storesIntegerWhenPollingIntervalIsExpected() { + /** + * Test that an Exception is thrown, when an integer is stored as PollingTime. + */ + @Test void storesIntegerWhenPollingIntervalIsExpected() { final String configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL; final Integer wrongDataType = 123; assertThatThrownBy(() -> tenantConfigurationManagement.addOrUpdateConfiguration(configKey, wrongDataType)) @@ -207,9 +216,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Test that an Exception is thrown, when an invalid formatted string is stored as PollingTime.") - void storesWrongFormattedStringAsPollingInterval() { + /** + * Test that an Exception is thrown, when an invalid formatted string is stored as PollingTime. + */ + @Test void storesWrongFormattedStringAsPollingInterval() { final String configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL; final String wrongFormatted = "wrongFormatted"; assertThatThrownBy(() -> tenantConfigurationManagement.addOrUpdateConfiguration(configKey, wrongFormatted)) @@ -217,9 +227,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Test that an Exception is thrown, when an invalid formatted string is stored as PollingTime.") - void storesTooSmallDurationAsPollingInterval() { + /** + * Test that an Exception is thrown, when an invalid formatted string is stored as PollingTime. + */ + @Test void storesTooSmallDurationAsPollingInterval() { final String configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL; final String tooSmallDuration = DurationHelper @@ -229,9 +240,10 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Stores a correct formatted PollignTime and reads it again.") - void storesCorrectDurationAsPollingInterval() { + /** + * Stores a correct formatted PollignTime and reads it again. + */ + @Test void storesCorrectDurationAsPollingInterval() { final String configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL; final Duration duration = DurationHelper.getDurationByTimeValues(1, 2, 0); @@ -243,17 +255,19 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple assertThat(duration).isEqualTo(DurationHelper.formattedStringToDuration(storedDurationString)); } - @Test - @Description("Request a config value in a wrong Value") - void requestConfigValueWithWrongType() { + /** + * Request a config value in a wrong Value + */ + @Test void requestConfigValueWithWrongType() { assertThatThrownBy(() -> tenantConfigurationManagement.getConfigurationValue( TenantConfigurationKey.POLLING_TIME_INTERVAL, Serializable.class)) .isInstanceOf(TenantConfigurationValidatorException.class); } - @Test - @Description("Verifies that every TenenatConfiguraationKeyName exists only once") - void verifyThatAllKeysAreDifferent() { + /** + * Verifies that every TenenatConfiguraationKeyName exists only once + */ + @Test void verifyThatAllKeysAreDifferent() { final Map keyNames = new HashMap<>(); tenantConfigurationProperties.getConfigurationKeys().forEach(key -> { assertThat(keyNames) @@ -263,16 +277,18 @@ class TenantConfigurationManagementTest extends AbstractJpaIntegrationTest imple }); } - @Test - @Description("Get TenantConfigurationKeyByName") - void getTenantConfigurationKeyByName() { + /** + * Get TenantConfigurationKeyByName + */ + @Test void getTenantConfigurationKeyByName() { final String configKey = TenantConfigurationKey.POLLING_TIME_INTERVAL; assertThat(tenantConfigurationProperties.fromKeyName(configKey).getKeyName()).isEqualTo(configKey); } - @Test - @Description("Tenant configuration which is not declared throws exception") - void storeTenantConfigurationWhichIsNotDeclaredThrowsException() { + /** + * Tenant configuration which is not declared throws exception + */ + @Test void storeTenantConfigurationWhichIsNotDeclaredThrowsException() { final String configKeyWhichDoesNotExists = "configKeyWhichDoesNotExists"; assertThatThrownBy(() -> tenantConfigurationManagement.addOrUpdateConfiguration(configKeyWhichDoesNotExists, "value")) .as("Expected InvalidTenantConfigurationKeyException for tenant configuration key which is not declared") diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/EntityInterceptorListenerTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/EntityInterceptorListenerTest.java index e26cae680..499035a95 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/EntityInterceptorListenerTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/EntityInterceptorListenerTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.model; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.jpa.EntityInterceptor; import org.eclipse.hawkbit.repository.jpa.model.helper.EntityInterceptorHolder; @@ -24,9 +21,10 @@ import org.junit.jupiter.api.Test; /** * Test the entity listener interceptor. + *

+ * Feature: Component Tests - Repository
+ * Story: Entity Listener Interceptor */ -@Feature("Component Tests - Repository") -@Story("Entity Listener Interceptor") class EntityInterceptorListenerTest extends AbstractJpaIntegrationTest { @AfterEach @@ -34,21 +32,24 @@ class EntityInterceptorListenerTest extends AbstractJpaIntegrationTest { EntityInterceptorHolder.getInstance().getEntityInterceptors().clear(); } - @Test - @Description("Verifies that the pre persist is called after a entity creation.") - void prePersistIsCalledWhenPersistingATarget() { + /** + * Verifies that the pre persist is called after a entity creation. + */ + @Test void prePersistIsCalledWhenPersistingATarget() { executePersistAndAssertCallbackResult(new PrePersistEntityListener()); } - @Test - @Description("Verifies that the post persist is called after a entity creation.") - void postPersistIsCalledWhenPersistingATarget() { + /** + * Verifies that the post persist is called after a entity creation. + */ + @Test void postPersistIsCalledWhenPersistingATarget() { executePersistAndAssertCallbackResult(new PostPersistEntityListener()); } - @Test - @Description("Verifies that the post load is called after a entity is loaded.") - void postLoadIsCalledWhenLoadATarget() { + /** + * Verifies that the post load is called after a entity is loaded. + */ + @Test void postLoadIsCalledWhenLoadATarget() { final PostLoadEntityListener postLoadEntityListener = new PostLoadEntityListener(); EntityInterceptorHolder.getInstance().getEntityInterceptors().add(postLoadEntityListener); @@ -59,27 +60,31 @@ class EntityInterceptorListenerTest extends AbstractJpaIntegrationTest { assertThat(postLoadEntityListener.getEntity()).isEqualTo(loadedTarget); } - @Test - @Description("Verifies that the pre update is called after a entity update.") - void preUpdateIsCalledWhenUpdateATarget() { + /** + * Verifies that the pre update is called after a entity update. + */ + @Test void preUpdateIsCalledWhenUpdateATarget() { executeUpdateAndAssertCallbackResult(new PreUpdateEntityListener()); } - @Test - @Description("Verifies that the post update is called after a entity update.") - void postUpdateIsCalledWhenUpdateATarget() { + /** + * Verifies that the post update is called after a entity update. + */ + @Test void postUpdateIsCalledWhenUpdateATarget() { executeUpdateAndAssertCallbackResult(new PostUpdateEntityListener()); } - @Test - @Description("Verifies that the pre remove is called after a entity deletion.") - void preRemoveIsCalledWhenDeletingATarget() { + /** + * Verifies that the pre remove is called after a entity deletion. + */ + @Test void preRemoveIsCalledWhenDeletingATarget() { executeDeleteAndAssertCallbackResult(new PreRemoveEntityListener()); } - @Test - @Description("Verifies that the post remove is called after a entity deletion.") - void postRemoveIsCalledWhenDeletingATarget() { + /** + * Verifies that the post remove is called after a entity deletion. + */ + @Test void postRemoveIsCalledWhenDeletingATarget() { executeDeleteAndAssertCallbackResult(new PostRemoveEntityListener()); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/ModelEqualsHashcodeTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/ModelEqualsHashcodeTest.java index 6ef7b6c5d..6a464a208 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/ModelEqualsHashcodeTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/model/ModelEqualsHashcodeTest.java @@ -11,20 +11,20 @@ package org.eclipse.hawkbit.repository.jpa.model; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Repository") -@Story("Repository Model") +/** + * Feature: Unit Tests - Repository
+ * Story: Repository Model + */ class ModelEqualsHashcodeTest extends AbstractJpaIntegrationTest { - @Test - @Description("Verifies that different objects even with identical primary key, version and tenant return different hash codes.") - void differentEntitiesReturnDifferentHashCodes() { + /** + * Verifies that different objects even with identical primary key, version and tenant return different hash codes. + */ + @Test void differentEntitiesReturnDifferentHashCodes() { assertThat(new JpaAction().hashCode()).as("action should have different hashcode than action status") .isNotEqualTo(new JpaActionStatus().hashCode()); assertThat(new JpaDistributionSet().hashCode()) @@ -38,9 +38,10 @@ class ModelEqualsHashcodeTest extends AbstractJpaIntegrationTest { .isNotEqualTo(new JpaActionStatus().hashCode()); } - @Test - @Description("Verifies that different object even with identical primary key, version and tenant are not equal.") - void differentEntitiesAreNotEqual() { + /** + * Verifies that different object even with identical primary key, version and tenant are not equal. + */ + @Test void differentEntitiesAreNotEqual() { assertThat(new JpaAction().equals(new JpaActionStatus())).as("action equals action status").isFalse(); assertThat(new JpaDistributionSet().equals(new JpaSoftwareModule())) .as("Distribution set equals software module").isFalse(); @@ -50,9 +51,10 @@ class ModelEqualsHashcodeTest extends AbstractJpaIntegrationTest { .as("Distribution set type equals action status").isFalse(); } - @Test - @Description("Verifies that updated entities are not equal.") - void changedEntitiesAreNotEqual() { + /** + * Verifies that updated entities are not equal. + */ + @Test void changedEntitiesAreNotEqual() { final SoftwareModuleType type = softwareModuleTypeManagement .create(entityFactory.softwareModuleType().create().key("test").name("test")); assertThat(type).as("persited entity is not equal to regular object") @@ -63,9 +65,10 @@ class ModelEqualsHashcodeTest extends AbstractJpaIntegrationTest { assertThat(type).as("Changed entity is not equal to the previous version").isNotEqualTo(updated); } - @Test - @Description("Verify that no proxy of the entity manager has an influence on the equals or hashcode result.") - void managedEntityIsEqualToUnamangedObjectWithSameKey() { + /** + * Verify that no proxy of the entity manager has an influence on the equals or hashcode result. + */ + @Test void managedEntityIsEqualToUnamangedObjectWithSameKey() { final SoftwareModuleType type = softwareModuleTypeManagement.create( entityFactory.softwareModuleType().create().key("test").name("test").description("test")); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLActionFieldsTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLActionFieldsTest.java index 96b43bc7e..2aad8de37 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLActionFieldsTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLActionFieldsTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.ActionFields; import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -30,8 +27,10 @@ import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; import org.springframework.orm.jpa.vendor.Database; -@Feature("Component Tests - Repository") -@Story("RSQL filter actions") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter actions + */ class RSQLActionFieldsTest extends AbstractJpaIntegrationTest { private JpaTarget target; @@ -49,9 +48,10 @@ class RSQLActionFieldsTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Test filter action by id") - void testFilterByParameterId() { + /** + * Test filter action by id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(ActionFields.ID.name() + "==" + action.getId(), 1); assertRSQLQuery(ActionFields.ID.name() + "!=" + action.getId(), 10); assertRSQLQuery(ActionFields.ID.name() + "==" + -1, 0); @@ -66,9 +66,10 @@ class RSQLActionFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQuery(ActionFields.ID.name() + "=out=(" + action.getId() + ",10000000)", 10); } - @Test - @Description("Test action by status") - void testFilterByParameterStatus() { + /** + * Test action by status + */ + @Test void testFilterByParameterStatus() { assertRSQLQuery(ActionFields.STATUS.name() + "==pending", 5); assertRSQLQuery(ActionFields.STATUS.name() + "!=pending", 6); assertRSQLQuery(ActionFields.STATUS.name() + "=in=(pending)", 5); @@ -80,9 +81,10 @@ class RSQLActionFieldsTest extends AbstractJpaIntegrationTest { .isThrownBy(() -> assertRSQLQuery(rsql, 5)); } - @Test - @Description("Test action by status") - void testFilterByParameterExtRef() { + /** + * Test action by status + */ + @Test void testFilterByParameterExtRef() { assertRSQLQuery(ActionFields.EXTERNALREF.name() + "==extRef", 5); assertRSQLQuery(ActionFields.EXTERNALREF.name() + "!=extRef", 6); assertRSQLQuery(ActionFields.EXTERNALREF.name() + "==extRef*", 10); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutFieldTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutFieldTest.java index 79b64e8f9..749a03d30 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutFieldTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutFieldTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.RolloutFields; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -25,8 +22,10 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -@Feature("Component Tests - Repository") -@Story("RSQL filter rollout group") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter rollout group + */ class RSQLRolloutFieldTest extends AbstractJpaIntegrationTest { private Rollout rollout; @@ -39,9 +38,10 @@ class RSQLRolloutFieldTest extends AbstractJpaIntegrationTest { rollout = rolloutManagement.get(rollout.getId()).get(); } - @Test - @Description("Test filter rollout by distrbution set type id") - void testFilterByDsType() { + /** + * Test filter rollout by distrbution set type id + */ + @Test void testFilterByDsType() { assertRSQLQuery(RolloutFields.DISTRIBUTIONSET.name() + ".type.id" + "==" + rollout.getDistributionSet().getType().getId() + 1, 0); assertRSQLQuery(RolloutFields.DISTRIBUTIONSET.name() + ".type.id" + "!=" + rollout.getDistributionSet().getType().getId() + 1, 1); assertRSQLQuery(RolloutFields.DISTRIBUTIONSET.name() + ".type.id" + "==" + rollout.getDistributionSet().getType().getId(), 1); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutGroupFieldTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutGroupFieldTest.java index 954699f82..77d7aeb6b 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutGroupFieldTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLRolloutGroupFieldTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.RolloutGroupFields; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -27,8 +24,10 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.orm.jpa.vendor.Database; -@Feature("Component Tests - Repository") -@Story("RSQL filter rollout group") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter rollout group + */ class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest { private Long rolloutGroupId; @@ -45,9 +44,10 @@ class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest { this.rolloutGroupId = rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getContent().get(0).getId(); } - @Test - @Description("Test filter rollout group by id") - void testFilterByParameterId() { + /** + * Test filter rollout group by id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(RolloutGroupFields.ID.name() + "==" + rolloutGroupId, 1); assertRSQLQuery(RolloutGroupFields.ID.name() + "!=" + rolloutGroupId, 3); assertRSQLQuery(RolloutGroupFields.ID.name() + "==" + -1, 0); @@ -62,9 +62,10 @@ class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(RolloutGroupFields.ID.name() + "=out=(" + rolloutGroupId + ",10000000)", 3); } - @Test - @Description("Test filter rollout group by name") - void testFilterByParameterName() { + /** + * Test filter rollout group by name + */ + @Test void testFilterByParameterName() { assertRSQLQuery(RolloutGroupFields.NAME.name() + "==group-1", 1); assertRSQLQuery(RolloutGroupFields.NAME.name() + "!=group-1", 3); assertRSQLQuery(RolloutGroupFields.NAME.name() + "==*", 4); @@ -73,9 +74,10 @@ class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(RolloutGroupFields.NAME.name() + "=out=(group-1,group-2)", 2); } - @Test - @Description("Test filter rollout group by description") - void testFilterByParameterDescription() { + /** + * Test filter rollout group by description + */ + @Test void testFilterByParameterDescription() { assertRSQLQuery(RolloutGroupFields.DESCRIPTION.name() + "==group-1", 1); assertRSQLQuery(RolloutGroupFields.DESCRIPTION.name() + "!=group-1", 3); assertRSQLQuery(RolloutGroupFields.DESCRIPTION.name() + "==group*", 4); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleFieldTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleFieldTest.java index d5402844b..536451b14 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleFieldTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleFieldTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.SoftwareModuleFields; import org.eclipse.hawkbit.repository.builder.SoftwareModuleMetadataCreate; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -26,8 +23,10 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.orm.jpa.vendor.Database; -@Feature("Component Tests - Repository") -@Story("RSQL filter software module") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter software module + */ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { private SoftwareModule ah; @@ -58,9 +57,10 @@ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { softwareModuleManagement.updateMetadata(softwareModuleMetadata2); } - @Test - @Description("Test filter software module by id") - void testFilterByParameterId() { + /** + * Test filter software module by id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(SoftwareModuleFields.ID.name() + "==" + ah.getId(), 1); assertRSQLQuery(SoftwareModuleFields.ID.name() + "!=" + ah.getId(), 5); assertRSQLQuery(SoftwareModuleFields.ID.name() + "==" + -1, 0); @@ -75,9 +75,10 @@ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleFields.ID.name() + "=out=(" + ah.getId() + ",1000000)", 5); } - @Test - @Description("Test filter software module by name") - void testFilterByParameterName() { + /** + * Test filter software module by name + */ + @Test void testFilterByParameterName() { assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==agent-hub", 1); assertRSQLQuery(SoftwareModuleFields.NAME.name() + "!=agent-hub", 5); assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==agent-hub*", 2); @@ -96,17 +97,19 @@ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==*\\**", 1); } - @Test - @Description("Test filter software module by name which contain mutated vowels ") - void testFilterByParameterNameWithUmlaut() { + /** + * Test filter software module by name which contain mutated vowels + */ + @Test void testFilterByParameterNameWithUmlaut() { assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==*Ö*", 1); assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==*Ä*", 1); assertRSQLQuery(SoftwareModuleFields.NAME.name() + "==*Ü*", 1); } - @Test - @Description("Test filter software module by description") - void testFilterByParameterDescription() { + /** + * Test filter software module by description + */ + @Test void testFilterByParameterDescription() { assertRSQLQuery(SoftwareModuleFields.DESCRIPTION.name() + "==''", 1); assertRSQLQuery(SoftwareModuleFields.DESCRIPTION.name() + "!=''", 5); assertRSQLQuery(SoftwareModuleFields.DESCRIPTION.name() + "==agent-hub", 1); @@ -116,18 +119,20 @@ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleFields.DESCRIPTION.name() + "=out=(agent-hub,notexist)", 5); } - @Test - @Description("Test filter software module by version") - void testFilterByParameterVersion() { + /** + * Test filter software module by version + */ + @Test void testFilterByParameterVersion() { assertRSQLQuery(SoftwareModuleFields.VERSION.name() + "==1.0.1", 2); assertRSQLQuery(SoftwareModuleFields.VERSION.name() + "!=v1.0", 6); assertRSQLQuery(SoftwareModuleFields.VERSION.name() + "=in=(1.0.1,1.0.2)", 2); assertRSQLQuery(SoftwareModuleFields.VERSION.name() + "=out=(1.0.1)", 4); } - @Test - @Description("Test filter software module by type key") - void testFilterByType() { + /** + * Test filter software module by type key + */ + @Test void testFilterByType() { assertRSQLQuery(SoftwareModuleFields.TYPE.name() + "==" + TestdataFactory.SM_TYPE_APP, 2); assertRSQLQuery(SoftwareModuleFields.TYPE.name() + "!=" + TestdataFactory.SM_TYPE_APP, 4); assertRSQLQuery(SoftwareModuleFields.TYPE.name() + "==noExist*", 0); @@ -135,9 +140,10 @@ class RSQLSoftwareModuleFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleFields.TYPE.name() + "=out=(" + TestdataFactory.SM_TYPE_APP + ")", 4); } - @Test - @Description("Test filter software module by metadata") - void testFilterByMetadata() { + /** + * Test filter software module by metadata + */ + @Test void testFilterByMetadata() { assertRSQLQuery(SoftwareModuleFields.METADATA.name() + ".metaKey==metaValue", 1); assertRSQLQuery(SoftwareModuleFields.METADATA.name() + ".metaKey!=metaValue", 1); assertRSQLQuery(SoftwareModuleFields.METADATA.name() + ".metaKey!=notexist", 2); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleTypeFieldsTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleTypeFieldsTest.java index 40198bbff..3348a1c9b 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleTypeFieldsTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLSoftwareModuleTypeFieldsTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.Constants; import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -23,13 +20,16 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.orm.jpa.vendor.Database; -@Feature("Component Tests - Repository") -@Story("RSQL filter software module test type") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter software module test type + */ class RSQLSoftwareModuleTypeFieldsTest extends AbstractJpaIntegrationTest { - @Test - @Description("Test filter software module test type by id") - void testFilterByParameterId() { + /** + * Test filter software module test type by id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(SoftwareModuleTypeFields.ID.name() + "==" + osType.getId(), 1); assertRSQLQuery(SoftwareModuleTypeFields.ID.name() + "!=" + osType.getId(), 2); assertRSQLQuery(SoftwareModuleTypeFields.ID.name() + "==" + -1, 0); @@ -44,16 +44,18 @@ class RSQLSoftwareModuleTypeFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleTypeFields.ID.name() + "=out=(" + osType.getId() + ",1000000)", 2); } - @Test - @Description("Test filter software module test type by name") - void testFilterByParameterName() { + /** + * Test filter software module test type by name + */ + @Test void testFilterByParameterName() { assertRSQLQuery(SoftwareModuleTypeFields.NAME.name() + "==" + Constants.SMT_DEFAULT_OS_NAME, 1); assertRSQLQuery(SoftwareModuleTypeFields.NAME.name() + "!=" + Constants.SMT_DEFAULT_OS_NAME, 2); } - @Test - @Description("Test filter software module test type by description") - void testFilterByParameterDescription() { + /** + * Test filter software module test type by description + */ + @Test void testFilterByParameterDescription() { assertRSQLQuery(SoftwareModuleTypeFields.DESCRIPTION.name() + "==''", 0); assertRSQLQuery(SoftwareModuleTypeFields.DESCRIPTION.name() + "!=''", 3); assertRSQLQuery(SoftwareModuleTypeFields.DESCRIPTION.name() + "==Updated*", 3); @@ -61,18 +63,20 @@ class RSQLSoftwareModuleTypeFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQuery(SoftwareModuleTypeFields.DESCRIPTION.name() + "==noExist*", 0); } - @Test - @Description("Test filter software module test type by key") - void testFilterByParameterKey() { + /** + * Test filter software module test type by key + */ + @Test void testFilterByParameterKey() { assertRSQLQuery(SoftwareModuleTypeFields.KEY.name() + "==os", 1); assertRSQLQuery(SoftwareModuleTypeFields.KEY.name() + "!=os", 2); assertRSQLQuery(SoftwareModuleTypeFields.KEY.name() + "=in=(os)", 1); assertRSQLQuery(SoftwareModuleTypeFields.KEY.name() + "=out=(os)", 2); } - @Test - @Description("Test filter software module test type by max") - void testFilterByMaxAssignment() { + /** + * Test filter software module test type by max + */ + @Test void testFilterByMaxAssignment() { assertRSQLQuery(SoftwareModuleTypeFields.MAXASSIGNMENTS.name() + "==1", 2); assertRSQLQuery(SoftwareModuleTypeFields.MAXASSIGNMENTS.name() + "!=1", 1); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTagFieldsTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTagFieldsTest.java index 321d4742a..395275531 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTagFieldsTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTagFieldsTest.java @@ -11,9 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TagFields; import org.eclipse.hawkbit.repository.builder.TagCreate; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; @@ -24,8 +21,10 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; -@Feature("Component Tests - Repository") -@Story("RSQL filter target and distribution set tags") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter target and distribution set tags + */ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { @BeforeEach @@ -39,9 +38,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { } } - @Test - @Description("Test filter target tag by name") - void testFilterTargetTagByParameterName() { + /** + * Test filter target tag by name + */ + @Test void testFilterTargetTagByParameterName() { assertRSQLQueryTarget(TagFields.NAME.name() + "==''", 0); assertRSQLQueryTarget(TagFields.NAME.name() + "!=''", 5); assertRSQLQueryTarget(TagFields.NAME.name() + "==1", 1); @@ -52,9 +52,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQueryTarget(TagFields.NAME.name() + "=out=(1,notexist)", 4); } - @Test - @Description("Test filter target tag by description") - void testFilterTargetTagByParameterDescription() { + /** + * Test filter target tag by description + */ + @Test void testFilterTargetTagByParameterDescription() { assertRSQLQueryTarget(TagFields.DESCRIPTION.name() + "==''", 0); assertRSQLQueryTarget(TagFields.DESCRIPTION.name() + "!=''", 5); assertRSQLQueryTarget(TagFields.DESCRIPTION.name() + "==1", 1); @@ -65,9 +66,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQueryTarget(TagFields.DESCRIPTION.name() + "=out=(1,notexist)", 4); } - @Test - @Description("Test filter target tag by colour") - void testFilterTargetTagByParameterColour() { + /** + * Test filter target tag by colour + */ + @Test void testFilterTargetTagByParameterColour() { assertRSQLQueryTarget(TagFields.COLOUR.name() + "==''", 0); assertRSQLQueryTarget(TagFields.COLOUR.name() + "!=''", 5); assertRSQLQueryTarget(TagFields.COLOUR.name() + "==red", 3); @@ -78,9 +80,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQueryTarget(TagFields.COLOUR.name() + "=out=(red,notexist)", 2); } - @Test - @Description("Test filter distribution set tag by name") - void testFilterDistributionSetTagByParameterName() { + /** + * Test filter distribution set tag by name + */ + @Test void testFilterDistributionSetTagByParameterName() { assertRSQLQueryDistributionSet(TagFields.NAME.name() + "==''", 0); assertRSQLQueryDistributionSet(TagFields.NAME.name() + "!=''", 5); assertRSQLQueryDistributionSet(TagFields.NAME.name() + "==1", 1); @@ -91,9 +94,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQueryDistributionSet(TagFields.NAME.name() + "=out=(1,2)", 3); } - @Test - @Description("Test filter distribution set by description") - void testFilterDistributionSetTagByParameterDescription() { + /** + * Test filter distribution set by description + */ + @Test void testFilterDistributionSetTagByParameterDescription() { assertRSQLQueryDistributionSet(TagFields.DESCRIPTION.name() + "==''", 0); assertRSQLQueryDistributionSet(TagFields.DESCRIPTION.name() + "!=''", 5); assertRSQLQueryDistributionSet(TagFields.DESCRIPTION.name() + "==1", 1); @@ -104,9 +108,10 @@ class RSQLTagFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQueryDistributionSet(TagFields.DESCRIPTION.name() + "=out=(1,2)", 3); } - @Test - @Description("Test filter distribution set by colour") - void testFilterDistributionSetTagByParameterColour() { + /** + * Test filter distribution set by colour + */ + @Test void testFilterDistributionSetTagByParameterColour() { assertRSQLQueryDistributionSet(TagFields.COLOUR.name() + "==''", 0); assertRSQLQueryDistributionSet(TagFields.COLOUR.name() + "!=''", 5); assertRSQLQueryDistributionSet(TagFields.COLOUR.name() + "==red", 3); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFieldTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFieldTest.java index 28eb039d4..925a11386 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFieldTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFieldTest.java @@ -19,9 +19,6 @@ import java.util.Map; import jakarta.persistence.EntityManager; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TargetFields; import org.eclipse.hawkbit.repository.TargetTypeFields; import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException; @@ -39,8 +36,10 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Slice; -@Feature("Component Tests - Repository") -@Story("RSQL filter target") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter target + */ @SuppressWarnings("java:S6813") // constructor injects are not possible for test classes class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { @@ -107,18 +106,20 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { targetTag3.getId()); } - @Test - @Description("Test filter target by (controller) id") - void testFilterByParameterId() { + /** + * Test filter target by (controller) id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(TargetFields.ID.name() + "==targetId123", 1); assertRSQLQuery(TargetFields.ID.name() + "!=targetId123", 4); assertRSQLQuery(TargetFields.ID.name() + "=in=(targetId123,notexist)", 1); assertRSQLQuery(TargetFields.ID.name() + "=out=(targetId123,notexist)", 4); } - @Test - @Description("Test filter target by name") - void testFilterByParameterName() { + /** + * Test filter target by name + */ + @Test void testFilterByParameterName() { assertRSQLQuery(TargetFields.NAME.name() + "==targetName123", 1); assertRSQLQuery(TargetFields.NAME.name() + "==target*", 5); assertRSQLQuery(TargetFields.NAME.name() + "==noExist*", 0); @@ -127,9 +128,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.NAME.name() + "=out=(targetName123,notexist)", 4); } - @Test - @Description("Test filter target by description") - void testFilterByParameterDescription() { + /** + * Test filter target by description + */ + @Test void testFilterByParameterDescription() { assertRSQLQuery(TargetFields.DESCRIPTION.name() + "==''", 3); assertRSQLQuery(TargetFields.DESCRIPTION.name() + "!=''", 2); assertRSQLQuery(TargetFields.DESCRIPTION.name() + "==targetDesc123", 1); @@ -140,9 +142,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.DESCRIPTION.name() + "=out=(targetDesc123,notexist)", 4); } - @Test - @Description("Test filter target by controller id") - void testFilterByParameterControllerId() { + /** + * Test filter target by controller id + */ + @Test void testFilterByParameterControllerId() { assertRSQLQuery(TargetFields.CONTROLLERID.name() + "==targetId123", 1); assertRSQLQuery(TargetFields.CONTROLLERID.name() + "==target*", 5); assertRSQLQuery(TargetFields.CONTROLLERID.name() + "==noExist*", 0); @@ -151,9 +154,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.CONTROLLERID.name() + "=out=(targetId123,notexist)", 4); } - @Test - @Description("Test filter target by status") - void testFilterByParameterUpdateStatus() { + /** + * Test filter target by status + */ + @Test void testFilterByParameterUpdateStatus() { assertRSQLQuery(TargetFields.UPDATESTATUS.name() + "==pending", 1); assertRSQLQuery(TargetFields.UPDATESTATUS.name() + "!=pending", 4); final String rsqlNoExistStar = TargetFields.UPDATESTATUS.name() + "==noExist*"; @@ -164,9 +168,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.UPDATESTATUS.name() + "=out=(pending,error)", 4); } - @Test - @Description("Test filter target by attribute") - void testFilterByAttribute() { + /** + * Test filter target by attribute + */ + @Test void testFilterByAttribute() { controllerManagement.updateControllerAttributes( testdataFactory.createTarget().getControllerId(), Map.of( @@ -229,9 +234,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQueryThrowsException(TargetFields.ATTRIBUTE.name() + "==value.dot"); } - @Test - @Description("Test filter target by assigned ds name") - void testFilterByAssignedDsName() { + /** + * Test filter target by assigned ds name + */ + @Test void testFilterByAssignedDsName() { assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".name==AssignedDs", 1); assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".name==A*", 1); assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".name==noExist*", 0); @@ -239,9 +245,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".name=out=(AssignedDs,notexist)", 4); } - @Test - @Description("Test filter target by assigned ds version") - void testFilterByAssignedDsVersion() { + /** + * Test filter target by assigned ds version + */ + @Test void testFilterByAssignedDsVersion() { assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".version==" + TestdataFactory.DEFAULT_VERSION, 1); assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".version==*1*", 1); assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".version==noExist*", 0); @@ -249,9 +256,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.ASSIGNEDDS.name() + ".version=out=(" + TestdataFactory.DEFAULT_VERSION + ",notexist)", 4); } - @Test - @Description("Test filter target by tag name") - void testFilterByTag() { + /** + * Test filter target by tag name + */ + @Test void testFilterByTag() { assertRSQLQuery(TargetFields.TAG.name() + "==Tag1", 2); assertRSQLQuery(TargetFields.TAG.name() + "!=Tag1", 3); assertRSQLQuery(TargetFields.TAG.name() + "==T*", 4); @@ -271,9 +279,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.TAG.name() + "!=Tag2" + OR + TargetFields.TAG.name() + "!=Tag3", 3); } - @Test - @Description("Test filter target by lastTargetQuery") - void testFilterByLastTargetQuery() { + /** + * Test filter target by lastTargetQuery + */ + @Test void testFilterByLastTargetQuery() { assertRSQLQuery(TargetFields.LASTCONTROLLERREQUESTAT.name() + "==" + target.getLastTargetQuery(), 1); assertRSQLQuery(TargetFields.LASTCONTROLLERREQUESTAT.name() + "!=" + target.getLastTargetQuery(), 4); assertRSQLQuery(TargetFields.LASTCONTROLLERREQUESTAT.name() + "=lt=" + target.getLastTargetQuery(), 0); @@ -284,9 +293,10 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFields.LASTCONTROLLERREQUESTAT.name() + "=gt=${OVERDUE_TS}", 2); } - @Test - @Description("Test filter target by metadata") - void testFilterByMetadata() { + /** + * Test filter target by metadata + */ + @Test void testFilterByMetadata() { targetManagement.createMetadata(testdataFactory.createTarget().getControllerId(), Map.of("key.dot", "value.dot")); assertRSQLQuery(TargetFields.METADATA.name() + ".metaKey==metaValue", 1); @@ -350,18 +360,20 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { assertRSQLQueryThrowsException(TargetFields.METADATA.name() + "==value.dot"); } - @Test - @Description("Test filter based on more complex RSQL queries") - void testFilterByComplexQueries() { + /** + * Test filter based on more complex RSQL queries + */ + @Test void testFilterByComplexQueries() { assertRSQLQuery(TargetFields.NAME.name() + "!=targetName123" + AND + TargetFields.METADATA.name() + ".metaKey!=value", 0); assertRSQLQuery( "(" + TargetFields.TAG.name() + "!=TAG1" + OR + TargetFields.TAG.name() + "!=TAG2)" + AND + TargetFields.CONTROLLERID.name() + "!=targetId1235", 4); } - @Test - @Description("Testing allowed RSQL keys based on TargetFields definition") - void rsqlValidTargetFields() { + /** + * Testing allowed RSQL keys based on TargetFields definition + */ + @Test void rsqlValidTargetFields() { RSQLUtility.validateRsqlFor( "ID == '0123' and NAME == abcd and DESCRIPTION == absd and CREATEDAT =lt= 0123 and LASTMODIFIEDAT =gt= 0123" + " and CONTROLLERID == 0123 and UPDATESTATUS == PENDING and IPADDRESS == 0123 and LASTCONTROLLERREQUESTAT == 0123" + @@ -386,27 +398,30 @@ class RSQLTargetFieldTest extends AbstractJpaIntegrationTest { TargetFields.class, JpaTarget.class, virtualPropertyReplacer, entityManager)); } - @Test - @Description("Test filter by target type key") - void shouldFilterTargetsByTypeKey() { + /** + * Test filter by target type key + */ + @Test void shouldFilterTargetsByTypeKey() { assertRSQLQuery("targettype." + TargetTypeFields.KEY.name() + "==" + targetType1.getKey(), 1); assertRSQLQuery("targettype." + TargetTypeFields.KEY.name() + "==*1.key", 1); assertRSQLQuery("targettype." + TargetTypeFields.KEY.name() + "!=" + targetType2.getKey(), 4); assertRSQLQuery("targettype." + TargetTypeFields.KEY.name() + "==noExist*", 0); } - @Test - @Description("Test filter by target type name") - void shouldFilterTargetsByTypeName() { + /** + * Test filter by target type name + */ + @Test void shouldFilterTargetsByTypeName() { assertRSQLQuery("targettype." + TargetTypeFields.NAME.name() + "==" + targetType1.getName(), 1); assertRSQLQuery("targettype." + TargetTypeFields.NAME.name() + "==*1", 1); assertRSQLQuery("targettype." + TargetTypeFields.NAME.name() + "!=" + targetType2.getName(), 4); assertRSQLQuery("targettype." + TargetTypeFields.NAME.name() + "==noExist*", 0); } - @Test - @Description("Test filter by target type ID and description") - void shouldFilterTargetsByTypeIdAndDescription() { + /** + * Test filter by target type ID and description + */ + @Test void shouldFilterTargetsByTypeIdAndDescription() { assertThatExceptionOfType(RSQLParameterUnsupportedFieldException.class) .isThrownBy(() -> assertRSQLQuery("targettype.ID==1", 0)); assertThatExceptionOfType(RSQLParameterUnsupportedFieldException.class) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFilterQueryFieldsTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFilterQueryFieldsTest.java index 099f25c13..73ca34365 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFilterQueryFieldsTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLTargetFilterQueryFieldsTest.java @@ -12,9 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.rsql; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.TargetFilterQueryFields; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.Action.ActionType; @@ -26,8 +23,10 @@ import org.junit.jupiter.api.Test; import org.springframework.data.domain.Page; import org.springframework.orm.jpa.vendor.Database; -@Feature("Component Tests - Repository") -@Story("RSQL filter target filter query") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL filter target filter query + */ class RSQLTargetFilterQueryFieldsTest extends AbstractJpaIntegrationTest { private TargetFilterQuery filter1; @@ -52,9 +51,10 @@ class RSQLTargetFilterQueryFieldsTest extends AbstractJpaIntegrationTest { assertEquals(3L, targetFilterQueryManagement.count()); } - @Test - @Description("Test filter target filter query by id") - void testFilterByParameterId() { + /** + * Test filter target filter query by id + */ + @Test void testFilterByParameterId() { assertRSQLQuery(TargetFilterQueryFields.ID.name() + "==" + filter1.getId(), 1); assertRSQLQuery(TargetFilterQueryFields.ID.name() + "!=" + filter1.getId(), 2); assertRSQLQuery(TargetFilterQueryFields.ID.name() + "==" + -1, 0); @@ -70,9 +70,10 @@ class RSQLTargetFilterQueryFieldsTest extends AbstractJpaIntegrationTest { } - @Test - @Description("Test filter target filter query by name") - void testFilterByParameterName() { + /** + * Test filter target filter query by name + */ + @Test void testFilterByParameterName() { assertRSQLQuery(TargetFilterQueryFields.NAME.name() + "==" + filter1.getName(), 1); assertRSQLQuery(TargetFilterQueryFields.NAME.name() + "==" + filter2.getName(), 1); assertRSQLQuery(TargetFilterQueryFields.NAME.name() + "==filter_*", 3); @@ -81,9 +82,10 @@ class RSQLTargetFilterQueryFieldsTest extends AbstractJpaIntegrationTest { assertRSQLQuery(TargetFilterQueryFields.NAME.name() + "=out=(" + filter1.getName() + ",notexist)", 2); } - @Test - @Description("Test filter target filter query by auto assigned ds name") - void testFilterByAutoAssignedDsName() { + /** + * Test filter target filter query by auto assigned ds name + */ + @Test void testFilterByAutoAssignedDsName() { assertRSQLQuery(TargetFilterQueryFields.AUTOASSIGNDISTRIBUTIONSET.name() + ".name==" + filter1.getAutoAssignDistributionSet().getName(), 1); assertRSQLQuery(TargetFilterQueryFields.AUTOASSIGNDISTRIBUTIONSET.name() + ".name==" @@ -96,9 +98,10 @@ class RSQLTargetFilterQueryFieldsTest extends AbstractJpaIntegrationTest { + filter1.getAutoAssignDistributionSet().getName() + ",notexist)", 2); } - @Test - @Description("Test filter target filter query by auto assigned ds version") - void testFilterByAutoAssignedDsVersion() { + /** + * Test filter target filter query by auto assigned ds version + */ + @Test void testFilterByAutoAssignedDsVersion() { assertRSQLQuery(TargetFilterQueryFields.AUTOASSIGNDISTRIBUTIONSET.name() + ".version==" + TestdataFactory.DEFAULT_VERSION, 2); assertRSQLQuery(TargetFilterQueryFields.AUTOASSIGNDISTRIBUTIONSET.name() + ".version==*1*", 2); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLUtilityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLUtilityTest.java index 165c2eba8..6df9e6540 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLUtilityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/RSQLUtilityTest.java @@ -36,9 +36,6 @@ import jakarta.persistence.metamodel.EntityType; import jakarta.persistence.metamodel.SingularAttribute; import jakarta.persistence.metamodel.Type; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.DistributionSetFields; import org.eclipse.hawkbit.repository.RsqlQueryField; import org.eclipse.hawkbit.repository.SoftwareModuleFields; @@ -69,10 +66,12 @@ import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringExtension; @ExtendWith(SpringExtension.class) -@Feature("Component Tests - Repository") -@Story("RSQL search utility") +/** + * Feature: Component Tests - Repository
+ * Story: RSQL search utility + */ @Disabled -// TODO: fully document tests -> @Description for long text and reasonable +// TODO: fully document tests -> description for long text and reasonable // method name as short text class RSQLUtilityTest { @@ -362,9 +361,10 @@ class RSQLUtilityTest { .isThrownBy(() -> rsqlSpecification.toPredicate(baseSoftwareModuleRootMock, criteriaQueryMock, criteriaBuilderMock)); } - @Test - @Description("Tests the resolution of overdue_ts placeholder in context of a RSQL expression.") - void correctRsqlWithOverdueMacro() { + /** + * Tests the resolution of overdue_ts placeholder in context of a RSQL expression. + */ + @Test void correctRsqlWithOverdueMacro() { reset0(baseSoftwareModuleRootMock, criteriaQueryMock, criteriaBuilderMock); final String overdueProp = "overdue_ts"; final String overduePropPlaceholder = "${" + overdueProp + "}"; @@ -384,9 +384,10 @@ class RSQLUtilityTest { verify(criteriaBuilderMock, never()).lessThanOrEqualTo(pathOfString(baseSoftwareModuleRootMock), overduePropPlaceholder); } - @Test - @Description("Tests RSQL expression with an unknown placeholder.") - void correctRsqlWithUnknownMacro() { + /** + * Tests RSQL expression with an unknown placeholder. + */ + @Test void correctRsqlWithUnknownMacro() { reset0(baseSoftwareModuleRootMock, criteriaQueryMock, criteriaBuilderMock); final String overdueProp = "unknown"; final String overduePropPlaceholder = "${" + overdueProp + "}"; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolverTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolverTest.java index 303b1c471..21d80b2f7 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolverTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/rsql/VirtualPropertyResolverTest.java @@ -14,9 +14,6 @@ import static org.mockito.Mockito.when; import java.util.concurrent.Callable; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.apache.commons.text.StringSubstitutor; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; @@ -37,8 +34,10 @@ import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit.jupiter.SpringExtension; @ExtendWith(SpringExtension.class) -@Feature("Unit Tests - Repository") -@Story("Placeholder resolution for virtual properties") +/** + * Feature: Unit Tests - Repository
+ * Story: Placeholder resolution for virtual properties + */ class VirtualPropertyResolverTest { private static final TenantConfigurationValue TEST_POLLING_TIME_INTERVAL = @@ -61,9 +60,10 @@ class VirtualPropertyResolverTest { .thenReturn(TEST_POLLING_OVERDUE_TIME_INTERVAL); } - @Test - @Description("Tests VirtualPropertyResolver with a placeholder unknown to VirtualPropertyResolver.") - void handleUnknownPlaceholder() { + /** + * Tests VirtualPropertyResolver with a placeholder unknown to VirtualPropertyResolver. + */ + @Test void handleUnknownPlaceholder() { final String placeholder = "${unknown}"; final String testString = "lhs=lt=" + placeholder; @@ -71,9 +71,10 @@ class VirtualPropertyResolverTest { assertThat(resolvedPlaceholders).as("unknown should not be resolved!").contains(placeholder); } - @Test - @Description("Tests escape mechanism for placeholders (syntax is $${SOME_PLACEHOLDER}).") - void handleEscapedPlaceholder() { + /** + * Tests escape mechanism for placeholders (syntax is $${SOME_PLACEHOLDER}). + */ + @Test void handleEscapedPlaceholder() { final String placeholder = "${OVERDUE_TS}"; final String escapedPlaceholder = StringSubstitutor.DEFAULT_ESCAPE + placeholder; final String testString = "lhs=lt=" + escapedPlaceholder; @@ -82,9 +83,11 @@ class VirtualPropertyResolverTest { assertThat(resolvedPlaceholders).as("Escaped OVERDUE_TS should not be resolved!").contains(placeholder); } + /** + * Tests resolution of NOW_TS by using a StringSubstitutor configured with the VirtualPropertyResolver. + */ @ParameterizedTest @ValueSource(strings = { "${NOW_TS}", "${OVERDUE_TS}", "${overdue_ts}" }) - @Description("Tests resolution of NOW_TS by using a StringSubstitutor configured with the VirtualPropertyResolver.") void resolveNowTimestampPlaceholder(final String placeholder) { when(securityContext.runAsSystem(Mockito.any())).thenAnswer(a -> ((Callable) a.getArgument(0)).call()); final String testString = "lhs=lt=" + placeholder; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/specifications/SpecificationsBuilderTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/specifications/SpecificationsBuilderTest.java index fc32ec1d3..7fc8c8138 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/specifications/SpecificationsBuilderTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/specifications/SpecificationsBuilderTest.java @@ -27,26 +27,27 @@ import jakarta.persistence.criteria.Path; import jakarta.persistence.criteria.Predicate; import jakarta.persistence.criteria.Root; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.data.jpa.domain.Specification; -@Feature("Unit Tests - Repository") -@Story("Specifications builder") +/** + * Feature: Unit Tests - Repository
+ * Story: Specifications builder + */ class SpecificationsBuilderTest { - @Test - @Description("Test the combination of specs on an empty list which returns null") - void combineWithAndEmptyList() { + /** + * Test the combination of specs on an empty list which returns null + */ + @Test void combineWithAndEmptyList() { final List> specList = Collections.emptyList(); assertThat(SpecificationsBuilder.combineWithAnd(specList)).isNull(); } - @Test - @Description("Test the combination of specs on an immutable list with one entry") - void combineWithAndSingleImmutableList() { + /** + * Test the combination of specs on an immutable list with one entry + */ + @Test void combineWithAndSingleImmutableList() { final Specification spec = (root, query, cb) -> cb.equal(root.get("field1"), "testValue"); final List> specList = Collections.singletonList(spec); final Specification specifications = SpecificationsBuilder.combineWithAnd(specList); @@ -68,9 +69,10 @@ class SpecificationsBuilderTest { } - @Test - @Description("Test the combination of specs on a list with multiple entries") - void combineWithAndList() { + /** + * Test the combination of specs on a list with multiple entries + */ + @Test void combineWithAndList() { final Specification spec1 = (root, query, cb) -> cb.equal(root.get("field1"), "testValue1"); final Specification spec2 = (root, query, cb) -> cb.equal(root.get("field2"), "testValue2"); diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/tenancy/MultiTenancyEntityTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/tenancy/MultiTenancyEntityTest.java index 59ee22040..0eb876957 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/tenancy/MultiTenancyEntityTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/tenancy/MultiTenancyEntityTest.java @@ -16,9 +16,6 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.Callable; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -34,15 +31,17 @@ import org.springframework.data.domain.Slice; * Multi-Tenancy tests which testing the CRUD operations of entities that all * CRUD-Operations are tenant aware and cannot access or delete entities not * belonging to the current tenant. + *

+ * Feature: Component Tests - Repository
+ * Story: Multi Tenancy */ -@Feature("Component Tests - Repository") -@Story("Multi Tenancy") @ExtendWith(DisposableSqlTestDatabaseExtension.class) class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { - @Test - @Description(value = "Ensures that multiple targets with same controller-ID can be created for different tenants.") - void createMultipleTargetsWithSameIdForDifferentTenant() throws Exception { + /** + * Ensures that multiple targets with same controller-ID can be created for different tenants. + */ + @Test void createMultipleTargetsWithSameIdForDifferentTenant() throws Exception { // known controller ID for overall tenants same final String knownControllerId = "controllerId"; @@ -63,9 +62,10 @@ class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { .isEqualTo(anotherTenant.toUpperCase()); } - @Test - @Description(value = "Ensures that targets created by a tenant are not visible by another tenant.") - @WithUser(tenantId = "mytenant", allSpPermissions = true) + /** + * Ensures that targets created by a tenant are not visible by another tenant. + */ + @Test @WithUser(tenantId = "mytenant", allSpPermissions = true) void queryTargetFromDifferentTenantIsNotVisible() throws Exception { // create target for another tenant final String anotherTenant = "anotherTenant"; @@ -83,9 +83,10 @@ class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { assertThat(findTargetsForTenant).hasSize(1); } - @Test - @Description(value = "Ensures that tenant with proper permissions can read and delete other tenants.") - @WithUser(tenantId = "mytenant", allSpPermissions = true) + /** + * Ensures that tenant with proper permissions can read and delete other tenants. + */ + @Test @WithUser(tenantId = "mytenant", allSpPermissions = true) void deleteAnotherTenantPossible() throws Exception { // create target for another tenant final String anotherTenant = "anotherTenant"; @@ -99,9 +100,10 @@ class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { assertThat(systemManagement.findTenants(PAGE)).as("Expected number if tenants after deletion is").hasSize(2); } - @Test - @Description(value = "Ensures that tenant metadata is retrieved for the current tenant.") - @WithUser(tenantId = "mytenant", autoCreateTenant = false, allSpPermissions = true) + /** + * Ensures that tenant metadata is retrieved for the current tenant. + */ + @Test @WithUser(tenantId = "mytenant", autoCreateTenant = false, allSpPermissions = true) void getTenanatMetdata() throws Exception { // logged in tenant mytenant - check if tenant default data is @@ -119,9 +121,10 @@ class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { .isEqualTo("bumlux".toUpperCase()); } - @Test - @Description(value = "Ensures that targets created from a different tenant cannot be deleted from other tenants") - @WithUser(tenantId = "mytenant", allSpPermissions = true) + /** + * Ensures that targets created from a different tenant cannot be deleted from other tenants + */ + @Test @WithUser(tenantId = "mytenant", allSpPermissions = true) void deleteTargetFromOtherTenantIsNotPossible() throws Exception { // create target for another tenant final String anotherTenant = "anotherTenant"; @@ -145,9 +148,10 @@ class MultiTenancyEntityTest extends AbstractJpaIntegrationTest { assertThat(targetsForAnotherTenant).isEmpty(); } - @Test - @Description(value = "Ensures that multiple distribution sets with same name and version can be created for different tenants.") - void createMultipleDistributionSetsWithSameNameForDifferentTenants() throws Exception { + /** + * Ensures that multiple distribution sets with same name and version can be created for different tenants. + */ + @Test void createMultipleDistributionSetsWithSameNameForDifferentTenants() throws Exception { // known tenant names final String tenant = "aTenant"; diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/ExcludePathAwareShallowETagFilterTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/ExcludePathAwareShallowETagFilterTest.java index 7170e87a0..09c2422e2 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/ExcludePathAwareShallowETagFilterTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/ExcludePathAwareShallowETagFilterTest.java @@ -22,8 +22,6 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -31,8 +29,10 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; -@Feature("Unit Tests - Security") -@Story("Exclude path aware shallow ETag filter") +/** + * Feature: Unit Tests - Security
+ * Story: Exclude path aware shallow ETag filter + */ @ExtendWith(MockitoExtension.class) class ExcludePathAwareShallowETagFilterTest { diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java index 964e5f178..9ae09bbbf 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java @@ -14,18 +14,18 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.HashMap; import java.util.Map; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; -@Feature("Unit Tests - Management API") -@Story("Error Handling") +/** + * Feature: Unit Tests - Management API
+ * Story: Error Handling + */ class ExceptionInfoTest { - @Test - @Description("Ensures that setters and getters match on teh payload.") - void setterAndGetterOnExceptionInfo() { + /** + * Ensures that setters and getters match on teh payload. + */ + @Test void setterAndGetterOnExceptionInfo() { final String knownExceptionClass = "hawkbit.test.exception.Class"; final String knownErrorCode = "hawkbit.error.code.Known"; final String knownMessage = "a known message"; diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java index 16b4f9f53..8437fb82d 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java @@ -25,8 +25,6 @@ import jakarta.servlet.ServletOutputStream; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; import org.junit.jupiter.api.Test; @@ -36,8 +34,10 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -@Feature("Component Tests - Management API") -@Story("File streaming") +/** + * Feature: Component Tests - Management API
+ * Story: File streaming + */ class FileStreamingUtilTest { private static final String CONTENT = "This is some very long string which is intended to test"; diff --git a/hawkbit-security-core/allure-results/00095825-93dc-4643-9d2a-03226a2ac582-container.json b/hawkbit-security-core/allure-results/00095825-93dc-4643-9d2a-03226a2ac582-container.json deleted file mode 100644 index 5ea501c85..000000000 --- a/hawkbit-security-core/allure-results/00095825-93dc-4643-9d2a-03226a2ac582-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"00095825-93dc-4643-9d2a-03226a2ac582","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["e4b1797f-8343-4732-98c5-38abbd92797a"],"befores":[],"afters":[],"start":1750415146366,"stop":1750415146369} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/00cef5c6-1901-431a-ad53-68e5eed7eecd-result.json b/hawkbit-security-core/allure-results/00cef5c6-1901-431a-ad53-68e5eed7eecd-result.json deleted file mode 100644 index 02bdb05fe..000000000 --- a/hawkbit-security-core/allure-results/00cef5c6-1901-431a-ad53-68e5eed7eecd-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"00cef5c6-1901-431a-ad53-68e5eed7eecd","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414577017,"stop":1750414577018} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/01baa046-9d05-45fb-bbee-0277cf948938-container.json b/hawkbit-security-core/allure-results/01baa046-9d05-45fb-bbee-0277cf948938-container.json deleted file mode 100644 index 9cad48f00..000000000 --- a/hawkbit-security-core/allure-results/01baa046-9d05-45fb-bbee-0277cf948938-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"01baa046-9d05-45fb-bbee-0277cf948938","name":"getRemoteAddrFromXForwardedForHeader()","children":["bb652b59-9ba7-4a8a-abb0-b817b62fbbf9"],"befores":[],"afters":[],"start":1750415196860,"stop":1750415197455} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/03463959-bc32-47f2-8b00-a3bd24cea23c-container.json b/hawkbit-security-core/allure-results/03463959-bc32-47f2-8b00-a3bd24cea23c-container.json deleted file mode 100644 index 090773691..000000000 --- a/hawkbit-security-core/allure-results/03463959-bc32-47f2-8b00-a3bd24cea23c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"03463959-bc32-47f2-8b00-a3bd24cea23c","name":"IpUtilTest","children":["40a60da3-a4d2-410f-ba72-6ca6edbda7a7","c1bab8c8-957f-4521-ab1b-fe293ffbf05c","a049cd61-dca1-487c-bc68-e08e399b3182","8c8bfffc-4393-4a16-aaeb-f9599a9340e4","793a6407-39c3-4ff4-a4b8-3b44b9fdfbef","00cef5c6-1901-431a-ad53-68e5eed7eecd","7bf55d79-c841-4db2-b5e0-e325efdfb4a1","c64eff95-189a-4dd5-9571-eba4e7f9457a"],"befores":[],"afters":[],"start":1750414576412,"stop":1750414577031} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/03ab9472-318c-48c6-ae0c-3cfc94716ef4-container.json b/hawkbit-security-core/allure-results/03ab9472-318c-48c6-ae0c-3cfc94716ef4-container.json deleted file mode 100644 index 1490bb6e1..000000000 --- a/hawkbit-security-core/allure-results/03ab9472-318c-48c6-ae0c-3cfc94716ef4-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"03ab9472-318c-48c6-ae0c-3cfc94716ef4","name":"IpUtilTest","children":["ca5e9cff-fa32-4651-a1e5-70fb77eeb77c","a8765d5b-55ca-4f74-90c7-02755739cda0","2341b3ba-749f-425a-9644-46a3ad15e2df","04339643-b07e-44be-9127-20df5e4ec5b6","e4b1797f-8343-4732-98c5-38abbd92797a","4edf36e0-9c4f-4fdc-925d-8ce1ba80f916","bd7ce21f-8836-4fc1-b614-82ddcfbc7add","c63b4ccb-1dec-433e-a130-fd42df15439f"],"befores":[],"afters":[],"start":1750415145746,"stop":1750415146383} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/04339643-b07e-44be-9127-20df5e4ec5b6-result.json b/hawkbit-security-core/allure-results/04339643-b07e-44be-9127-20df5e4ec5b6-result.json deleted file mode 100644 index f051a4915..000000000 --- a/hawkbit-security-core/allure-results/04339643-b07e-44be-9127-20df5e4ec5b6-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"04339643-b07e-44be-9127-20df5e4ec5b6","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415146364,"stop":1750415146366} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/05448497-b4e2-4e4c-a26b-f1e7a8a3bdca-result.json b/hawkbit-security-core/allure-results/05448497-b4e2-4e4c-a26b-f1e7a8a3bdca-result.json deleted file mode 100644 index 0935bf98e..000000000 --- a/hawkbit-security-core/allure-results/05448497-b4e2-4e4c-a26b-f1e7a8a3bdca-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"05448497-b4e2-4e4c-a26b-f1e7a8a3bdca","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750415895731,"stop":1750415895735} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/069b7cba-94c0-4c3b-b50b-093ceae56ae9-result.json b/hawkbit-security-core/allure-results/069b7cba-94c0-4c3b-b50b-093ceae56ae9-result.json deleted file mode 100644 index c97970640..000000000 --- a/hawkbit-security-core/allure-results/069b7cba-94c0-4c3b-b50b-093ceae56ae9-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"069b7cba-94c0-4c3b-b50b-093ceae56ae9","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414806579,"stop":1750414806580} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/0834987f-3e4e-4f94-9c54-db2c574fd3cb-result.json b/hawkbit-security-core/allure-results/0834987f-3e4e-4f94-9c54-db2c574fd3cb-result.json deleted file mode 100644 index c867bba57..000000000 --- a/hawkbit-security-core/allure-results/0834987f-3e4e-4f94-9c54-db2c574fd3cb-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"0834987f-3e4e-4f94-9c54-db2c574fd3cb","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750415120465,"stop":1750415121003} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/097c25d6-64c1-4b13-8530-234162dd9c35-container.json b/hawkbit-security-core/allure-results/097c25d6-64c1-4b13-8530-234162dd9c35-container.json deleted file mode 100644 index d758ab735..000000000 --- a/hawkbit-security-core/allure-results/097c25d6-64c1-4b13-8530-234162dd9c35-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"097c25d6-64c1-4b13-8530-234162dd9c35","name":"maskRemoteAddrIfDisabled()","children":["c63b4ccb-1dec-433e-a130-fd42df15439f"],"befores":[],"afters":[],"start":1750415146376,"stop":1750415146380} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/0dedb88b-a3cf-4731-9d2f-5dc8fd17de88-result.json b/hawkbit-security-core/allure-results/0dedb88b-a3cf-4731-9d2f-5dc8fd17de88-result.json deleted file mode 100644 index 322955a1a..000000000 --- a/hawkbit-security-core/allure-results/0dedb88b-a3cf-4731-9d2f-5dc8fd17de88-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"0dedb88b-a3cf-4731-9d2f-5dc8fd17de88","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414973563,"stop":1750414973565} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2-result.json b/hawkbit-security-core/allure-results/0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2-result.json deleted file mode 100644 index e1bd538cb..000000000 --- a/hawkbit-security-core/allure-results/0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750415197490,"stop":1750415197495} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/10c815b0-6fb3-4d08-b3c4-cd765c898cc7-container.json b/hawkbit-security-core/allure-results/10c815b0-6fb3-4d08-b3c4-cd765c898cc7-container.json deleted file mode 100644 index d30340a29..000000000 --- a/hawkbit-security-core/allure-results/10c815b0-6fb3-4d08-b3c4-cd765c898cc7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"10c815b0-6fb3-4d08-b3c4-cd765c898cc7","name":"testCreateHttpUri()","children":["48b84837-52e5-4956-95b6-2e569a7ef8e5"],"befores":[],"afters":[],"start":1750414725275,"stop":1750414725277} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/11545db0-1d06-43fe-8751-e1d65185722c-container.json b/hawkbit-security-core/allure-results/11545db0-1d06-43fe-8751-e1d65185722c-container.json deleted file mode 100644 index 540393db6..000000000 --- a/hawkbit-security-core/allure-results/11545db0-1d06-43fe-8751-e1d65185722c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"11545db0-1d06-43fe-8751-e1d65185722c","name":"testCreateHttpUri()","children":["4edf36e0-9c4f-4fdc-925d-8ce1ba80f916"],"befores":[],"afters":[],"start":1750415146369,"stop":1750415146371} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/13765e2e-7fe8-4031-952a-841109b6f3cd-result.json b/hawkbit-security-core/allure-results/13765e2e-7fe8-4031-952a-841109b6f3cd-result.json deleted file mode 100644 index a12b229a5..000000000 --- a/hawkbit-security-core/allure-results/13765e2e-7fe8-4031-952a-841109b6f3cd-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"13765e2e-7fe8-4031-952a-841109b6f3cd","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415121043,"stop":1750415121045} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/1465cab3-e0a6-472c-9d61-51aa7e24c61b-container.json b/hawkbit-security-core/allure-results/1465cab3-e0a6-472c-9d61-51aa7e24c61b-container.json deleted file mode 100644 index 11e732180..000000000 --- a/hawkbit-security-core/allure-results/1465cab3-e0a6-472c-9d61-51aa7e24c61b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1465cab3-e0a6-472c-9d61-51aa7e24c61b","name":"testCreateHttpUri()","children":["cfe76e19-f88d-42e3-bc83-eaf1533d2c54"],"befores":[],"afters":[],"start":1750414466499,"stop":1750414466501} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/1545ccc9-8b2b-4d1a-8353-73e782cbfd33-container.json b/hawkbit-security-core/allure-results/1545ccc9-8b2b-4d1a-8353-73e782cbfd33-container.json deleted file mode 100644 index 12701c634..000000000 --- a/hawkbit-security-core/allure-results/1545ccc9-8b2b-4d1a-8353-73e782cbfd33-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1545ccc9-8b2b-4d1a-8353-73e782cbfd33","name":"testCreateInvalidUri()","children":["c5c6d015-d557-4d1f-8e28-8a535f14f684"],"befores":[],"afters":[],"start":1750414725259,"stop":1750414725264} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/1763a9e0-b5da-4b26-b6cd-3673318e3980-container.json b/hawkbit-security-core/allure-results/1763a9e0-b5da-4b26-b6cd-3673318e3980-container.json deleted file mode 100644 index 0c36fb90f..000000000 --- a/hawkbit-security-core/allure-results/1763a9e0-b5da-4b26-b6cd-3673318e3980-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1763a9e0-b5da-4b26-b6cd-3673318e3980","name":"SpPermissionTest","children":["0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2"],"befores":[],"afters":[],"start":1750415197489,"stop":1750415197497} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/1794900b-2f1b-4940-9f29-5120ed41d9d0-container.json b/hawkbit-security-core/allure-results/1794900b-2f1b-4940-9f29-5120ed41d9d0-container.json deleted file mode 100644 index a1b97fe48..000000000 --- a/hawkbit-security-core/allure-results/1794900b-2f1b-4940-9f29-5120ed41d9d0-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1794900b-2f1b-4940-9f29-5120ed41d9d0","name":"testCreateAmqpUri()","children":["b910d582-c02a-4fe9-b627-6c2d27aa5cbb"],"befores":[],"afters":[],"start":1750415197468,"stop":1750415197471} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/1cd530a2-b164-45f0-b717-676225857648-container.json b/hawkbit-security-core/allure-results/1cd530a2-b164-45f0-b717-676225857648-container.json deleted file mode 100644 index 4cae16192..000000000 --- a/hawkbit-security-core/allure-results/1cd530a2-b164-45f0-b717-676225857648-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"1cd530a2-b164-45f0-b717-676225857648","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6"],"befores":[],"afters":[],"start":1750414466495,"stop":1750414466498} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/20058e58-4ca8-4949-8a91-e51f7a4f1c60-result.json b/hawkbit-security-core/allure-results/20058e58-4ca8-4949-8a91-e51f7a4f1c60-result.json deleted file mode 100644 index 259be2503..000000000 --- a/hawkbit-security-core/allure-results/20058e58-4ca8-4949-8a91-e51f7a4f1c60-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"20058e58-4ca8-4949-8a91-e51f7a4f1c60","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414466488,"stop":1750414466491} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/22c8fa68-b0d0-422a-af13-7e4c2a3afdf7-result.json b/hawkbit-security-core/allure-results/22c8fa68-b0d0-422a-af13-7e4c2a3afdf7-result.json deleted file mode 100644 index 94bd70cf6..000000000 --- a/hawkbit-security-core/allure-results/22c8fa68-b0d0-422a-af13-7e4c2a3afdf7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"22c8fa68-b0d0-422a-af13-7e4c2a3afdf7","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414725265,"stop":1750414725268} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/2341b3ba-749f-425a-9644-46a3ad15e2df-result.json b/hawkbit-security-core/allure-results/2341b3ba-749f-425a-9644-46a3ad15e2df-result.json deleted file mode 100644 index 8132f8fc2..000000000 --- a/hawkbit-security-core/allure-results/2341b3ba-749f-425a-9644-46a3ad15e2df-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"2341b3ba-749f-425a-9644-46a3ad15e2df","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415146360,"stop":1750415146363} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/24600249-3a55-4c9e-bd80-2f1a68dc8a68-result.json b/hawkbit-security-core/allure-results/24600249-3a55-4c9e-bd80-2f1a68dc8a68-result.json deleted file mode 100644 index 5ee6897e4..000000000 --- a/hawkbit-security-core/allure-results/24600249-3a55-4c9e-bd80-2f1a68dc8a68-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"24600249-3a55-4c9e-bd80-2f1a68dc8a68","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415895718,"stop":1750415895720} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/24b94444-7282-4d46-8df4-8feed260ed52-container.json b/hawkbit-security-core/allure-results/24b94444-7282-4d46-8df4-8feed260ed52-container.json deleted file mode 100644 index 86cf48de5..000000000 --- a/hawkbit-security-core/allure-results/24b94444-7282-4d46-8df4-8feed260ed52-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"24b94444-7282-4d46-8df4-8feed260ed52","name":"getRemoteAddrFromXForwardedForHeader()","children":["8a04b45a-4f03-4b81-bfc6-2ca150e83a56"],"befores":[],"afters":[],"start":1750414972944,"stop":1750414973546} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/288da849-6474-4214-9cda-b425ceecf7b9-result.json b/hawkbit-security-core/allure-results/288da849-6474-4214-9cda-b425ceecf7b9-result.json deleted file mode 100644 index d53670e73..000000000 --- a/hawkbit-security-core/allure-results/288da849-6474-4214-9cda-b425ceecf7b9-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"288da849-6474-4214-9cda-b425ceecf7b9","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415121046,"stop":1750415121048} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/2a4ad8e0-ff9e-4e6f-87df-c1646347bbe0-container.json b/hawkbit-security-core/allure-results/2a4ad8e0-ff9e-4e6f-87df-c1646347bbe0-container.json deleted file mode 100644 index 487aef929..000000000 --- a/hawkbit-security-core/allure-results/2a4ad8e0-ff9e-4e6f-87df-c1646347bbe0-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"2a4ad8e0-ff9e-4e6f-87df-c1646347bbe0","name":"testResolveClientIpFromHeader()","children":["a049cd61-dca1-487c-bc68-e08e399b3182"],"befores":[],"afters":[],"start":1750414577005,"stop":1750414577010} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/2b1f393d-0d82-45cf-8ba5-69b966cdb781-container.json b/hawkbit-security-core/allure-results/2b1f393d-0d82-45cf-8ba5-69b966cdb781-container.json deleted file mode 100644 index 5a6f20958..000000000 --- a/hawkbit-security-core/allure-results/2b1f393d-0d82-45cf-8ba5-69b966cdb781-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"2b1f393d-0d82-45cf-8ba5-69b966cdb781","name":"testCreateClientHttpUri()","children":["7bf55d79-c841-4db2-b5e0-e325efdfb4a1"],"befores":[],"afters":[],"start":1750414577019,"stop":1750414577023} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/2faffa73-3434-4b36-9e23-8c1cb1ec162c-container.json b/hawkbit-security-core/allure-results/2faffa73-3434-4b36-9e23-8c1cb1ec162c-container.json deleted file mode 100644 index 0b8e8496a..000000000 --- a/hawkbit-security-core/allure-results/2faffa73-3434-4b36-9e23-8c1cb1ec162c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"2faffa73-3434-4b36-9e23-8c1cb1ec162c","name":"testCreateAmqpUri()","children":["a5e356d3-7d9e-469d-8ec6-6477acbd24e6"],"befores":[],"afters":[],"start":1750415895714,"stop":1750415895717} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/30f989f1-d8ed-4695-819b-efa3ab30fc88-container.json b/hawkbit-security-core/allure-results/30f989f1-d8ed-4695-819b-efa3ab30fc88-container.json deleted file mode 100644 index d9deb940e..000000000 --- a/hawkbit-security-core/allure-results/30f989f1-d8ed-4695-819b-efa3ab30fc88-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"30f989f1-d8ed-4695-819b-efa3ab30fc88","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["3d320f63-6667-4491-a562-ef513672935c"],"befores":[],"afters":[],"start":1750414806581,"stop":1750414806583} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/32e61e96-be9b-4214-8453-c5a441067e94-container.json b/hawkbit-security-core/allure-results/32e61e96-be9b-4214-8453-c5a441067e94-container.json deleted file mode 100644 index b8d05b96c..000000000 --- a/hawkbit-security-core/allure-results/32e61e96-be9b-4214-8453-c5a441067e94-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"32e61e96-be9b-4214-8453-c5a441067e94","name":"IpUtilTest","children":["0834987f-3e4e-4f94-9c54-db2c574fd3cb","7b675287-6274-4a6e-99ac-3620b7530605","46783e41-e1a1-4a6c-a00b-380d09ad5077","c0f02a85-139a-4c3a-88b9-4b6f8ab57d64","13765e2e-7fe8-4031-952a-841109b6f3cd","288da849-6474-4214-9cda-b425ceecf7b9","cf3330ae-c5ed-476b-bc99-5d69637548f5","a67acf61-bc34-4c8e-92aa-8310e9a89df3"],"befores":[],"afters":[],"start":1750415120445,"stop":1750415121060} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/363e7068-3353-4550-b4ce-8a9b2c567497-container.json b/hawkbit-security-core/allure-results/363e7068-3353-4550-b4ce-8a9b2c567497-container.json deleted file mode 100644 index f1a2483b8..000000000 --- a/hawkbit-security-core/allure-results/363e7068-3353-4550-b4ce-8a9b2c567497-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"363e7068-3353-4550-b4ce-8a9b2c567497","name":"IpUtilTest","children":["bb652b59-9ba7-4a8a-abb0-b817b62fbbf9","d0b4a60e-f92b-4663-acbc-0e68b5743fd7","5a9e1495-4c60-416a-b076-380387fba8ee","b910d582-c02a-4fe9-b627-6c2d27aa5cbb","d6556d50-6dc2-4051-8e33-8e4a00ca62dc","90242adc-89b1-4349-a1f5-513ce053c1d5","5293c6a8-069d-4395-bbbd-2bece07014eb","ce764dc4-d3dc-45af-9a80-aca51378da23"],"befores":[],"afters":[],"start":1750415196853,"stop":1750415197488} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/367125e9-f2f7-49d6-8e32-6990805914b3-result.json b/hawkbit-security-core/allure-results/367125e9-f2f7-49d6-8e32-6990805914b3-result.json deleted file mode 100644 index 24b28c455..000000000 --- a/hawkbit-security-core/allure-results/367125e9-f2f7-49d6-8e32-6990805914b3-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"367125e9-f2f7-49d6-8e32-6990805914b3","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750415258582,"stop":1750415259479} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/36a8466a-aa54-4b5b-9fc2-90784325ea1f-result.json b/hawkbit-security-core/allure-results/36a8466a-aa54-4b5b-9fc2-90784325ea1f-result.json deleted file mode 100644 index f6e02dffe..000000000 --- a/hawkbit-security-core/allure-results/36a8466a-aa54-4b5b-9fc2-90784325ea1f-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"36a8466a-aa54-4b5b-9fc2-90784325ea1f","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415895722,"stop":1750415895723} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/39a6455d-be83-48cd-9488-a6cb019d8605-result.json b/hawkbit-security-core/allure-results/39a6455d-be83-48cd-9488-a6cb019d8605-result.json deleted file mode 100644 index ad82e787b..000000000 --- a/hawkbit-security-core/allure-results/39a6455d-be83-48cd-9488-a6cb019d8605-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"39a6455d-be83-48cd-9488-a6cb019d8605","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415259561,"stop":1750415259563} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/3c37f5d7-d912-4bbc-b19d-033e27bc24fc-container.json b/hawkbit-security-core/allure-results/3c37f5d7-d912-4bbc-b19d-033e27bc24fc-container.json deleted file mode 100644 index 5541e6ffa..000000000 --- a/hawkbit-security-core/allure-results/3c37f5d7-d912-4bbc-b19d-033e27bc24fc-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3c37f5d7-d912-4bbc-b19d-033e27bc24fc","name":"maskRemoteAddrIfDisabled()","children":["05448497-b4e2-4e4c-a26b-f1e7a8a3bdca"],"befores":[],"afters":[],"start":1750415895730,"stop":1750415895736} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/3d320f63-6667-4491-a562-ef513672935c-result.json b/hawkbit-security-core/allure-results/3d320f63-6667-4491-a562-ef513672935c-result.json deleted file mode 100644 index a16d8d19c..000000000 --- a/hawkbit-security-core/allure-results/3d320f63-6667-4491-a562-ef513672935c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3d320f63-6667-4491-a562-ef513672935c","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414806582,"stop":1750414806583} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/3df83a07-5b93-4f67-bac0-62a9f2e504b2-container.json b/hawkbit-security-core/allure-results/3df83a07-5b93-4f67-bac0-62a9f2e504b2-container.json deleted file mode 100644 index 2930cfaa7..000000000 --- a/hawkbit-security-core/allure-results/3df83a07-5b93-4f67-bac0-62a9f2e504b2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"3df83a07-5b93-4f67-bac0-62a9f2e504b2","name":"getRemoteAddrFromXForwardedForHeader()","children":["a0c5384d-4335-4dcf-95ff-31d297e96f2c"],"befores":[],"afters":[],"start":1750414724680,"stop":1750414725255} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/403761e6-5287-4cb3-b955-0be70b0199a2-container.json b/hawkbit-security-core/allure-results/403761e6-5287-4cb3-b955-0be70b0199a2-container.json deleted file mode 100644 index 741a6b3f8..000000000 --- a/hawkbit-security-core/allure-results/403761e6-5287-4cb3-b955-0be70b0199a2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"403761e6-5287-4cb3-b955-0be70b0199a2","name":"testCreateClientHttpUri()","children":["6be1d3be-9d72-45b8-977a-c2d552a6efb9"],"befores":[],"afters":[],"start":1750415259566,"stop":1750415259571} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/40a60da3-a4d2-410f-ba72-6ca6edbda7a7-result.json b/hawkbit-security-core/allure-results/40a60da3-a4d2-410f-ba72-6ca6edbda7a7-result.json deleted file mode 100644 index f1c04a9e2..000000000 --- a/hawkbit-security-core/allure-results/40a60da3-a4d2-410f-ba72-6ca6edbda7a7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"40a60da3-a4d2-410f-ba72-6ca6edbda7a7","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750414576432,"stop":1750414576974} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/442a6eab-7d6b-4e64-8870-cd32037397ab-container.json b/hawkbit-security-core/allure-results/442a6eab-7d6b-4e64-8870-cd32037397ab-container.json deleted file mode 100644 index c341f349c..000000000 --- a/hawkbit-security-core/allure-results/442a6eab-7d6b-4e64-8870-cd32037397ab-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"442a6eab-7d6b-4e64-8870-cd32037397ab","name":"testCreateHttpUri()","children":["c291213d-e4eb-4240-ba35-34eb26112891"],"befores":[],"afters":[],"start":1750414973565,"stop":1750414973567} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/44a13cbf-4035-4bd1-a111-98253d19e243-result.json b/hawkbit-security-core/allure-results/44a13cbf-4035-4bd1-a111-98253d19e243-result.json deleted file mode 100644 index 67025d6fc..000000000 --- a/hawkbit-security-core/allure-results/44a13cbf-4035-4bd1-a111-98253d19e243-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"44a13cbf-4035-4bd1-a111-98253d19e243","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414466502,"stop":1750414466506} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/45c48313-ad73-4948-9959-ab0942d76e84-result.json b/hawkbit-security-core/allure-results/45c48313-ad73-4948-9959-ab0942d76e84-result.json deleted file mode 100644 index 49f6072c5..000000000 --- a/hawkbit-security-core/allure-results/45c48313-ad73-4948-9959-ab0942d76e84-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"45c48313-ad73-4948-9959-ab0942d76e84","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414973560,"stop":1750414973562} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4631a335-61a0-4848-891d-42846bbc3e1f-container.json b/hawkbit-security-core/allure-results/4631a335-61a0-4848-891d-42846bbc3e1f-container.json deleted file mode 100644 index 194ce238b..000000000 --- a/hawkbit-security-core/allure-results/4631a335-61a0-4848-891d-42846bbc3e1f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4631a335-61a0-4848-891d-42846bbc3e1f","name":"testCreateInvalidUri()","children":["c8bab49e-3efe-4de0-a73d-8c4b4b6bd363"],"befores":[],"afters":[],"start":1750414806568,"stop":1750414806573} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/46783e41-e1a1-4a6c-a00b-380d09ad5077-result.json b/hawkbit-security-core/allure-results/46783e41-e1a1-4a6c-a00b-380d09ad5077-result.json deleted file mode 100644 index 9e5cc3e2c..000000000 --- a/hawkbit-security-core/allure-results/46783e41-e1a1-4a6c-a00b-380d09ad5077-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"46783e41-e1a1-4a6c-a00b-380d09ad5077","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415121035,"stop":1750415121039} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/48b84837-52e5-4956-95b6-2e569a7ef8e5-result.json b/hawkbit-security-core/allure-results/48b84837-52e5-4956-95b6-2e569a7ef8e5-result.json deleted file mode 100644 index 9e44f6094..000000000 --- a/hawkbit-security-core/allure-results/48b84837-52e5-4956-95b6-2e569a7ef8e5-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"48b84837-52e5-4956-95b6-2e569a7ef8e5","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414725276,"stop":1750414725277} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/49a58dfe-0395-47d1-bf81-4806c6f2c6e0-result.json b/hawkbit-security-core/allure-results/49a58dfe-0395-47d1-bf81-4806c6f2c6e0-result.json deleted file mode 100644 index 2ec595bbf..000000000 --- a/hawkbit-security-core/allure-results/49a58dfe-0395-47d1-bf81-4806c6f2c6e0-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"49a58dfe-0395-47d1-bf81-4806c6f2c6e0","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414725272,"stop":1750414725274} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4a659ce4-f16c-427b-8dab-60f2ecf7d39f-container.json b/hawkbit-security-core/allure-results/4a659ce4-f16c-427b-8dab-60f2ecf7d39f-container.json deleted file mode 100644 index dc597bb86..000000000 --- a/hawkbit-security-core/allure-results/4a659ce4-f16c-427b-8dab-60f2ecf7d39f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4a659ce4-f16c-427b-8dab-60f2ecf7d39f","name":"shouldReturnAllPermissions()","children":["4b5c5318-5e65-4027-9114-d080e55a6901"],"befores":[],"afters":[],"start":1750415146384,"stop":1750415146389} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4b5c5318-5e65-4027-9114-d080e55a6901-result.json b/hawkbit-security-core/allure-results/4b5c5318-5e65-4027-9114-d080e55a6901-result.json deleted file mode 100644 index 4af621e44..000000000 --- a/hawkbit-security-core/allure-results/4b5c5318-5e65-4027-9114-d080e55a6901-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4b5c5318-5e65-4027-9114-d080e55a6901","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750415146384,"stop":1750415146389} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4d71dd97-c307-46b4-bc95-60ce78ee755b-container.json b/hawkbit-security-core/allure-results/4d71dd97-c307-46b4-bc95-60ce78ee755b-container.json deleted file mode 100644 index 890846518..000000000 --- a/hawkbit-security-core/allure-results/4d71dd97-c307-46b4-bc95-60ce78ee755b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4d71dd97-c307-46b4-bc95-60ce78ee755b","name":"testResolveClientIpFromHeader()","children":["7c967126-a82a-4da0-92b0-73f30f0abb90"],"befores":[],"afters":[],"start":1750415259551,"stop":1750415259556} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4edf36e0-9c4f-4fdc-925d-8ce1ba80f916-result.json b/hawkbit-security-core/allure-results/4edf36e0-9c4f-4fdc-925d-8ce1ba80f916-result.json deleted file mode 100644 index 22d804ca7..000000000 --- a/hawkbit-security-core/allure-results/4edf36e0-9c4f-4fdc-925d-8ce1ba80f916-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4edf36e0-9c4f-4fdc-925d-8ce1ba80f916","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415146370,"stop":1750415146371} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/4f21d041-3b19-4cc6-aee9-dc4695f7d2f3-container.json b/hawkbit-security-core/allure-results/4f21d041-3b19-4cc6-aee9-dc4695f7d2f3-container.json deleted file mode 100644 index 9364e1a31..000000000 --- a/hawkbit-security-core/allure-results/4f21d041-3b19-4cc6-aee9-dc4695f7d2f3-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"4f21d041-3b19-4cc6-aee9-dc4695f7d2f3","name":"testCreateHttpUri()","children":["6b625c48-b944-4910-8983-823c2a167d8e"],"befores":[],"afters":[],"start":1750415259563,"stop":1750415259566} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5293c6a8-069d-4395-bbbd-2bece07014eb-result.json b/hawkbit-security-core/allure-results/5293c6a8-069d-4395-bbbd-2bece07014eb-result.json deleted file mode 100644 index af03f392f..000000000 --- a/hawkbit-security-core/allure-results/5293c6a8-069d-4395-bbbd-2bece07014eb-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5293c6a8-069d-4395-bbbd-2bece07014eb","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415197477,"stop":1750415197480} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/52cbf4f6-4686-4156-857d-0f2a583a0d5e-container.json b/hawkbit-security-core/allure-results/52cbf4f6-4686-4156-857d-0f2a583a0d5e-container.json deleted file mode 100644 index 5864c528a..000000000 --- a/hawkbit-security-core/allure-results/52cbf4f6-4686-4156-857d-0f2a583a0d5e-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"52cbf4f6-4686-4156-857d-0f2a583a0d5e","name":"testCreateClientHttpUri()","children":["f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4"],"befores":[],"afters":[],"start":1750414973567,"stop":1750414973572} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/577f5fe9-7e05-4a99-ab14-70b9008907fa-result.json b/hawkbit-security-core/allure-results/577f5fe9-7e05-4a99-ab14-70b9008907fa-result.json deleted file mode 100644 index b0f447e5b..000000000 --- a/hawkbit-security-core/allure-results/577f5fe9-7e05-4a99-ab14-70b9008907fa-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"577f5fe9-7e05-4a99-ab14-70b9008907fa","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750415894807,"stop":1750415895641} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/57c6aa2a-2632-4f39-a0fb-190b8c85cb81-container.json b/hawkbit-security-core/allure-results/57c6aa2a-2632-4f39-a0fb-190b8c85cb81-container.json deleted file mode 100644 index fb0b4705d..000000000 --- a/hawkbit-security-core/allure-results/57c6aa2a-2632-4f39-a0fb-190b8c85cb81-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"57c6aa2a-2632-4f39-a0fb-190b8c85cb81","name":"shouldReturnAllPermissions()","children":["cc3f35f9-9864-487a-9e12-6eabd531f4aa"],"befores":[],"afters":[],"start":1750415259582,"stop":1750415259596} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5935f63c-857c-4bb1-89fc-9e5a0ecec390-container.json b/hawkbit-security-core/allure-results/5935f63c-857c-4bb1-89fc-9e5a0ecec390-container.json deleted file mode 100644 index e5cfd7c97..000000000 --- a/hawkbit-security-core/allure-results/5935f63c-857c-4bb1-89fc-9e5a0ecec390-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5935f63c-857c-4bb1-89fc-9e5a0ecec390","name":"getRemoteAddrFromXForwardedForHeader()","children":["0834987f-3e4e-4f94-9c54-db2c574fd3cb"],"befores":[],"afters":[],"start":1750415120451,"stop":1750415121025} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/59856281-aeb6-4f9e-b94a-f6a20197b4fd-container.json b/hawkbit-security-core/allure-results/59856281-aeb6-4f9e-b94a-f6a20197b4fd-container.json deleted file mode 100644 index d13bad2d6..000000000 --- a/hawkbit-security-core/allure-results/59856281-aeb6-4f9e-b94a-f6a20197b4fd-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"59856281-aeb6-4f9e-b94a-f6a20197b4fd","name":"shouldReturnAllPermissions()","children":["7ff778f3-cae6-404b-a987-83d212178c20"],"befores":[],"afters":[],"start":1750415121062,"stop":1750415121068} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/59df7109-d2ba-464a-8e4a-2e15ec4c76f0-container.json b/hawkbit-security-core/allure-results/59df7109-d2ba-464a-8e4a-2e15ec4c76f0-container.json deleted file mode 100644 index c99fe8845..000000000 --- a/hawkbit-security-core/allure-results/59df7109-d2ba-464a-8e4a-2e15ec4c76f0-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"59df7109-d2ba-464a-8e4a-2e15ec4c76f0","name":"maskRemoteAddrIfDisabled()","children":["a67acf61-bc34-4c8e-92aa-8310e9a89df3"],"befores":[],"afters":[],"start":1750415121053,"stop":1750415121058} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5a9e1495-4c60-416a-b076-380387fba8ee-result.json b/hawkbit-security-core/allure-results/5a9e1495-4c60-416a-b076-380387fba8ee-result.json deleted file mode 100644 index 1c2e52f7e..000000000 --- a/hawkbit-security-core/allure-results/5a9e1495-4c60-416a-b076-380387fba8ee-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5a9e1495-4c60-416a-b076-380387fba8ee","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415197465,"stop":1750415197468} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0-result.json b/hawkbit-security-core/allure-results/5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0-result.json deleted file mode 100644 index da290b0f1..000000000 --- a/hawkbit-security-core/allure-results/5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750414973573,"stop":1750414973576} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5c80a396-f01a-4040-b956-bdd901c8f81d-container.json b/hawkbit-security-core/allure-results/5c80a396-f01a-4040-b956-bdd901c8f81d-container.json deleted file mode 100644 index 324fa0391..000000000 --- a/hawkbit-security-core/allure-results/5c80a396-f01a-4040-b956-bdd901c8f81d-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5c80a396-f01a-4040-b956-bdd901c8f81d","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["39a6455d-be83-48cd-9488-a6cb019d8605"],"befores":[],"afters":[],"start":1750415259560,"stop":1750415259563} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5d4d8bc8-ab88-4d8d-95a9-3db7e07bfc38-container.json b/hawkbit-security-core/allure-results/5d4d8bc8-ab88-4d8d-95a9-3db7e07bfc38-container.json deleted file mode 100644 index ddada6a6d..000000000 --- a/hawkbit-security-core/allure-results/5d4d8bc8-ab88-4d8d-95a9-3db7e07bfc38-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5d4d8bc8-ab88-4d8d-95a9-3db7e07bfc38","name":"maskRemoteAddrIfDisabled()","children":["6350f0ca-acce-4a5d-86bb-ed04f0cb924c"],"befores":[],"afters":[],"start":1750414725282,"stop":1750414725287} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/5dd4f5a2-5319-4b1a-a07c-286e5d8370d5-container.json b/hawkbit-security-core/allure-results/5dd4f5a2-5319-4b1a-a07c-286e5d8370d5-container.json deleted file mode 100644 index 541c828ba..000000000 --- a/hawkbit-security-core/allure-results/5dd4f5a2-5319-4b1a-a07c-286e5d8370d5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"5dd4f5a2-5319-4b1a-a07c-286e5d8370d5","name":"testCreateInvalidUri()","children":["d0b4a60e-f92b-4663-acbc-0e68b5743fd7"],"befores":[],"afters":[],"start":1750415197458,"stop":1750415197463} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/62ea5167-1dcc-4131-b02e-121abf208a7d-container.json b/hawkbit-security-core/allure-results/62ea5167-1dcc-4131-b02e-121abf208a7d-container.json deleted file mode 100644 index ab011d9b8..000000000 --- a/hawkbit-security-core/allure-results/62ea5167-1dcc-4131-b02e-121abf208a7d-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"62ea5167-1dcc-4131-b02e-121abf208a7d","name":"shouldReturnAllPermissions()","children":["c8fdd19f-eec1-49f7-a805-b72c1430e375"],"befores":[],"afters":[],"start":1750414725290,"stop":1750414725297} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6350f0ca-acce-4a5d-86bb-ed04f0cb924c-result.json b/hawkbit-security-core/allure-results/6350f0ca-acce-4a5d-86bb-ed04f0cb924c-result.json deleted file mode 100644 index 110943982..000000000 --- a/hawkbit-security-core/allure-results/6350f0ca-acce-4a5d-86bb-ed04f0cb924c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6350f0ca-acce-4a5d-86bb-ed04f0cb924c","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750414725283,"stop":1750414725286} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/676700f9-fbe6-4c1e-9a92-e82c043cca82-container.json b/hawkbit-security-core/allure-results/676700f9-fbe6-4c1e-9a92-e82c043cca82-container.json deleted file mode 100644 index 7b34de0b0..000000000 --- a/hawkbit-security-core/allure-results/676700f9-fbe6-4c1e-9a92-e82c043cca82-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"676700f9-fbe6-4c1e-9a92-e82c043cca82","name":"maskRemoteAddrIfDisabled()","children":["5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0"],"befores":[],"afters":[],"start":1750414973572,"stop":1750414973577} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/69bd9185-3153-450b-9d57-367d9d0b836c-container.json b/hawkbit-security-core/allure-results/69bd9185-3153-450b-9d57-367d9d0b836c-container.json deleted file mode 100644 index 70fad99c1..000000000 --- a/hawkbit-security-core/allure-results/69bd9185-3153-450b-9d57-367d9d0b836c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"69bd9185-3153-450b-9d57-367d9d0b836c","name":"testCreateClientHttpUri()","children":["fa723d6b-c258-43b2-9cfd-61c0588448f5"],"befores":[],"afters":[],"start":1750415895724,"stop":1750415895729} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6a505c5f-cede-4b62-9f03-cb66907e5787-result.json b/hawkbit-security-core/allure-results/6a505c5f-cede-4b62-9f03-cb66907e5787-result.json deleted file mode 100644 index 595ed8705..000000000 --- a/hawkbit-security-core/allure-results/6a505c5f-cede-4b62-9f03-cb66907e5787-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6a505c5f-cede-4b62-9f03-cb66907e5787","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414725270,"stop":1750414725271} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6b625c48-b944-4910-8983-823c2a167d8e-result.json b/hawkbit-security-core/allure-results/6b625c48-b944-4910-8983-823c2a167d8e-result.json deleted file mode 100644 index 6eef763bd..000000000 --- a/hawkbit-security-core/allure-results/6b625c48-b944-4910-8983-823c2a167d8e-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6b625c48-b944-4910-8983-823c2a167d8e","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415259564,"stop":1750415259565} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6be1d3be-9d72-45b8-977a-c2d552a6efb9-result.json b/hawkbit-security-core/allure-results/6be1d3be-9d72-45b8-977a-c2d552a6efb9-result.json deleted file mode 100644 index c14013a95..000000000 --- a/hawkbit-security-core/allure-results/6be1d3be-9d72-45b8-977a-c2d552a6efb9-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6be1d3be-9d72-45b8-977a-c2d552a6efb9","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415259567,"stop":1750415259571} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6c386c75-ee1b-4524-ab23-8754712bc68b-container.json b/hawkbit-security-core/allure-results/6c386c75-ee1b-4524-ab23-8754712bc68b-container.json deleted file mode 100644 index b9bcda909..000000000 --- a/hawkbit-security-core/allure-results/6c386c75-ee1b-4524-ab23-8754712bc68b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6c386c75-ee1b-4524-ab23-8754712bc68b","name":"testResolveClientIpFromHeader()","children":["2341b3ba-749f-425a-9644-46a3ad15e2df"],"befores":[],"afters":[],"start":1750415146358,"stop":1750415146363} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6e04aa85-022e-4594-9a04-0a4f102fe50c-container.json b/hawkbit-security-core/allure-results/6e04aa85-022e-4594-9a04-0a4f102fe50c-container.json deleted file mode 100644 index 3e4664ca7..000000000 --- a/hawkbit-security-core/allure-results/6e04aa85-022e-4594-9a04-0a4f102fe50c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6e04aa85-022e-4594-9a04-0a4f102fe50c","name":"IpUtilTest","children":["7393f789-f197-4456-a5dd-ae514c43c9d5","e2318b7f-dd92-43c4-b975-b145913db907","20058e58-4ca8-4949-8a91-e51f7a4f1c60","87049cd6-8430-49e0-9f53-fb61937ae380","7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6","cfe76e19-f88d-42e3-bc83-eaf1533d2c54","44a13cbf-4035-4bd1-a111-98253d19e243","8892bf01-b444-4c84-94ba-5537176a522f"],"befores":[],"afters":[],"start":1750414465872,"stop":1750414466519} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6e49f7aa-c3c9-4e9d-88a5-5d2f62cd10a6-container.json b/hawkbit-security-core/allure-results/6e49f7aa-c3c9-4e9d-88a5-5d2f62cd10a6-container.json deleted file mode 100644 index db0ea9c5d..000000000 --- a/hawkbit-security-core/allure-results/6e49f7aa-c3c9-4e9d-88a5-5d2f62cd10a6-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6e49f7aa-c3c9-4e9d-88a5-5d2f62cd10a6","name":"testResolveClientIpFromHeader()","children":["c19022ea-0fe0-4248-84d0-3c9d43f8c660"],"befores":[],"afters":[],"start":1750414806573,"stop":1750414806578} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6ec61ead-fd3a-4882-914d-698df3737644-container.json b/hawkbit-security-core/allure-results/6ec61ead-fd3a-4882-914d-698df3737644-container.json deleted file mode 100644 index 366ed1c04..000000000 --- a/hawkbit-security-core/allure-results/6ec61ead-fd3a-4882-914d-698df3737644-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6ec61ead-fd3a-4882-914d-698df3737644","name":"SpPermissionTest","children":["914127fb-f84a-4c29-9c96-d78a9befc2a7"],"befores":[],"afters":[],"start":1750414577032,"stop":1750414577041} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/6ff77061-e8ec-4551-a456-93ab9c6ec3ad-result.json b/hawkbit-security-core/allure-results/6ff77061-e8ec-4551-a456-93ab9c6ec3ad-result.json deleted file mode 100644 index 51bfd7ef2..000000000 --- a/hawkbit-security-core/allure-results/6ff77061-e8ec-4551-a456-93ab9c6ec3ad-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"6ff77061-e8ec-4551-a456-93ab9c6ec3ad","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415259557,"stop":1750415259559} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/71a16139-11e9-4440-8159-e11c1507e2a8-container.json b/hawkbit-security-core/allure-results/71a16139-11e9-4440-8159-e11c1507e2a8-container.json deleted file mode 100644 index 08978991d..000000000 --- a/hawkbit-security-core/allure-results/71a16139-11e9-4440-8159-e11c1507e2a8-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"71a16139-11e9-4440-8159-e11c1507e2a8","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["49a58dfe-0395-47d1-bf81-4806c6f2c6e0"],"befores":[],"afters":[],"start":1750414725272,"stop":1750414725274} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7393f789-f197-4456-a5dd-ae514c43c9d5-result.json b/hawkbit-security-core/allure-results/7393f789-f197-4456-a5dd-ae514c43c9d5-result.json deleted file mode 100644 index 97cce5f4b..000000000 --- a/hawkbit-security-core/allure-results/7393f789-f197-4456-a5dd-ae514c43c9d5-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7393f789-f197-4456-a5dd-ae514c43c9d5","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750414465904,"stop":1750414466458} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7685d60b-ce0f-4623-9c5f-827ef6226cea-container.json b/hawkbit-security-core/allure-results/7685d60b-ce0f-4623-9c5f-827ef6226cea-container.json deleted file mode 100644 index cd759b7e7..000000000 --- a/hawkbit-security-core/allure-results/7685d60b-ce0f-4623-9c5f-827ef6226cea-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7685d60b-ce0f-4623-9c5f-827ef6226cea","name":"maskRemoteAddrIfDisabled()","children":["8892bf01-b444-4c84-94ba-5537176a522f"],"befores":[],"afters":[],"start":1750414466507,"stop":1750414466512} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/793a6407-39c3-4ff4-a4b8-3b44b9fdfbef-result.json b/hawkbit-security-core/allure-results/793a6407-39c3-4ff4-a4b8-3b44b9fdfbef-result.json deleted file mode 100644 index 6cc7381ea..000000000 --- a/hawkbit-security-core/allure-results/793a6407-39c3-4ff4-a4b8-3b44b9fdfbef-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"793a6407-39c3-4ff4-a4b8-3b44b9fdfbef","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414577014,"stop":1750414577016} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7b675287-6274-4a6e-99ac-3620b7530605-result.json b/hawkbit-security-core/allure-results/7b675287-6274-4a6e-99ac-3620b7530605-result.json deleted file mode 100644 index b555fbe3d..000000000 --- a/hawkbit-security-core/allure-results/7b675287-6274-4a6e-99ac-3620b7530605-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7b675287-6274-4a6e-99ac-3620b7530605","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750415121030,"stop":1750415121033} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7b723a2f-da68-4492-9b9b-356729f62c64-container.json b/hawkbit-security-core/allure-results/7b723a2f-da68-4492-9b9b-356729f62c64-container.json deleted file mode 100644 index e04a25489..000000000 --- a/hawkbit-security-core/allure-results/7b723a2f-da68-4492-9b9b-356729f62c64-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7b723a2f-da68-4492-9b9b-356729f62c64","name":"SpPermissionTest","children":["c8fdd19f-eec1-49f7-a805-b72c1430e375"],"befores":[],"afters":[],"start":1750414725290,"stop":1750414725298} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7bf55d79-c841-4db2-b5e0-e325efdfb4a1-result.json b/hawkbit-security-core/allure-results/7bf55d79-c841-4db2-b5e0-e325efdfb4a1-result.json deleted file mode 100644 index 58cfee710..000000000 --- a/hawkbit-security-core/allure-results/7bf55d79-c841-4db2-b5e0-e325efdfb4a1-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7bf55d79-c841-4db2-b5e0-e325efdfb4a1","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414577019,"stop":1750414577023} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7bf6bf92-3c27-4f5d-a420-499f992531a1-container.json b/hawkbit-security-core/allure-results/7bf6bf92-3c27-4f5d-a420-499f992531a1-container.json deleted file mode 100644 index 52c048c1b..000000000 --- a/hawkbit-security-core/allure-results/7bf6bf92-3c27-4f5d-a420-499f992531a1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7bf6bf92-3c27-4f5d-a420-499f992531a1","name":"testCreateClientHttpUri()","children":["e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d"],"befores":[],"afters":[],"start":1750414806586,"stop":1750414806591} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7c2d1566-5bd4-4511-bd74-e0fc4f3f5218-container.json b/hawkbit-security-core/allure-results/7c2d1566-5bd4-4511-bd74-e0fc4f3f5218-container.json deleted file mode 100644 index 6bfbfecf2..000000000 --- a/hawkbit-security-core/allure-results/7c2d1566-5bd4-4511-bd74-e0fc4f3f5218-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7c2d1566-5bd4-4511-bd74-e0fc4f3f5218","name":"testResolveClientIpFromHeader()","children":["5a9e1495-4c60-416a-b076-380387fba8ee"],"befores":[],"afters":[],"start":1750415197463,"stop":1750415197468} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7c967126-a82a-4da0-92b0-73f30f0abb90-result.json b/hawkbit-security-core/allure-results/7c967126-a82a-4da0-92b0-73f30f0abb90-result.json deleted file mode 100644 index 0710b8344..000000000 --- a/hawkbit-security-core/allure-results/7c967126-a82a-4da0-92b0-73f30f0abb90-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7c967126-a82a-4da0-92b0-73f30f0abb90","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415259552,"stop":1750415259555} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7d9a4970-c0d0-47ff-9687-aa6aa2a401af-container.json b/hawkbit-security-core/allure-results/7d9a4970-c0d0-47ff-9687-aa6aa2a401af-container.json deleted file mode 100644 index e1b844dd2..000000000 --- a/hawkbit-security-core/allure-results/7d9a4970-c0d0-47ff-9687-aa6aa2a401af-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7d9a4970-c0d0-47ff-9687-aa6aa2a401af","name":"testCreateAmqpUri()","children":["c0f02a85-139a-4c3a-88b9-4b6f8ab57d64"],"befores":[],"afters":[],"start":1750415121039,"stop":1750415121042} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7e5c52ef-d4c3-4832-8321-1270b0ab2172-container.json b/hawkbit-security-core/allure-results/7e5c52ef-d4c3-4832-8321-1270b0ab2172-container.json deleted file mode 100644 index 6fd1449c7..000000000 --- a/hawkbit-security-core/allure-results/7e5c52ef-d4c3-4832-8321-1270b0ab2172-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7e5c52ef-d4c3-4832-8321-1270b0ab2172","name":"IpUtilTest","children":["a0c5384d-4335-4dcf-95ff-31d297e96f2c","c5c6d015-d557-4d1f-8e28-8a535f14f684","22c8fa68-b0d0-422a-af13-7e4c2a3afdf7","6a505c5f-cede-4b62-9f03-cb66907e5787","49a58dfe-0395-47d1-bf81-4806c6f2c6e0","48b84837-52e5-4956-95b6-2e569a7ef8e5","d252e357-a7e2-4cf2-8ba2-67638cc7841e","6350f0ca-acce-4a5d-86bb-ed04f0cb924c"],"befores":[],"afters":[],"start":1750414724674,"stop":1750414725289} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6-result.json b/hawkbit-security-core/allure-results/7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6-result.json deleted file mode 100644 index 183db333e..000000000 --- a/hawkbit-security-core/allure-results/7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7fe2ff4e-1d5e-4770-8bb5-2cc5edb655d6","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414466496,"stop":1750414466498} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/7ff778f3-cae6-404b-a987-83d212178c20-result.json b/hawkbit-security-core/allure-results/7ff778f3-cae6-404b-a987-83d212178c20-result.json deleted file mode 100644 index 7a7d37b9f..000000000 --- a/hawkbit-security-core/allure-results/7ff778f3-cae6-404b-a987-83d212178c20-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"7ff778f3-cae6-404b-a987-83d212178c20","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750415121062,"stop":1750415121068} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/801ee71c-963e-4ea9-a37b-a54f8628c041-result.json b/hawkbit-security-core/allure-results/801ee71c-963e-4ea9-a37b-a54f8628c041-result.json deleted file mode 100644 index 82e9f05f0..000000000 --- a/hawkbit-security-core/allure-results/801ee71c-963e-4ea9-a37b-a54f8628c041-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"801ee71c-963e-4ea9-a37b-a54f8628c041","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750414806600,"stop":1750414806606} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/806da070-7145-40eb-9004-ed044bd26d0f-container.json b/hawkbit-security-core/allure-results/806da070-7145-40eb-9004-ed044bd26d0f-container.json deleted file mode 100644 index f4f77e53b..000000000 --- a/hawkbit-security-core/allure-results/806da070-7145-40eb-9004-ed044bd26d0f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"806da070-7145-40eb-9004-ed044bd26d0f","name":"SpPermissionTest","children":["e78e1d4e-536a-474a-b31d-b931334d94a7"],"befores":[],"afters":[],"start":1750415895740,"stop":1750415895755} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8099131c-07f3-4cb1-ab5d-a4bab40cc26a-result.json b/hawkbit-security-core/allure-results/8099131c-07f3-4cb1-ab5d-a4bab40cc26a-result.json deleted file mode 100644 index 01b631110..000000000 --- a/hawkbit-security-core/allure-results/8099131c-07f3-4cb1-ab5d-a4bab40cc26a-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8099131c-07f3-4cb1-ab5d-a4bab40cc26a","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750415895702,"stop":1750415895707} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/81d148c8-9d88-4b92-a42d-877cd8bb1d5e-container.json b/hawkbit-security-core/allure-results/81d148c8-9d88-4b92-a42d-877cd8bb1d5e-container.json deleted file mode 100644 index 8a57177b3..000000000 --- a/hawkbit-security-core/allure-results/81d148c8-9d88-4b92-a42d-877cd8bb1d5e-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"81d148c8-9d88-4b92-a42d-877cd8bb1d5e","name":"SpPermissionTest","children":["4b5c5318-5e65-4027-9114-d080e55a6901"],"befores":[],"afters":[],"start":1750415146383,"stop":1750415146390} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/844406fc-8ba3-4738-97ab-b8389c4bc5a4-container.json b/hawkbit-security-core/allure-results/844406fc-8ba3-4738-97ab-b8389c4bc5a4-container.json deleted file mode 100644 index 8bc904e0e..000000000 --- a/hawkbit-security-core/allure-results/844406fc-8ba3-4738-97ab-b8389c4bc5a4-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"844406fc-8ba3-4738-97ab-b8389c4bc5a4","name":"shouldReturnAllPermissions()","children":["86d179d3-61a0-4b72-9e5f-3432e8873be8"],"befores":[],"afters":[],"start":1750414973580,"stop":1750414973587} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/853f3628-065d-4d53-a14f-a4973082542c-container.json b/hawkbit-security-core/allure-results/853f3628-065d-4d53-a14f-a4973082542c-container.json deleted file mode 100644 index e37459ca1..000000000 --- a/hawkbit-security-core/allure-results/853f3628-065d-4d53-a14f-a4973082542c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"853f3628-065d-4d53-a14f-a4973082542c","name":"testCreateInvalidUri()","children":["e2318b7f-dd92-43c4-b975-b145913db907"],"befores":[],"afters":[],"start":1750414466481,"stop":1750414466487} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8620ac8c-ef41-4b51-a52e-defef15b32e1-container.json b/hawkbit-security-core/allure-results/8620ac8c-ef41-4b51-a52e-defef15b32e1-container.json deleted file mode 100644 index 47a103593..000000000 --- a/hawkbit-security-core/allure-results/8620ac8c-ef41-4b51-a52e-defef15b32e1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8620ac8c-ef41-4b51-a52e-defef15b32e1","name":"testResolveClientIpFromHeader()","children":["22c8fa68-b0d0-422a-af13-7e4c2a3afdf7"],"befores":[],"afters":[],"start":1750414725264,"stop":1750414725268} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/86d179d3-61a0-4b72-9e5f-3432e8873be8-result.json b/hawkbit-security-core/allure-results/86d179d3-61a0-4b72-9e5f-3432e8873be8-result.json deleted file mode 100644 index 01e9e69e0..000000000 --- a/hawkbit-security-core/allure-results/86d179d3-61a0-4b72-9e5f-3432e8873be8-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"86d179d3-61a0-4b72-9e5f-3432e8873be8","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750414973581,"stop":1750414973587} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/87049cd6-8430-49e0-9f53-fb61937ae380-result.json b/hawkbit-security-core/allure-results/87049cd6-8430-49e0-9f53-fb61937ae380-result.json deleted file mode 100644 index 8e8caee8f..000000000 --- a/hawkbit-security-core/allure-results/87049cd6-8430-49e0-9f53-fb61937ae380-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"87049cd6-8430-49e0-9f53-fb61937ae380","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414466493,"stop":1750414466495} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8730d3a0-6cb4-4f3b-8446-6fdd5bfd3c5e-container.json b/hawkbit-security-core/allure-results/8730d3a0-6cb4-4f3b-8446-6fdd5bfd3c5e-container.json deleted file mode 100644 index 47db3fedf..000000000 --- a/hawkbit-security-core/allure-results/8730d3a0-6cb4-4f3b-8446-6fdd5bfd3c5e-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8730d3a0-6cb4-4f3b-8446-6fdd5bfd3c5e","name":"testCreateClientHttpUri()","children":["bd7ce21f-8836-4fc1-b614-82ddcfbc7add"],"befores":[],"afters":[],"start":1750415146371,"stop":1750415146375} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/88241c03-fe95-476f-9af6-e8dfd6cca047-container.json b/hawkbit-security-core/allure-results/88241c03-fe95-476f-9af6-e8dfd6cca047-container.json deleted file mode 100644 index 8503e256b..000000000 --- a/hawkbit-security-core/allure-results/88241c03-fe95-476f-9af6-e8dfd6cca047-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"88241c03-fe95-476f-9af6-e8dfd6cca047","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["0dedb88b-a3cf-4731-9d2f-5dc8fd17de88"],"befores":[],"afters":[],"start":1750414973562,"stop":1750414973565} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8852d683-417e-4a57-8e57-4605bd7f1202-container.json b/hawkbit-security-core/allure-results/8852d683-417e-4a57-8e57-4605bd7f1202-container.json deleted file mode 100644 index 6f3e8dc26..000000000 --- a/hawkbit-security-core/allure-results/8852d683-417e-4a57-8e57-4605bd7f1202-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8852d683-417e-4a57-8e57-4605bd7f1202","name":"testCreateAmqpUri()","children":["6ff77061-e8ec-4551-a456-93ab9c6ec3ad"],"befores":[],"afters":[],"start":1750415259556,"stop":1750415259559} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8892bf01-b444-4c84-94ba-5537176a522f-result.json b/hawkbit-security-core/allure-results/8892bf01-b444-4c84-94ba-5537176a522f-result.json deleted file mode 100644 index 9b90c7e00..000000000 --- a/hawkbit-security-core/allure-results/8892bf01-b444-4c84-94ba-5537176a522f-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8892bf01-b444-4c84-94ba-5537176a522f","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750414466507,"stop":1750414466512} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/897f9bc0-038f-47e1-a4bd-664e3f61b629-result.json b/hawkbit-security-core/allure-results/897f9bc0-038f-47e1-a4bd-664e3f61b629-result.json deleted file mode 100644 index f4ee8dce5..000000000 --- a/hawkbit-security-core/allure-results/897f9bc0-038f-47e1-a4bd-664e3f61b629-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"897f9bc0-038f-47e1-a4bd-664e3f61b629","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750414973551,"stop":1750414973554} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/899a4e5b-266c-4e81-a8e3-fe8c67c20927-result.json b/hawkbit-security-core/allure-results/899a4e5b-266c-4e81-a8e3-fe8c67c20927-result.json deleted file mode 100644 index c2814e51b..000000000 --- a/hawkbit-security-core/allure-results/899a4e5b-266c-4e81-a8e3-fe8c67c20927-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"899a4e5b-266c-4e81-a8e3-fe8c67c20927","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750414806013,"stop":1750414806544} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8a04b45a-4f03-4b81-bfc6-2ca150e83a56-result.json b/hawkbit-security-core/allure-results/8a04b45a-4f03-4b81-bfc6-2ca150e83a56-result.json deleted file mode 100644 index 0f7b7a317..000000000 --- a/hawkbit-security-core/allure-results/8a04b45a-4f03-4b81-bfc6-2ca150e83a56-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8a04b45a-4f03-4b81-bfc6-2ca150e83a56","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750414972958,"stop":1750414973525} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/8c8bfffc-4393-4a16-aaeb-f9599a9340e4-result.json b/hawkbit-security-core/allure-results/8c8bfffc-4393-4a16-aaeb-f9599a9340e4-result.json deleted file mode 100644 index e4bdc11d1..000000000 --- a/hawkbit-security-core/allure-results/8c8bfffc-4393-4a16-aaeb-f9599a9340e4-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"8c8bfffc-4393-4a16-aaeb-f9599a9340e4","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414577011,"stop":1750414577012} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/90242adc-89b1-4349-a1f5-513ce053c1d5-result.json b/hawkbit-security-core/allure-results/90242adc-89b1-4349-a1f5-513ce053c1d5-result.json deleted file mode 100644 index d896660d7..000000000 --- a/hawkbit-security-core/allure-results/90242adc-89b1-4349-a1f5-513ce053c1d5-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"90242adc-89b1-4349-a1f5-513ce053c1d5","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415197475,"stop":1750415197476} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/908c2641-669d-43ed-b96f-7ee50c55edf4-container.json b/hawkbit-security-core/allure-results/908c2641-669d-43ed-b96f-7ee50c55edf4-container.json deleted file mode 100644 index 43dca04fb..000000000 --- a/hawkbit-security-core/allure-results/908c2641-669d-43ed-b96f-7ee50c55edf4-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"908c2641-669d-43ed-b96f-7ee50c55edf4","name":"testCreateAmqpUri()","children":["8c8bfffc-4393-4a16-aaeb-f9599a9340e4"],"befores":[],"afters":[],"start":1750414577010,"stop":1750414577013} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/914127fb-f84a-4c29-9c96-d78a9befc2a7-result.json b/hawkbit-security-core/allure-results/914127fb-f84a-4c29-9c96-d78a9befc2a7-result.json deleted file mode 100644 index 7d8894a42..000000000 --- a/hawkbit-security-core/allure-results/914127fb-f84a-4c29-9c96-d78a9befc2a7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"914127fb-f84a-4c29-9c96-d78a9befc2a7","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750414577033,"stop":1750414577040} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/94753b67-8bf0-4958-887d-a656eca31841-container.json b/hawkbit-security-core/allure-results/94753b67-8bf0-4958-887d-a656eca31841-container.json deleted file mode 100644 index 4cdb63c63..000000000 --- a/hawkbit-security-core/allure-results/94753b67-8bf0-4958-887d-a656eca31841-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"94753b67-8bf0-4958-887d-a656eca31841","name":"getRemoteAddrFromXForwardedForHeader()","children":["ca5e9cff-fa32-4651-a1e5-70fb77eeb77c"],"befores":[],"afters":[],"start":1750415145753,"stop":1750415146349} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/94efe841-50be-48f2-a8ac-411caa753fe2-container.json b/hawkbit-security-core/allure-results/94efe841-50be-48f2-a8ac-411caa753fe2-container.json deleted file mode 100644 index 1259f57d4..000000000 --- a/hawkbit-security-core/allure-results/94efe841-50be-48f2-a8ac-411caa753fe2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"94efe841-50be-48f2-a8ac-411caa753fe2","name":"getRemoteAddrFromXForwardedForHeader()","children":["40a60da3-a4d2-410f-ba72-6ca6edbda7a7"],"befores":[],"afters":[],"start":1750414576418,"stop":1750414576995} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/97e08bb3-f24f-4b4f-a2e9-ee831a317e51-container.json b/hawkbit-security-core/allure-results/97e08bb3-f24f-4b4f-a2e9-ee831a317e51-container.json deleted file mode 100644 index d02131362..000000000 --- a/hawkbit-security-core/allure-results/97e08bb3-f24f-4b4f-a2e9-ee831a317e51-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"97e08bb3-f24f-4b4f-a2e9-ee831a317e51","name":"shouldReturnAllPermissions()","children":["bd2e4de6-b6b9-45ee-bad5-47beeb796618"],"befores":[],"afters":[],"start":1750414466525,"stop":1750414466539} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/97f34bae-0b68-4d64-8e8d-1061da05800c-container.json b/hawkbit-security-core/allure-results/97f34bae-0b68-4d64-8e8d-1061da05800c-container.json deleted file mode 100644 index 62004866a..000000000 --- a/hawkbit-security-core/allure-results/97f34bae-0b68-4d64-8e8d-1061da05800c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"97f34bae-0b68-4d64-8e8d-1061da05800c","name":"testCreateInvalidUri()","children":["8099131c-07f3-4cb1-ab5d-a4bab40cc26a"],"befores":[],"afters":[],"start":1750415895700,"stop":1750415895708} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/9878a862-b231-49cc-8c2a-4ca42ecfdd1c-container.json b/hawkbit-security-core/allure-results/9878a862-b231-49cc-8c2a-4ca42ecfdd1c-container.json deleted file mode 100644 index 28d2a660a..000000000 --- a/hawkbit-security-core/allure-results/9878a862-b231-49cc-8c2a-4ca42ecfdd1c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"9878a862-b231-49cc-8c2a-4ca42ecfdd1c","name":"shouldReturnAllPermissions()","children":["0ec0e982-ba7d-4cce-ba34-4f8c4b1269e2"],"befores":[],"afters":[],"start":1750415197489,"stop":1750415197496} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/99923ea9-3104-45f3-b7c4-efb8f2a77e79-container.json b/hawkbit-security-core/allure-results/99923ea9-3104-45f3-b7c4-efb8f2a77e79-container.json deleted file mode 100644 index 8203ae9b2..000000000 --- a/hawkbit-security-core/allure-results/99923ea9-3104-45f3-b7c4-efb8f2a77e79-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"99923ea9-3104-45f3-b7c4-efb8f2a77e79","name":"shouldReturnAllPermissions()","children":["e78e1d4e-536a-474a-b31d-b931334d94a7"],"befores":[],"afters":[],"start":1750415895740,"stop":1750415895754} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/9ae59bac-2ec4-4691-88f8-80b40107cb81-container.json b/hawkbit-security-core/allure-results/9ae59bac-2ec4-4691-88f8-80b40107cb81-container.json deleted file mode 100644 index 055081a3c..000000000 --- a/hawkbit-security-core/allure-results/9ae59bac-2ec4-4691-88f8-80b40107cb81-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"9ae59bac-2ec4-4691-88f8-80b40107cb81","name":"testCreateHttpUri()","children":["36a8466a-aa54-4b5b-9fc2-90784325ea1f"],"befores":[],"afters":[],"start":1750415895721,"stop":1750415895724} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/9bb5b538-87a5-4e6c-a125-8bd8bb16bdbc-container.json b/hawkbit-security-core/allure-results/9bb5b538-87a5-4e6c-a125-8bd8bb16bdbc-container.json deleted file mode 100644 index 99d818c15..000000000 --- a/hawkbit-security-core/allure-results/9bb5b538-87a5-4e6c-a125-8bd8bb16bdbc-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"9bb5b538-87a5-4e6c-a125-8bd8bb16bdbc","name":"testCreateInvalidUri()","children":["897f9bc0-038f-47e1-a4bd-664e3f61b629"],"befores":[],"afters":[],"start":1750414973549,"stop":1750414973554} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/9f0b72e5-f800-468f-b3fa-f93cba99e1f5-container.json b/hawkbit-security-core/allure-results/9f0b72e5-f800-468f-b3fa-f93cba99e1f5-container.json deleted file mode 100644 index 463878db4..000000000 --- a/hawkbit-security-core/allure-results/9f0b72e5-f800-468f-b3fa-f93cba99e1f5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"9f0b72e5-f800-468f-b3fa-f93cba99e1f5","name":"SpPermissionTest","children":["801ee71c-963e-4ea9-a37b-a54f8628c041"],"befores":[],"afters":[],"start":1750414806599,"stop":1750414806607} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a049cd61-dca1-487c-bc68-e08e399b3182-result.json b/hawkbit-security-core/allure-results/a049cd61-dca1-487c-bc68-e08e399b3182-result.json deleted file mode 100644 index 06bfc0a91..000000000 --- a/hawkbit-security-core/allure-results/a049cd61-dca1-487c-bc68-e08e399b3182-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a049cd61-dca1-487c-bc68-e08e399b3182","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414577006,"stop":1750414577009} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a0c5384d-4335-4dcf-95ff-31d297e96f2c-result.json b/hawkbit-security-core/allure-results/a0c5384d-4335-4dcf-95ff-31d297e96f2c-result.json deleted file mode 100644 index c610a7d9c..000000000 --- a/hawkbit-security-core/allure-results/a0c5384d-4335-4dcf-95ff-31d297e96f2c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a0c5384d-4335-4dcf-95ff-31d297e96f2c","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750414724694,"stop":1750414725234} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a40734f3-d2dd-4164-af09-701fd2351ae9-result.json b/hawkbit-security-core/allure-results/a40734f3-d2dd-4164-af09-701fd2351ae9-result.json deleted file mode 100644 index 53d93ce09..000000000 --- a/hawkbit-security-core/allure-results/a40734f3-d2dd-4164-af09-701fd2351ae9-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a40734f3-d2dd-4164-af09-701fd2351ae9","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414973556,"stop":1750414973559} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a5e356d3-7d9e-469d-8ec6-6477acbd24e6-result.json b/hawkbit-security-core/allure-results/a5e356d3-7d9e-469d-8ec6-6477acbd24e6-result.json deleted file mode 100644 index dcde6812b..000000000 --- a/hawkbit-security-core/allure-results/a5e356d3-7d9e-469d-8ec6-6477acbd24e6-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a5e356d3-7d9e-469d-8ec6-6477acbd24e6","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415895715,"stop":1750415895717} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a663290a-2c55-4851-a2b2-53d9be1407ed-container.json b/hawkbit-security-core/allure-results/a663290a-2c55-4851-a2b2-53d9be1407ed-container.json deleted file mode 100644 index 7882dac98..000000000 --- a/hawkbit-security-core/allure-results/a663290a-2c55-4851-a2b2-53d9be1407ed-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a663290a-2c55-4851-a2b2-53d9be1407ed","name":"testCreateInvalidUri()","children":["e2501d8d-ae91-4365-a883-65c121d5a6f0"],"befores":[],"afters":[],"start":1750415259542,"stop":1750415259550} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a67acf61-bc34-4c8e-92aa-8310e9a89df3-result.json b/hawkbit-security-core/allure-results/a67acf61-bc34-4c8e-92aa-8310e9a89df3-result.json deleted file mode 100644 index 56e7f97c1..000000000 --- a/hawkbit-security-core/allure-results/a67acf61-bc34-4c8e-92aa-8310e9a89df3-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a67acf61-bc34-4c8e-92aa-8310e9a89df3","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750415121054,"stop":1750415121057} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/a8765d5b-55ca-4f74-90c7-02755739cda0-result.json b/hawkbit-security-core/allure-results/a8765d5b-55ca-4f74-90c7-02755739cda0-result.json deleted file mode 100644 index 3bd491783..000000000 --- a/hawkbit-security-core/allure-results/a8765d5b-55ca-4f74-90c7-02755739cda0-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"a8765d5b-55ca-4f74-90c7-02755739cda0","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750415146355,"stop":1750415146358} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/aa6d4af1-794a-42df-87b6-3000e46c18f8-container.json b/hawkbit-security-core/allure-results/aa6d4af1-794a-42df-87b6-3000e46c18f8-container.json deleted file mode 100644 index 6c3d10879..000000000 --- a/hawkbit-security-core/allure-results/aa6d4af1-794a-42df-87b6-3000e46c18f8-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"aa6d4af1-794a-42df-87b6-3000e46c18f8","name":"IpUtilTest","children":["899a4e5b-266c-4e81-a8e3-fe8c67c20927","c8bab49e-3efe-4de0-a73d-8c4b4b6bd363","c19022ea-0fe0-4248-84d0-3c9d43f8c660","069b7cba-94c0-4c3b-b50b-093ceae56ae9","3d320f63-6667-4491-a562-ef513672935c","ea796ea6-e461-42bd-84c4-86af1971750c","e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d","b94d399e-a2a3-4724-a4ab-20f21e274bf6"],"befores":[],"afters":[],"start":1750414805992,"stop":1750414806598} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/aae6fac2-68f2-4d17-84b0-2ddcc59c76d4-container.json b/hawkbit-security-core/allure-results/aae6fac2-68f2-4d17-84b0-2ddcc59c76d4-container.json deleted file mode 100644 index 9cc1dcaef..000000000 --- a/hawkbit-security-core/allure-results/aae6fac2-68f2-4d17-84b0-2ddcc59c76d4-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"aae6fac2-68f2-4d17-84b0-2ddcc59c76d4","name":"SpPermissionTest","children":["86d179d3-61a0-4b72-9e5f-3432e8873be8"],"befores":[],"afters":[],"start":1750414973580,"stop":1750414973588} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ac0e4ad9-7893-4c4c-87fa-2744a3aed54b-container.json b/hawkbit-security-core/allure-results/ac0e4ad9-7893-4c4c-87fa-2744a3aed54b-container.json deleted file mode 100644 index 20495daaa..000000000 --- a/hawkbit-security-core/allure-results/ac0e4ad9-7893-4c4c-87fa-2744a3aed54b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ac0e4ad9-7893-4c4c-87fa-2744a3aed54b","name":"testCreateInvalidUri()","children":["7b675287-6274-4a6e-99ac-3620b7530605"],"befores":[],"afters":[],"start":1750415121028,"stop":1750415121034} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ac6285df-347e-457d-b8ac-ffd6733723e4-container.json b/hawkbit-security-core/allure-results/ac6285df-347e-457d-b8ac-ffd6733723e4-container.json deleted file mode 100644 index 98634c56b..000000000 --- a/hawkbit-security-core/allure-results/ac6285df-347e-457d-b8ac-ffd6733723e4-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ac6285df-347e-457d-b8ac-ffd6733723e4","name":"getRemoteAddrFromXForwardedForHeader()","children":["577f5fe9-7e05-4a99-ab14-70b9008907fa"],"befores":[],"afters":[],"start":1750415894797,"stop":1750415895695} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/acc4f0bb-cb00-4d16-8645-268a0060207b-container.json b/hawkbit-security-core/allure-results/acc4f0bb-cb00-4d16-8645-268a0060207b-container.json deleted file mode 100644 index eb3e4a47a..000000000 --- a/hawkbit-security-core/allure-results/acc4f0bb-cb00-4d16-8645-268a0060207b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"acc4f0bb-cb00-4d16-8645-268a0060207b","name":"testResolveClientIpFromHeader()","children":["d7be1fa4-0452-4960-bada-b6457976e383"],"befores":[],"afters":[],"start":1750415895708,"stop":1750415895713} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/aed0c70a-2f0f-485d-ad60-eead741d093d-container.json b/hawkbit-security-core/allure-results/aed0c70a-2f0f-485d-ad60-eead741d093d-container.json deleted file mode 100644 index d29f25bdd..000000000 --- a/hawkbit-security-core/allure-results/aed0c70a-2f0f-485d-ad60-eead741d093d-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"aed0c70a-2f0f-485d-ad60-eead741d093d","name":"shouldReturnAllPermissions()","children":["914127fb-f84a-4c29-9c96-d78a9befc2a7"],"befores":[],"afters":[],"start":1750414577032,"stop":1750414577040} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/afc3995c-f141-4d0a-a7ad-32720719b2d7-container.json b/hawkbit-security-core/allure-results/afc3995c-f141-4d0a-a7ad-32720719b2d7-container.json deleted file mode 100644 index 53cbcbd1e..000000000 --- a/hawkbit-security-core/allure-results/afc3995c-f141-4d0a-a7ad-32720719b2d7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"afc3995c-f141-4d0a-a7ad-32720719b2d7","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["13765e2e-7fe8-4031-952a-841109b6f3cd"],"befores":[],"afters":[],"start":1750415121042,"stop":1750415121045} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b1b63c13-89bf-4665-93b7-513a4fdc6bd3-container.json b/hawkbit-security-core/allure-results/b1b63c13-89bf-4665-93b7-513a4fdc6bd3-container.json deleted file mode 100644 index 21cb05b14..000000000 --- a/hawkbit-security-core/allure-results/b1b63c13-89bf-4665-93b7-513a4fdc6bd3-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b1b63c13-89bf-4665-93b7-513a4fdc6bd3","name":"SpPermissionTest","children":["cc3f35f9-9864-487a-9e12-6eabd531f4aa"],"befores":[],"afters":[],"start":1750415259582,"stop":1750415259597} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b2b75b89-f790-4125-a9c8-eb870e90e42b-container.json b/hawkbit-security-core/allure-results/b2b75b89-f790-4125-a9c8-eb870e90e42b-container.json deleted file mode 100644 index fdec98cec..000000000 --- a/hawkbit-security-core/allure-results/b2b75b89-f790-4125-a9c8-eb870e90e42b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b2b75b89-f790-4125-a9c8-eb870e90e42b","name":"testResolveClientIpFromHeader()","children":["a40734f3-d2dd-4164-af09-701fd2351ae9"],"befores":[],"afters":[],"start":1750414973555,"stop":1750414973559} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b47d2b66-9f61-4f83-b0e1-3d2a20d8a558-container.json b/hawkbit-security-core/allure-results/b47d2b66-9f61-4f83-b0e1-3d2a20d8a558-container.json deleted file mode 100644 index 58a46b2f1..000000000 --- a/hawkbit-security-core/allure-results/b47d2b66-9f61-4f83-b0e1-3d2a20d8a558-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b47d2b66-9f61-4f83-b0e1-3d2a20d8a558","name":"testCreateClientHttpUri()","children":["44a13cbf-4035-4bd1-a111-98253d19e243"],"befores":[],"afters":[],"start":1750414466502,"stop":1750414466506} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b605639a-c096-4bfa-b550-8043b31ace7a-container.json b/hawkbit-security-core/allure-results/b605639a-c096-4bfa-b550-8043b31ace7a-container.json deleted file mode 100644 index 30a549216..000000000 --- a/hawkbit-security-core/allure-results/b605639a-c096-4bfa-b550-8043b31ace7a-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b605639a-c096-4bfa-b550-8043b31ace7a","name":"testCreateClientHttpUri()","children":["5293c6a8-069d-4395-bbbd-2bece07014eb"],"befores":[],"afters":[],"start":1750415197477,"stop":1750415197481} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b80e1c2b-767c-47ef-8e82-615cf8aafe3b-container.json b/hawkbit-security-core/allure-results/b80e1c2b-767c-47ef-8e82-615cf8aafe3b-container.json deleted file mode 100644 index 0ff4e9641..000000000 --- a/hawkbit-security-core/allure-results/b80e1c2b-767c-47ef-8e82-615cf8aafe3b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b80e1c2b-767c-47ef-8e82-615cf8aafe3b","name":"IpUtilTest","children":["367125e9-f2f7-49d6-8e32-6990805914b3","e2501d8d-ae91-4365-a883-65c121d5a6f0","7c967126-a82a-4da0-92b0-73f30f0abb90","6ff77061-e8ec-4551-a456-93ab9c6ec3ad","39a6455d-be83-48cd-9488-a6cb019d8605","6b625c48-b944-4910-8983-823c2a167d8e","6be1d3be-9d72-45b8-977a-c2d552a6efb9","e3ef6b81-a794-42c3-bfc3-0e657da47624"],"befores":[],"afters":[],"start":1750415258562,"stop":1750415259581} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b902829b-d0f7-4887-9c8a-3da4711442a0-container.json b/hawkbit-security-core/allure-results/b902829b-d0f7-4887-9c8a-3da4711442a0-container.json deleted file mode 100644 index 69fc037a6..000000000 --- a/hawkbit-security-core/allure-results/b902829b-d0f7-4887-9c8a-3da4711442a0-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b902829b-d0f7-4887-9c8a-3da4711442a0","name":"testCreateAmqpUri()","children":["069b7cba-94c0-4c3b-b50b-093ceae56ae9"],"befores":[],"afters":[],"start":1750414806578,"stop":1750414806581} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b910d582-c02a-4fe9-b627-6c2d27aa5cbb-result.json b/hawkbit-security-core/allure-results/b910d582-c02a-4fe9-b627-6c2d27aa5cbb-result.json deleted file mode 100644 index e4597bb01..000000000 --- a/hawkbit-security-core/allure-results/b910d582-c02a-4fe9-b627-6c2d27aa5cbb-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b910d582-c02a-4fe9-b627-6c2d27aa5cbb","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415197469,"stop":1750415197471} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/b94d399e-a2a3-4724-a4ab-20f21e274bf6-result.json b/hawkbit-security-core/allure-results/b94d399e-a2a3-4724-a4ab-20f21e274bf6-result.json deleted file mode 100644 index a19afe0d5..000000000 --- a/hawkbit-security-core/allure-results/b94d399e-a2a3-4724-a4ab-20f21e274bf6-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"b94d399e-a2a3-4724-a4ab-20f21e274bf6","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750414806592,"stop":1750414806595} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bb652b59-9ba7-4a8a-abb0-b817b62fbbf9-result.json b/hawkbit-security-core/allure-results/bb652b59-9ba7-4a8a-abb0-b817b62fbbf9-result.json deleted file mode 100644 index a226c2967..000000000 --- a/hawkbit-security-core/allure-results/bb652b59-9ba7-4a8a-abb0-b817b62fbbf9-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bb652b59-9ba7-4a8a-abb0-b817b62fbbf9","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750415196875,"stop":1750415197435} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bc20a75f-40af-4f04-8e26-4d5683d1b9b1-container.json b/hawkbit-security-core/allure-results/bc20a75f-40af-4f04-8e26-4d5683d1b9b1-container.json deleted file mode 100644 index 5c4e0fa07..000000000 --- a/hawkbit-security-core/allure-results/bc20a75f-40af-4f04-8e26-4d5683d1b9b1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bc20a75f-40af-4f04-8e26-4d5683d1b9b1","name":"IpUtilTest","children":["577f5fe9-7e05-4a99-ab14-70b9008907fa","8099131c-07f3-4cb1-ab5d-a4bab40cc26a","d7be1fa4-0452-4960-bada-b6457976e383","a5e356d3-7d9e-469d-8ec6-6477acbd24e6","24600249-3a55-4c9e-bd80-2f1a68dc8a68","36a8466a-aa54-4b5b-9fc2-90784325ea1f","fa723d6b-c258-43b2-9cfd-61c0588448f5","05448497-b4e2-4e4c-a26b-f1e7a8a3bdca"],"befores":[],"afters":[],"start":1750415894787,"stop":1750415895739} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bd2e4de6-b6b9-45ee-bad5-47beeb796618-result.json b/hawkbit-security-core/allure-results/bd2e4de6-b6b9-45ee-bad5-47beeb796618-result.json deleted file mode 100644 index 4fba87285..000000000 --- a/hawkbit-security-core/allure-results/bd2e4de6-b6b9-45ee-bad5-47beeb796618-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bd2e4de6-b6b9-45ee-bad5-47beeb796618","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750414466526,"stop":1750414466538} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bd7ce21f-8836-4fc1-b614-82ddcfbc7add-result.json b/hawkbit-security-core/allure-results/bd7ce21f-8836-4fc1-b614-82ddcfbc7add-result.json deleted file mode 100644 index b70e2f435..000000000 --- a/hawkbit-security-core/allure-results/bd7ce21f-8836-4fc1-b614-82ddcfbc7add-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bd7ce21f-8836-4fc1-b614-82ddcfbc7add","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415146372,"stop":1750415146375} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bdd0adab-ff04-4b32-b7e1-1f9406722960-container.json b/hawkbit-security-core/allure-results/bdd0adab-ff04-4b32-b7e1-1f9406722960-container.json deleted file mode 100644 index 29e23282d..000000000 --- a/hawkbit-security-core/allure-results/bdd0adab-ff04-4b32-b7e1-1f9406722960-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bdd0adab-ff04-4b32-b7e1-1f9406722960","name":"testResolveClientIpFromHeader()","children":["46783e41-e1a1-4a6c-a00b-380d09ad5077"],"befores":[],"afters":[],"start":1750415121034,"stop":1750415121039} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/be1917fc-757f-4fd6-a3a2-e725a82084d2-container.json b/hawkbit-security-core/allure-results/be1917fc-757f-4fd6-a3a2-e725a82084d2-container.json deleted file mode 100644 index db237b1a8..000000000 --- a/hawkbit-security-core/allure-results/be1917fc-757f-4fd6-a3a2-e725a82084d2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"be1917fc-757f-4fd6-a3a2-e725a82084d2","name":"testCreateAmqpUri()","children":["45c48313-ad73-4948-9959-ab0942d76e84"],"befores":[],"afters":[],"start":1750414973559,"stop":1750414973562} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/bff8c57c-4c8e-4b66-a349-864de57916e5-container.json b/hawkbit-security-core/allure-results/bff8c57c-4c8e-4b66-a349-864de57916e5-container.json deleted file mode 100644 index 5e24196cd..000000000 --- a/hawkbit-security-core/allure-results/bff8c57c-4c8e-4b66-a349-864de57916e5-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"bff8c57c-4c8e-4b66-a349-864de57916e5","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["d6556d50-6dc2-4051-8e33-8e4a00ca62dc"],"befores":[],"afters":[],"start":1750415197471,"stop":1750415197474} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c0f02a85-139a-4c3a-88b9-4b6f8ab57d64-result.json b/hawkbit-security-core/allure-results/c0f02a85-139a-4c3a-88b9-4b6f8ab57d64-result.json deleted file mode 100644 index e5641460f..000000000 --- a/hawkbit-security-core/allure-results/c0f02a85-139a-4c3a-88b9-4b6f8ab57d64-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c0f02a85-139a-4c3a-88b9-4b6f8ab57d64","historyId":"2f229d196adb76b0198338ae9c5ea90a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]","testCaseName":"testCreateAmqpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateAmqpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateAmqpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateAmqpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateAmqpUri()","status":"passed","stage":"finished","description":"Tests create amqp uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750415121040,"stop":1750415121042} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c13e9fbc-6ba5-4311-8798-6f32d4892396-container.json b/hawkbit-security-core/allure-results/c13e9fbc-6ba5-4311-8798-6f32d4892396-container.json deleted file mode 100644 index 0f5775dea..000000000 --- a/hawkbit-security-core/allure-results/c13e9fbc-6ba5-4311-8798-6f32d4892396-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c13e9fbc-6ba5-4311-8798-6f32d4892396","name":"testCreateInvalidUri()","children":["a8765d5b-55ca-4f74-90c7-02755739cda0"],"befores":[],"afters":[],"start":1750415146352,"stop":1750415146358} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c19022ea-0fe0-4248-84d0-3c9d43f8c660-result.json b/hawkbit-security-core/allure-results/c19022ea-0fe0-4248-84d0-3c9d43f8c660-result.json deleted file mode 100644 index 5ae3c7cee..000000000 --- a/hawkbit-security-core/allure-results/c19022ea-0fe0-4248-84d0-3c9d43f8c660-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c19022ea-0fe0-4248-84d0-3c9d43f8c660","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414806574,"stop":1750414806577} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c1b49afc-d384-4112-af06-a7ddab7112ab-container.json b/hawkbit-security-core/allure-results/c1b49afc-d384-4112-af06-a7ddab7112ab-container.json deleted file mode 100644 index c03a25f79..000000000 --- a/hawkbit-security-core/allure-results/c1b49afc-d384-4112-af06-a7ddab7112ab-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c1b49afc-d384-4112-af06-a7ddab7112ab","name":"testCreateHttpUri()","children":["90242adc-89b1-4349-a1f5-513ce053c1d5"],"befores":[],"afters":[],"start":1750415197474,"stop":1750415197476} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c1bab8c8-957f-4521-ab1b-fe293ffbf05c-result.json b/hawkbit-security-core/allure-results/c1bab8c8-957f-4521-ab1b-fe293ffbf05c-result.json deleted file mode 100644 index 39792359f..000000000 --- a/hawkbit-security-core/allure-results/c1bab8c8-957f-4521-ab1b-fe293ffbf05c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c1bab8c8-957f-4521-ab1b-fe293ffbf05c","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750414577001,"stop":1750414577004} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c291213d-e4eb-4240-ba35-34eb26112891-result.json b/hawkbit-security-core/allure-results/c291213d-e4eb-4240-ba35-34eb26112891-result.json deleted file mode 100644 index a4e330c19..000000000 --- a/hawkbit-security-core/allure-results/c291213d-e4eb-4240-ba35-34eb26112891-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c291213d-e4eb-4240-ba35-34eb26112891","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414973566,"stop":1750414973567} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c30386f8-910e-41cb-87a2-9ca127a99043-container.json b/hawkbit-security-core/allure-results/c30386f8-910e-41cb-87a2-9ca127a99043-container.json deleted file mode 100644 index 2ce42167f..000000000 --- a/hawkbit-security-core/allure-results/c30386f8-910e-41cb-87a2-9ca127a99043-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c30386f8-910e-41cb-87a2-9ca127a99043","name":"testCreateClientHttpUri()","children":["cf3330ae-c5ed-476b-bc99-5d69637548f5"],"befores":[],"afters":[],"start":1750415121048,"stop":1750415121053} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c5c6d015-d557-4d1f-8e28-8a535f14f684-result.json b/hawkbit-security-core/allure-results/c5c6d015-d557-4d1f-8e28-8a535f14f684-result.json deleted file mode 100644 index bab80125a..000000000 --- a/hawkbit-security-core/allure-results/c5c6d015-d557-4d1f-8e28-8a535f14f684-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c5c6d015-d557-4d1f-8e28-8a535f14f684","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750414725261,"stop":1750414725263} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c63b4ccb-1dec-433e-a130-fd42df15439f-result.json b/hawkbit-security-core/allure-results/c63b4ccb-1dec-433e-a130-fd42df15439f-result.json deleted file mode 100644 index f0859ad51..000000000 --- a/hawkbit-security-core/allure-results/c63b4ccb-1dec-433e-a130-fd42df15439f-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c63b4ccb-1dec-433e-a130-fd42df15439f","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750415146376,"stop":1750415146380} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c64eff95-189a-4dd5-9571-eba4e7f9457a-result.json b/hawkbit-security-core/allure-results/c64eff95-189a-4dd5-9571-eba4e7f9457a-result.json deleted file mode 100644 index 32d50c9ad..000000000 --- a/hawkbit-security-core/allure-results/c64eff95-189a-4dd5-9571-eba4e7f9457a-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c64eff95-189a-4dd5-9571-eba4e7f9457a","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26188@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750414577024,"stop":1750414577028} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c79a1ca5-32f4-4013-877d-fddfc490c80f-container.json b/hawkbit-security-core/allure-results/c79a1ca5-32f4-4013-877d-fddfc490c80f-container.json deleted file mode 100644 index c83036c92..000000000 --- a/hawkbit-security-core/allure-results/c79a1ca5-32f4-4013-877d-fddfc490c80f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c79a1ca5-32f4-4013-877d-fddfc490c80f","name":"testResolveClientIpFromHeader()","children":["20058e58-4ca8-4949-8a91-e51f7a4f1c60"],"befores":[],"afters":[],"start":1750414466487,"stop":1750414466492} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c8bab49e-3efe-4de0-a73d-8c4b4b6bd363-result.json b/hawkbit-security-core/allure-results/c8bab49e-3efe-4de0-a73d-8c4b4b6bd363-result.json deleted file mode 100644 index fd8d4541d..000000000 --- a/hawkbit-security-core/allure-results/c8bab49e-3efe-4de0-a73d-8c4b4b6bd363-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c8bab49e-3efe-4de0-a73d-8c4b4b6bd363","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750414806570,"stop":1750414806573} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/c8fdd19f-eec1-49f7-a805-b72c1430e375-result.json b/hawkbit-security-core/allure-results/c8fdd19f-eec1-49f7-a805-b72c1430e375-result.json deleted file mode 100644 index 6c7c318dc..000000000 --- a/hawkbit-security-core/allure-results/c8fdd19f-eec1-49f7-a805-b72c1430e375-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"c8fdd19f-eec1-49f7-a805-b72c1430e375","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750414725291,"stop":1750414725297} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ca5e9cff-fa32-4651-a1e5-70fb77eeb77c-result.json b/hawkbit-security-core/allure-results/ca5e9cff-fa32-4651-a1e5-70fb77eeb77c-result.json deleted file mode 100644 index 4abf4d16f..000000000 --- a/hawkbit-security-core/allure-results/ca5e9cff-fa32-4651-a1e5-70fb77eeb77c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ca5e9cff-fa32-4651-a1e5-70fb77eeb77c","historyId":"ba489efbc49a4eb9af7c03a7e3e2b4b4","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]","testCaseName":"getRemoteAddrFromXForwardedForHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromXForwardedForHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromXForwardedForHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromXForwardedForHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromXForwardedForHeader()","status":"passed","stage":"finished","description":"Tests create uri from x forward header","steps":[],"attachments":[],"parameters":[],"start":1750415145770,"stop":1750415146329} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/cad6de8c-6cde-4f6f-8743-da271ffeeaa7-container.json b/hawkbit-security-core/allure-results/cad6de8c-6cde-4f6f-8743-da271ffeeaa7-container.json deleted file mode 100644 index 0add06b14..000000000 --- a/hawkbit-security-core/allure-results/cad6de8c-6cde-4f6f-8743-da271ffeeaa7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"cad6de8c-6cde-4f6f-8743-da271ffeeaa7","name":"SpPermissionTest","children":["bd2e4de6-b6b9-45ee-bad5-47beeb796618"],"befores":[],"afters":[],"start":1750414466524,"stop":1750414466540} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/cc3f35f9-9864-487a-9e12-6eabd531f4aa-result.json b/hawkbit-security-core/allure-results/cc3f35f9-9864-487a-9e12-6eabd531f4aa-result.json deleted file mode 100644 index ff5361489..000000000 --- a/hawkbit-security-core/allure-results/cc3f35f9-9864-487a-9e12-6eabd531f4aa-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"cc3f35f9-9864-487a-9e12-6eabd531f4aa","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750415259583,"stop":1750415259596} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ce764dc4-d3dc-45af-9a80-aca51378da23-result.json b/hawkbit-security-core/allure-results/ce764dc4-d3dc-45af-9a80-aca51378da23-result.json deleted file mode 100644 index 421c20321..000000000 --- a/hawkbit-security-core/allure-results/ce764dc4-d3dc-45af-9a80-aca51378da23-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ce764dc4-d3dc-45af-9a80-aca51378da23","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750415197482,"stop":1750415197485} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/cf3330ae-c5ed-476b-bc99-5d69637548f5-result.json b/hawkbit-security-core/allure-results/cf3330ae-c5ed-476b-bc99-5d69637548f5-result.json deleted file mode 100644 index 4e762805b..000000000 --- a/hawkbit-security-core/allure-results/cf3330ae-c5ed-476b-bc99-5d69637548f5-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"cf3330ae-c5ed-476b-bc99-5d69637548f5","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28462@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415121049,"stop":1750415121052} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/cfe76e19-f88d-42e3-bc83-eaf1533d2c54-result.json b/hawkbit-security-core/allure-results/cfe76e19-f88d-42e3-bc83-eaf1533d2c54-result.json deleted file mode 100644 index df7b3e0bd..000000000 --- a/hawkbit-security-core/allure-results/cfe76e19-f88d-42e3-bc83-eaf1533d2c54-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"cfe76e19-f88d-42e3-bc83-eaf1533d2c54","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414466500,"stop":1750414466501} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d0b4a60e-f92b-4663-acbc-0e68b5743fd7-result.json b/hawkbit-security-core/allure-results/d0b4a60e-f92b-4663-acbc-0e68b5743fd7-result.json deleted file mode 100644 index 26492d7ae..000000000 --- a/hawkbit-security-core/allure-results/d0b4a60e-f92b-4663-acbc-0e68b5743fd7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d0b4a60e-f92b-4663-acbc-0e68b5743fd7","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750415197460,"stop":1750415197463} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d1188494-a7af-4bfd-895f-19765e4d81bc-container.json b/hawkbit-security-core/allure-results/d1188494-a7af-4bfd-895f-19765e4d81bc-container.json deleted file mode 100644 index 8ada5d811..000000000 --- a/hawkbit-security-core/allure-results/d1188494-a7af-4bfd-895f-19765e4d81bc-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d1188494-a7af-4bfd-895f-19765e4d81bc","name":"testCreateHttpUri()","children":["288da849-6474-4214-9cda-b425ceecf7b9"],"befores":[],"afters":[],"start":1750415121046,"stop":1750415121048} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d1335aae-80b3-4657-9336-5e3f06d11772-container.json b/hawkbit-security-core/allure-results/d1335aae-80b3-4657-9336-5e3f06d11772-container.json deleted file mode 100644 index a2b68c227..000000000 --- a/hawkbit-security-core/allure-results/d1335aae-80b3-4657-9336-5e3f06d11772-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d1335aae-80b3-4657-9336-5e3f06d11772","name":"testCreateInvalidUri()","children":["c1bab8c8-957f-4521-ab1b-fe293ffbf05c"],"befores":[],"afters":[],"start":1750414576999,"stop":1750414577004} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d1b3bb95-8331-4c1e-9316-1d16a599650a-container.json b/hawkbit-security-core/allure-results/d1b3bb95-8331-4c1e-9316-1d16a599650a-container.json deleted file mode 100644 index 584b3fd38..000000000 --- a/hawkbit-security-core/allure-results/d1b3bb95-8331-4c1e-9316-1d16a599650a-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d1b3bb95-8331-4c1e-9316-1d16a599650a","name":"IpUtilTest","children":["8a04b45a-4f03-4b81-bfc6-2ca150e83a56","897f9bc0-038f-47e1-a4bd-664e3f61b629","a40734f3-d2dd-4164-af09-701fd2351ae9","45c48313-ad73-4948-9959-ab0942d76e84","0dedb88b-a3cf-4731-9d2f-5dc8fd17de88","c291213d-e4eb-4240-ba35-34eb26112891","f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4","5b1fa1c9-d4ca-4649-bbf0-063b4e4fd0a0"],"befores":[],"afters":[],"start":1750414972937,"stop":1750414973579} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d252e357-a7e2-4cf2-8ba2-67638cc7841e-result.json b/hawkbit-security-core/allure-results/d252e357-a7e2-4cf2-8ba2-67638cc7841e-result.json deleted file mode 100644 index 8e933600c..000000000 --- a/hawkbit-security-core/allure-results/d252e357-a7e2-4cf2-8ba2-67638cc7841e-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d252e357-a7e2-4cf2-8ba2-67638cc7841e","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"26765@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414725278,"stop":1750414725282} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d300f51f-beee-42d0-a6bb-050de2fd2dac-container.json b/hawkbit-security-core/allure-results/d300f51f-beee-42d0-a6bb-050de2fd2dac-container.json deleted file mode 100644 index 9a48947d4..000000000 --- a/hawkbit-security-core/allure-results/d300f51f-beee-42d0-a6bb-050de2fd2dac-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d300f51f-beee-42d0-a6bb-050de2fd2dac","name":"maskRemoteAddrIfDisabled()","children":["e3ef6b81-a794-42c3-bfc3-0e657da47624"],"befores":[],"afters":[],"start":1750415259572,"stop":1750415259578} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d3612235-33ae-4bc0-ab03-f0e081ed2229-container.json b/hawkbit-security-core/allure-results/d3612235-33ae-4bc0-ab03-f0e081ed2229-container.json deleted file mode 100644 index a015f0109..000000000 --- a/hawkbit-security-core/allure-results/d3612235-33ae-4bc0-ab03-f0e081ed2229-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d3612235-33ae-4bc0-ab03-f0e081ed2229","name":"testCreateAmqpUri()","children":["04339643-b07e-44be-9127-20df5e4ec5b6"],"befores":[],"afters":[],"start":1750415146363,"stop":1750415146366} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d41734d7-90c1-4b32-ab87-34d3bf6ffdf7-container.json b/hawkbit-security-core/allure-results/d41734d7-90c1-4b32-ab87-34d3bf6ffdf7-container.json deleted file mode 100644 index 9dbd76023..000000000 --- a/hawkbit-security-core/allure-results/d41734d7-90c1-4b32-ab87-34d3bf6ffdf7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d41734d7-90c1-4b32-ab87-34d3bf6ffdf7","name":"testCreateHttpUri()","children":["00cef5c6-1901-431a-ad53-68e5eed7eecd"],"befores":[],"afters":[],"start":1750414577016,"stop":1750414577018} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d4f5378c-2507-4a44-90c4-3b6540cda847-container.json b/hawkbit-security-core/allure-results/d4f5378c-2507-4a44-90c4-3b6540cda847-container.json deleted file mode 100644 index ddbc7f968..000000000 --- a/hawkbit-security-core/allure-results/d4f5378c-2507-4a44-90c4-3b6540cda847-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d4f5378c-2507-4a44-90c4-3b6540cda847","name":"getRemoteAddrFromXForwardedForHeader()","children":["7393f789-f197-4456-a5dd-ae514c43c9d5"],"befores":[],"afters":[],"start":1750414465878,"stop":1750414466478} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d532646e-3352-4896-8cce-1428a1d75998-container.json b/hawkbit-security-core/allure-results/d532646e-3352-4896-8cce-1428a1d75998-container.json deleted file mode 100644 index 31aa31e3e..000000000 --- a/hawkbit-security-core/allure-results/d532646e-3352-4896-8cce-1428a1d75998-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d532646e-3352-4896-8cce-1428a1d75998","name":"testCreateAmqpUri()","children":["6a505c5f-cede-4b62-9f03-cb66907e5787"],"befores":[],"afters":[],"start":1750414725269,"stop":1750414725271} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d6556d50-6dc2-4051-8e33-8e4a00ca62dc-result.json b/hawkbit-security-core/allure-results/d6556d50-6dc2-4051-8e33-8e4a00ca62dc-result.json deleted file mode 100644 index 4dcb4ce37..000000000 --- a/hawkbit-security-core/allure-results/d6556d50-6dc2-4051-8e33-8e4a00ca62dc-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d6556d50-6dc2-4051-8e33-8e4a00ca62dc","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28844@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415197472,"stop":1750415197473} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/d7be1fa4-0452-4960-bada-b6457976e383-result.json b/hawkbit-security-core/allure-results/d7be1fa4-0452-4960-bada-b6457976e383-result.json deleted file mode 100644 index d990ebf6f..000000000 --- a/hawkbit-security-core/allure-results/d7be1fa4-0452-4960-bada-b6457976e383-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"d7be1fa4-0452-4960-bada-b6457976e383","historyId":"5d2387e9e8884e462aa189b94d0933c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]","testCaseName":"testResolveClientIpFromHeader()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testResolveClientIpFromHeader","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testResolveClientIpFromHeader()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testResolveClientIpFromHeader"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testResolveClientIpFromHeader()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415895709,"stop":1750415895713} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ddb7b828-c0f5-4861-b1a0-b5acab5bdea6-container.json b/hawkbit-security-core/allure-results/ddb7b828-c0f5-4861-b1a0-b5acab5bdea6-container.json deleted file mode 100644 index eec7251cc..000000000 --- a/hawkbit-security-core/allure-results/ddb7b828-c0f5-4861-b1a0-b5acab5bdea6-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ddb7b828-c0f5-4861-b1a0-b5acab5bdea6","name":"maskRemoteAddrIfDisabled()","children":["c64eff95-189a-4dd5-9571-eba4e7f9457a"],"befores":[],"afters":[],"start":1750414577023,"stop":1750414577028} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e08511dc-4e63-4498-b3bc-5bff411c4efa-container.json b/hawkbit-security-core/allure-results/e08511dc-4e63-4498-b3bc-5bff411c4efa-container.json deleted file mode 100644 index c90c6f4dd..000000000 --- a/hawkbit-security-core/allure-results/e08511dc-4e63-4498-b3bc-5bff411c4efa-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e08511dc-4e63-4498-b3bc-5bff411c4efa","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["793a6407-39c3-4ff4-a4b8-3b44b9fdfbef"],"befores":[],"afters":[],"start":1750414577013,"stop":1750414577016} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e2318b7f-dd92-43c4-b975-b145913db907-result.json b/hawkbit-security-core/allure-results/e2318b7f-dd92-43c4-b975-b145913db907-result.json deleted file mode 100644 index 0c5d3c102..000000000 --- a/hawkbit-security-core/allure-results/e2318b7f-dd92-43c4-b975-b145913db907-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e2318b7f-dd92-43c4-b975-b145913db907","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"25733@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750414466484,"stop":1750414466486} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e2501d8d-ae91-4365-a883-65c121d5a6f0-result.json b/hawkbit-security-core/allure-results/e2501d8d-ae91-4365-a883-65c121d5a6f0-result.json deleted file mode 100644 index 5d55a3ce4..000000000 --- a/hawkbit-security-core/allure-results/e2501d8d-ae91-4365-a883-65c121d5a6f0-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e2501d8d-ae91-4365-a883-65c121d5a6f0","historyId":"ed91b85f570ac4290658a34c2345401a","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]","testCaseName":"testCreateInvalidUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateInvalidUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateInvalidUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateInvalidUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateInvalidUri()","status":"passed","stage":"finished","description":"Tests create invalid uri","steps":[],"attachments":[],"parameters":[],"start":1750415259544,"stop":1750415259550} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e3ef6b81-a794-42c3-bfc3-0e657da47624-result.json b/hawkbit-security-core/allure-results/e3ef6b81-a794-42c3-bfc3-0e657da47624-result.json deleted file mode 100644 index 0db5f2956..000000000 --- a/hawkbit-security-core/allure-results/e3ef6b81-a794-42c3-bfc3-0e657da47624-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e3ef6b81-a794-42c3-bfc3-0e657da47624","historyId":"b1cb8caaf6f4288876e2d01a7ac2c9bd","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]","testCaseName":"maskRemoteAddrIfDisabled()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.maskRemoteAddrIfDisabled","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:maskRemoteAddrIfDisabled()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"29148@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"maskRemoteAddrIfDisabled"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"maskRemoteAddrIfDisabled()","status":"passed","stage":"finished","description":"Tests create uri from request with masked IP when IP tracking is disabled","steps":[],"attachments":[],"parameters":[],"start":1750415259573,"stop":1750415259577} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e4b1797f-8343-4732-98c5-38abbd92797a-result.json b/hawkbit-security-core/allure-results/e4b1797f-8343-4732-98c5-38abbd92797a-result.json deleted file mode 100644 index d2a9fb3ee..000000000 --- a/hawkbit-security-core/allure-results/e4b1797f-8343-4732-98c5-38abbd92797a-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e4b1797f-8343-4732-98c5-38abbd92797a","historyId":"3e7fd50f7a49fb858cdb43ab6c75cd1d","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]","testCaseName":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.getRemoteAddrFromRequestIfForwardedHeaderNotPresent","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:getRemoteAddrFromRequestIfForwardedHeaderNotPresent()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"28603@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","status":"passed","stage":"finished","description":"Tests create uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415146367,"stop":1750415146368} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e506e23a-e803-4870-9df8-1c589a708f5c-container.json b/hawkbit-security-core/allure-results/e506e23a-e803-4870-9df8-1c589a708f5c-container.json deleted file mode 100644 index 35d5e0db1..000000000 --- a/hawkbit-security-core/allure-results/e506e23a-e803-4870-9df8-1c589a708f5c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e506e23a-e803-4870-9df8-1c589a708f5c","name":"getRemoteAddrFromRequestIfForwardedHeaderNotPresent()","children":["24600249-3a55-4c9e-bd80-2f1a68dc8a68"],"befores":[],"afters":[],"start":1750415895717,"stop":1750415895720} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e78e1d4e-536a-474a-b31d-b931334d94a7-result.json b/hawkbit-security-core/allure-results/e78e1d4e-536a-474a-b31d-b931334d94a7-result.json deleted file mode 100644 index 787de8d4a..000000000 --- a/hawkbit-security-core/allure-results/e78e1d4e-536a-474a-b31d-b931334d94a7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e78e1d4e-536a-474a-b31d-b931334d94a7","historyId":"24f526478c006a131369f2ba887dec4c","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]","testCaseName":"shouldReturnAllPermissions()","fullName":"org.eclipse.hawkbit.im.authentication.SpPermissionTest.shouldReturnAllPermissions","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.im.authentication.SpPermissionTest]/[method:shouldReturnAllPermissions()]"},{"name":"story","value":"Permission Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testClass","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"},{"name":"testMethod","value":"shouldReturnAllPermissions"},{"name":"suite","value":"org.eclipse.hawkbit.im.authentication.SpPermissionTest"}],"links":[],"name":"shouldReturnAllPermissions()","status":"passed","stage":"finished","description":"Try to double check if all permissions works as expected","steps":[],"attachments":[],"parameters":[],"start":1750415895741,"stop":1750415895753} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e8c23634-1884-4026-bcc1-b57c5368e48f-container.json b/hawkbit-security-core/allure-results/e8c23634-1884-4026-bcc1-b57c5368e48f-container.json deleted file mode 100644 index c5737197e..000000000 --- a/hawkbit-security-core/allure-results/e8c23634-1884-4026-bcc1-b57c5368e48f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e8c23634-1884-4026-bcc1-b57c5368e48f","name":"getRemoteAddrFromXForwardedForHeader()","children":["899a4e5b-266c-4e81-a8e3-fe8c67c20927"],"befores":[],"afters":[],"start":1750414805998,"stop":1750414806564} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e9929cad-232b-4090-a4e3-3d4a8363bac7-container.json b/hawkbit-security-core/allure-results/e9929cad-232b-4090-a4e3-3d4a8363bac7-container.json deleted file mode 100644 index bd3c62541..000000000 --- a/hawkbit-security-core/allure-results/e9929cad-232b-4090-a4e3-3d4a8363bac7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e9929cad-232b-4090-a4e3-3d4a8363bac7","name":"testCreateClientHttpUri()","children":["d252e357-a7e2-4cf2-8ba2-67638cc7841e"],"befores":[],"afters":[],"start":1750414725278,"stop":1750414725282} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d-result.json b/hawkbit-security-core/allure-results/e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d-result.json deleted file mode 100644 index f43aaa155..000000000 --- a/hawkbit-security-core/allure-results/e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"e9ae85f5-de73-47e3-8d8c-d3dc8e564d1d","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414806587,"stop":1750414806590} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ea796ea6-e461-42bd-84c4-86af1971750c-result.json b/hawkbit-security-core/allure-results/ea796ea6-e461-42bd-84c4-86af1971750c-result.json deleted file mode 100644 index ed9286250..000000000 --- a/hawkbit-security-core/allure-results/ea796ea6-e461-42bd-84c4-86af1971750c-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ea796ea6-e461-42bd-84c4-86af1971750c","historyId":"a883cf2c85004ef24f804d7c0ee060ca","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]","testCaseName":"testCreateHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27245@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateHttpUri()","status":"passed","stage":"finished","description":"Tests create http uri ipv4 and ipv6","steps":[],"attachments":[],"parameters":[],"start":1750414806584,"stop":1750414806585} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ec5b27d8-1b67-4e6b-b18d-61bd7c9aee3f-container.json b/hawkbit-security-core/allure-results/ec5b27d8-1b67-4e6b-b18d-61bd7c9aee3f-container.json deleted file mode 100644 index e1773040c..000000000 --- a/hawkbit-security-core/allure-results/ec5b27d8-1b67-4e6b-b18d-61bd7c9aee3f-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ec5b27d8-1b67-4e6b-b18d-61bd7c9aee3f","name":"testCreateHttpUri()","children":["ea796ea6-e461-42bd-84c4-86af1971750c"],"befores":[],"afters":[],"start":1750414806584,"stop":1750414806586} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/f328f15b-c86c-41fd-a251-8fe9b2c07475-container.json b/hawkbit-security-core/allure-results/f328f15b-c86c-41fd-a251-8fe9b2c07475-container.json deleted file mode 100644 index 50318558c..000000000 --- a/hawkbit-security-core/allure-results/f328f15b-c86c-41fd-a251-8fe9b2c07475-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"f328f15b-c86c-41fd-a251-8fe9b2c07475","name":"maskRemoteAddrIfDisabled()","children":["ce764dc4-d3dc-45af-9a80-aca51378da23"],"befores":[],"afters":[],"start":1750415197481,"stop":1750415197485} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/f8509304-24a5-446d-baf3-389b875541ae-container.json b/hawkbit-security-core/allure-results/f8509304-24a5-446d-baf3-389b875541ae-container.json deleted file mode 100644 index 22a5f409c..000000000 --- a/hawkbit-security-core/allure-results/f8509304-24a5-446d-baf3-389b875541ae-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"f8509304-24a5-446d-baf3-389b875541ae","name":"maskRemoteAddrIfDisabled()","children":["b94d399e-a2a3-4724-a4ab-20f21e274bf6"],"befores":[],"afters":[],"start":1750414806591,"stop":1750414806596} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4-result.json b/hawkbit-security-core/allure-results/f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4-result.json deleted file mode 100644 index b7924342b..000000000 --- a/hawkbit-security-core/allure-results/f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"f8f0edb6-b5d6-4f4d-9e7c-b63642fea5c4","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"27877@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750414973568,"stop":1750414973572} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/f9451670-007e-48c3-9b5c-2e041d65209b-container.json b/hawkbit-security-core/allure-results/f9451670-007e-48c3-9b5c-2e041d65209b-container.json deleted file mode 100644 index 013094220..000000000 --- a/hawkbit-security-core/allure-results/f9451670-007e-48c3-9b5c-2e041d65209b-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"f9451670-007e-48c3-9b5c-2e041d65209b","name":"getRemoteAddrFromXForwardedForHeader()","children":["367125e9-f2f7-49d6-8e32-6990805914b3"],"befores":[],"afters":[],"start":1750415258571,"stop":1750415259537} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/fa723d6b-c258-43b2-9cfd-61c0588448f5-result.json b/hawkbit-security-core/allure-results/fa723d6b-c258-43b2-9cfd-61c0588448f5-result.json deleted file mode 100644 index 16887ba28..000000000 --- a/hawkbit-security-core/allure-results/fa723d6b-c258-43b2-9cfd-61c0588448f5-result.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"fa723d6b-c258-43b2-9cfd-61c0588448f5","historyId":"60b178834f4c7c796615adabdc7c7497","testCaseId":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]","testCaseName":"testCreateClientHttpUri()","fullName":"org.eclipse.hawkbit.util.IpUtilTest.testCreateClientHttpUri","labels":[{"name":"junit.platform.uniqueid","value":"[engine:junit-jupiter]/[class:org.eclipse.hawkbit.util.IpUtilTest]/[method:testCreateClientHttpUri()]"},{"name":"story","value":"IP Util Test"},{"name":"feature","value":"Unit Tests - Security"},{"name":"host","value":"SF3-C-000FP"},{"name":"thread","value":"31633@SF3-C-000FP.main(1)"},{"name":"framework","value":"junit-platform"},{"name":"language","value":"java"},{"name":"package","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testClass","value":"org.eclipse.hawkbit.util.IpUtilTest"},{"name":"testMethod","value":"testCreateClientHttpUri"},{"name":"suite","value":"org.eclipse.hawkbit.util.IpUtilTest"}],"links":[],"name":"testCreateClientHttpUri()","status":"passed","stage":"finished","description":"Tests client uri from request","steps":[],"attachments":[],"parameters":[],"start":1750415895725,"stop":1750415895729} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/fc185157-9b99-47e2-bfa4-d673364346c1-container.json b/hawkbit-security-core/allure-results/fc185157-9b99-47e2-bfa4-d673364346c1-container.json deleted file mode 100644 index 69d53772c..000000000 --- a/hawkbit-security-core/allure-results/fc185157-9b99-47e2-bfa4-d673364346c1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"fc185157-9b99-47e2-bfa4-d673364346c1","name":"testCreateAmqpUri()","children":["87049cd6-8430-49e0-9f53-fb61937ae380"],"befores":[],"afters":[],"start":1750414466492,"stop":1750414466495} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/fe89ca1a-1724-4cd8-a67c-3b1803307e0c-container.json b/hawkbit-security-core/allure-results/fe89ca1a-1724-4cd8-a67c-3b1803307e0c-container.json deleted file mode 100644 index c4b9a00ac..000000000 --- a/hawkbit-security-core/allure-results/fe89ca1a-1724-4cd8-a67c-3b1803307e0c-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"fe89ca1a-1724-4cd8-a67c-3b1803307e0c","name":"shouldReturnAllPermissions()","children":["801ee71c-963e-4ea9-a37b-a54f8628c041"],"befores":[],"afters":[],"start":1750414806599,"stop":1750414806606} \ No newline at end of file diff --git a/hawkbit-security-core/allure-results/ff3fcabe-affd-4572-9ab8-11b7c3fc3144-container.json b/hawkbit-security-core/allure-results/ff3fcabe-affd-4572-9ab8-11b7c3fc3144-container.json deleted file mode 100644 index 292ffa3f3..000000000 --- a/hawkbit-security-core/allure-results/ff3fcabe-affd-4572-9ab8-11b7c3fc3144-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid":"ff3fcabe-affd-4572-9ab8-11b7c3fc3144","name":"SpPermissionTest","children":["7ff778f3-cae6-404b-a987-83d212178c20"],"befores":[],"afters":[],"start":1750415121061,"stop":1750415121069} \ No newline at end of file diff --git a/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/im/authentication/SpPermissionTest.java b/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/im/authentication/SpPermissionTest.java index 965c9a19c..85692cfd8 100644 --- a/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/im/authentication/SpPermissionTest.java +++ b/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/im/authentication/SpPermissionTest.java @@ -15,22 +15,21 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.junit.jupiter.api.Test; import org.springframework.util.ReflectionUtils; /** * Test {@link SpPermission}. + *

+ * Feature: Unit Tests - Security
+ * Story: Permission Test */ -@Feature("Unit Tests - Security") -@Story("Permission Test") final class SpPermissionTest { - @Test - @Description("Try to double check if all permissions works as expected") - void shouldReturnAllPermissions() { + /** + * Try to double check if all permissions works as expected + */ + @Test void shouldReturnAllPermissions() { List expected = new LinkedList<>(); ReflectionUtils.doWithFields(SpPermission.class, f -> { if (ReflectionUtils.isPublicStaticFinal(f) && String.class.equals(f.getType())) { diff --git a/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/util/IpUtilTest.java b/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/util/IpUtilTest.java index 071c180a9..abdb1fcdf 100644 --- a/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/util/IpUtilTest.java +++ b/hawkbit-security-core/src/test/java/org/eclipse/hawkbit/util/IpUtilTest.java @@ -19,9 +19,6 @@ import java.net.URI; import jakarta.servlet.http.HttpServletRequest; -import io.qameta.allure.Description; -import io.qameta.allure.Feature; -import io.qameta.allure.Story; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.security.HawkbitSecurityProperties.Clients; import org.junit.jupiter.api.Assertions; @@ -31,8 +28,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) -@Feature("Unit Tests - Security") -@Story("IP Util Test") +/** + * Feature: Unit Tests - Security
+ * Story: IP Util Test + */ class IpUtilTest { private static final String X_FORWARDED_FOR = HawkbitSecurityProperties.Clients.X_FORWARDED_FOR; @@ -47,9 +46,10 @@ class IpUtilTest { @Mock private HawkbitSecurityProperties securityPropertyMock; - @Test - @Description("Tests create uri from request") - void getRemoteAddrFromRequestIfForwardedHeaderNotPresent() { + /** + * Tests create uri from request + */ + @Test void getRemoteAddrFromRequestIfForwardedHeaderNotPresent() { final URI knownRemoteClientIP = IpUtil.createHttpUri("127.0.0.1"); when(requestMock.getRemoteAddr()).thenReturn(knownRemoteClientIP.getHost()); @@ -62,9 +62,10 @@ class IpUtilTest { verify(requestMock, times(1)).getRemoteAddr(); } - @Test - @Description("Tests create uri from request with masked IP when IP tracking is disabled") - void maskRemoteAddrIfDisabled() { + /** + * Tests create uri from request with masked IP when IP tracking is disabled + */ + @Test void maskRemoteAddrIfDisabled() { final URI knownRemoteClientIP = IpUtil.createHttpUri("***"); when(securityPropertyMock.getClients()).thenReturn(clientMock); when(clientMock.getRemoteIpHeader()).thenReturn(KNOWN_REQUEST_HEADER); @@ -78,9 +79,10 @@ class IpUtilTest { verify(requestMock, times(0)).getRemoteAddr(); } - @Test - @Description("Tests create uri from x forward header") - void getRemoteAddrFromXForwardedForHeader() { + /** + * Tests create uri from x forward header + */ + @Test void getRemoteAddrFromXForwardedForHeader() { final URI knownRemoteClientIP = IpUtil.createHttpUri("10.99.99.1"); when(requestMock.getHeader(X_FORWARDED_FOR)).thenReturn(knownRemoteClientIP.getHost()); @@ -92,9 +94,10 @@ class IpUtilTest { verify(requestMock, times(0)).getRemoteAddr(); } - @Test - @Description("Tests client uri from request") - void testCreateClientHttpUri() { + /** + * Tests client uri from request + */ + @Test void testCreateClientHttpUri() { checkHostInfoResolution("0:0:0:0:0:0:0:1", "[0:0:0:0:0:0:0:1]", true); checkHostInfoResolution("127.0.0.1", "127.0.0.1", true); checkHostInfoResolution("127.0.0.1:93493", "127.0.0.1", true); @@ -105,9 +108,10 @@ class IpUtilTest { checkHostInfoResolution("[0:0:0:0:0:0:0:1]:4233", "[0:0:0:0:0:0:0:1]", true); } - @Test - @Description("Tests client uri from request") - void testResolveClientIpFromHeader() { + /** + * Tests client uri from request + */ + @Test void testResolveClientIpFromHeader() { checkHostInfoResolution("0:0:0:0:0:0:0:1", "[0:0:0:0:0:0:0:1]", false); checkHostInfoResolution("127.0.0.1", "127.0.0.1", false); checkHostInfoResolution("127.0.0.1:93493", "127.0.0.1", false); @@ -115,9 +119,10 @@ class IpUtilTest { checkHostInfoResolution("[0:0:0:0:0:0:0:1]:4233", "[0:0:0:0:0:0:0:1]", false); } - @Test - @Description("Tests create http uri ipv4 and ipv6") - void testCreateHttpUri() { + /** + * Tests create http uri ipv4 and ipv6 + */ + @Test void testCreateHttpUri() { final String ipv4 = "10.99.99.1"; URI httpUri = IpUtil.createHttpUri(ipv4); assertHttpUri(ipv4, httpUri); @@ -131,9 +136,10 @@ class IpUtilTest { assertHttpUri("[" + ipv6 + "]", httpUri); } - @Test - @Description("Tests create amqp uri ipv4 and ipv6") - void testCreateAmqpUri() { + /** + * Tests create amqp uri ipv4 and ipv6 + */ + @Test void testCreateAmqpUri() { final String ipv4 = "10.99.99.1"; URI amqpUri = IpUtil.createAmqpUri(ipv4, "path"); assertAmqpUri(ipv4, amqpUri); @@ -158,9 +164,10 @@ class IpUtilTest { assertAmqpUri(ipv6Braces, amqpUri); } - @Test - @Description("Tests create invalid uri") - void testCreateInvalidUri() { + /** + * Tests create invalid uri + */ + @Test void testCreateInvalidUri() { final String host = "10.99.99.1"; final URI testUri = IpUtil.createUri("test", host); diff --git a/pom.xml b/pom.xml index 1417c7ce0..a66699c77 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,6 @@ 5.4.0 4.8.179 - 2.29.1 4.3.0 @@ -217,13 +216,6 @@ spring-boot-starter-test test - - io.qameta.allure - allure-junit5 - ${allure.version} - runtime - true -