Разница между каждой аннотацией:
+-------------------------------------------------------------------------------------------------------+
¦ Feature ¦ Junit 4 ¦ Junit 5 ¦
¦--------------------------------------------------------------------------+--------------+-------------¦
¦ Execute before all test methods of the class are executed. ¦ @BeforeClass ¦ @BeforeAll ¦
¦ Used with static method. ¦ ¦ ¦
¦ For example, This method could contain some initialization code ¦ ¦ ¦
¦-------------------------------------------------------------------------------------------------------¦
¦ Execute after all test methods in the current class. ¦ @AfterClass ¦ @AfterAll ¦
¦ Used with static method. ¦ ¦ ¦
¦ For example, This method could contain some cleanup code. ¦ ¦ ¦
¦-------------------------------------------------------------------------------------------------------¦
¦ Execute before each test method. ¦ @Before ¦ @BeforeEach ¦
¦ Used with non-static method. ¦ ¦ ¦
¦ For example, to reinitialize some class attributes used by the methods. ¦ ¦ ¦
¦-------------------------------------------------------------------------------------------------------¦
¦ Execute after each test method. ¦ @After ¦ @AfterEach ¦
¦ Used with non-static method. ¦ ¦ ¦
¦ For example, to roll back database modifications. ¦ ¦ ¦
+-------------------------------------------------------------------------------------------------------+
Большая часть аннотаций в обеих версиях одинакова, но мало чем отличается.
Порядок выполнения.
Пунктирная рамка -> необязательная аннотация.
Вы можете подключиться к любому из этих событий: https://www.progress.com/documentation/sitefinity-cms/for-developers-dynamic-modules-events
, например. IDynamicContentUpdatingEvent или IDynamicContentUpdatedEvent и выполнить свою логику.
Будьте внимательны, поскольку эти события могут срабатывать несколько раз, один раз для предмета Temp и снова для предмета Master, так что вы можете проверить это.