[MGNLTEST-27] Remove rest-services usage in MagnoliaRestClient Created: 26/Jun/20  Updated: 22/Oct/21  Resolved: 22/Oct/21

Status: Closed
Project: Magnolia Test Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.3

Type: Improvement Priority: Neutral
Reporter: Rishab Dhar Assignee: Michael Duerig
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLTEST-1 Attempt to extract the integration te... Closed
dependency
depends upon MGNLTEST-175 SaaS Integration Tests with the Test ... In Progress
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:
Epic Link: core-TF-features-bugs-improvements
Story Points: 3

 Description   

Background

During the extraction of the test-framework in MGNLCE-208 it was discovered that MagnoliaRestClient has public APIs that bring dependency to rest-services module which is not desired. For now in the extraction effort these APIs are deprecated, and in a future effort these APIs should be completely removed and the rest-services module dependency dropped.

Here is a comment from Mikaël Geljić on the PR.

These #readNode and #readProperty methods are not used in the context of the new test-framework.
Our main goal in porting MagnoliaRestClient over here is to keep supporting fixtures/cleanup. In fact, we could almost prune everything else.
The problem with these two methods in particular is that they return the original implementation types RepositoryNode & Property from rest-services module API, whereas we should be as much independent as possible here, so we can remove the maven dependency to rest-services as well. Modules will consume test-framework, not the other way around. (Worst case we can use a more primitive (map?) representation if needed).

Improvement Suggestions

Replace the rest-services usage in readNode/readProperty APIs of MagnoliaRestClient using REST delivery & REST-assured.



 Comments   
Comment by Mikaël Geljić [ 17/Sep/21 ]

We can consider it done actually, via MGNLREST-143, which landed in TF 1.1.0.

Introduce generic MagnoliaRestClient#getNode and #getProperty replacing #readNode and #readProperty, respectively. MGNLTEST-143

As stated in the description, deprecations have been in place since test-framework extraction/inception (MGNLTEST-1), so all that's left is the removal, which may intervene as early as we bump master to 2.0 (foreseen with support of external instances, still on feature branch).

Comment by Michael Duerig [ 01/Oct/21 ]
  • Add MagnoliaRestClient.readNode and MagnoliaRestClient.readProperty methods that allow specifying the entity type for the return value.
  • Add an additional constructor for MagnoliaRestClient that allows setting the response type for the REST calls.
  • Remove deprecated methods MagnoliaRestClient.readNode and MagnoliaRestClient.readProperty
Comment by Michael Duerig [ 04/Oct/21 ]

Reopening to address mgeljic 's concerns: https://git.magnolia-cms.com/projects/PLATFORM/repos/test-framework/pull-requests/103/overview?commentId=86521

Comment by Michael Duerig [ 07/Oct/21 ]

Removed dependencies to jcr, magnolia-core and magnolia-configuration.

Generated at Mon Feb 12 07:44:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.