[MGNLTEST-236] MagnoliaRestClient#nodeExists fails to figure the existence of node-names with UTF8-chars in the node name Created: 22/May/22 Updated: 16/Jun/22 Resolved: 10/Jun/22 |
|
| Status: | Closed |
| Project: | Magnolia Test Framework |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.3.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Christoph Meier | Assignee: | Michael Duerig |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | foundation_team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 5.5h | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| 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)
|
||||||||||||||||
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Team: | |||||||||||||||||
| Description |
|
This leads to a couple of problems with test operating with UTF8-chars in the node name. Note that the MagnoliaHttpClient does find such a node (on website workspace) - but the MagnoliaRestClient fails.
@Test
@Fixture(fixtureFile = "website.ääööüü.yaml", repository = WEBSITE)
void nodeExistsWorksForUTF8NodeNames(MagnoliaHttpClient magnoliaHttpClient) throws IOException {
boolean nodeExistsAccordingToMagnoliaRestClient = client.nodeExists(WEBSITE, "/ääööüü");
int responseStatus = magnoliaHttpClient.get(
magnoliaHttpClient.user(new User() {
@Override
public String getUserName() {
return "superuser";
}
@Override
public String getPassword() {
return "superuser";
}
}).instance(Instance.DIRECT_AUTHOR).path("/ääööüü").build()).code();
boolean nodeExistsAccordingToMagnoliaHttpClient = 200 == responseStatus;
assertEquals(nodeExistsAccordingToMagnoliaHttpClient, nodeExistsAccordingToMagnoliaRestClient);
}
The above test fails.
The issue may be ther underlying reason for |
| Comments |
| Comment by Michael Duerig [ 25/May/22 ] |
|
Fixed through |
| Comment by Christoph Meier [ 06/Jun/22 ] |
|
mduerig - i was on a way closing this - and before doing it a final QA. I think we should add additional self-tests, where the test must first load and then clean-up a resource with Umlaut in the node-name, as QA-commit.
We could add something like this to it.info.magnolia.test.fixture.FixtureTest:
@Order(11)
@Test
@Fixture(fixtureFile = "website.ääööüü.yaml", repository = "website")
@Cleanup("website:/ääööüü")
void loadAndCleanUpFixtureWithUTF8nodeName(){
assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü"));
}
@Order(12)
@Test
void confirmFixtureWithUTF8nodeNameCleanedUpOnAuthor(){
assertFalse(magnoliaRestClient.nodeExists("website", "/ääööüü"));
}
The problem is ... test-fwk atm runs against dx-core-test-webapp::6.2.19 - which comes with REST 2.2.-13 - which does not include the fix on REST ( When I run it against ce-test-webapps/master #loadAndCleanUpFixtureWithUTF8nodeName (the loading) fails. |
| Comment by Christoph Meier [ 06/Jun/22 ] |
|
I reopen it to check it again. Could be that it is just my setup ... and still/again setting-up the proper env to test locally is tricky |
| Comment by Christoph Meier [ 07/Jun/22 ] |
|
Adding same comment to both The issues still exist. on release/6.2-branch File website.ääööüü.yaml can be loaded. assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü")); fails. AND on master: |
| Comment by Michael Duerig [ 07/Jun/22 ] |
|
cmeier , I can't reproduce these failures. Here's what I tried, everything passes for me locally: https://git.magnolia-cms.com/users/mduerig/repos/ce/commits/761a9560a89710bed25e894a786b3c1a9f2b9571 |
| Comment by Christoph Meier [ 08/Jun/22 ] |
|
Weird that I have failures on my side. Would you mind adding these 2 methods to it.info.magnolia.test.fixture.FixtureTest (self-test)?
@Order(11)
@Test
@Fixture(fixtureFile = "website.ääööüü.yaml", repository = "website")
@Cleanup("website:/ääööüü")
void loadAndCleanUpFixtureWithUTF8nodeName(){
assertTrue(magnoliaRestClient.nodeExists("website", "/ääööüü"));
}
@Order(12)
@Test
void confirmFixtureWithUTF8nodeNameCleanedUpOnAuthor(){
assertFalse(magnoliaRestClient.nodeExists("website", "/ääööüü"));
}
We should have theme in any case. And they also should pass then in consequence on your env (and on jenkins). And sorry for bothering you with this. |