[MAGNOLIA-8358] JUnit5 extensions for importing repository content Created: 22/Mar/22  Updated: 03/Jan/23  Resolved: 03/Jan/23

Status: Closed
Project: Magnolia
Component/s: testing
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Michael Duerig Assignee: Michael Duerig
Resolution: Obsolete Votes: 0
Labels: foundation_team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:
Epic Link: Basic JUnit 5
Team: Foundation

 Description   

Implement a JUnit5 extensions for importing content into the repository prior to running a test. The extensions should allow to specify

  • the content to import (from a file, literal or from a resource)
  • the paths to import from and to
  • the target workspace
  • the import behaviour for UUIDs

The extension should make an effort to delete the content imported after the test concluded.

Implementation notes

  • Consider using info.magnolia.importexport.DataTransporter for importing
  • Update the documentation in magnolia-junit5-extensions.adoc

 



 Comments   
Comment by Christoph Meier [ 26/Dec/22 ]

mduerig - is this still relevant?
We have the @Cleanup - which is doing what is described in the summary of this ticket.

What other repo-content should be imported with a JUnit5 extension?
OK - we have no norsu-content - for which the import-support in testing-context just has started ... but there the big majority - I actually think all - of INT- or e2e-tests are done with cucumber - where we cannot use JUnit5 extension

Comment by Michael Duerig [ 02/Jan/23 ]

cmeier currently we still use the DataTransporter class for manually importing content in quite a few places. E.g. here. If the @Fixture and @Cleanup extensions cover (most) of these cases we can resolve this ticket as outdated. Otherwise it might make sense to adjust the requirements so we don't end up with multiple annotations for (nearly) the same thing.

Comment by Christoph Meier [ 03/Jan/23 ]

mduerig , I think we can close it as outdated.

As you said - Fixture and Cleanup do the job for Junit5-tests. 
In cucumber / saas world we use other mechanisme or still need to implement - but with quite different requirements.

Close it  

Comment by Michael Duerig [ 03/Jan/23 ]

Closing as per cmeier comment: https://jira.magnolia-cms.com/browse/MAGNOLIA-8358?focusedId=336600&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-336600

Generated at Mon Feb 12 04:32:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.