[MGNLTEST-148] MagnoliaHttpClient throws Nullpointer if user is null Created: 31/Mar/21  Updated: 01/Jun/21  Resolved: 06/Apr/21

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

Type: Bug Priority: Neutral
Reporter: Christoph Meier Assignee: Christoph Meier
Resolution: Fixed Votes: 0
Labels: VN-Testing
Remaining Estimate: Not Specified
Time Spent: 6.5h
Original Estimate: Not Specified

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
Epic Link: core-TF-features-bugs-improvements

 Description   

When using the Magnolia "builder" methods to set a path and an instance but keeping the user null, then public Request build() throws a Nullpointer.

 

Example to reproduce

    @Test
    void serveResourceFromClasspath(MagnoliaHttpClient client) throws Exception {
        String resourcePath = "/.resources/test/classpath-test-resource.html";

        client.path(resourcePath).instance(DIRECT_AUTHOR);
        Request request = client.build();
        //Response response = client.get(request);
        // ... more stuff here
    }

Expected: Request is build and can be used to get the response.

Actual behaviour: client.build() throws a NullPointer.

 

Unfortunately the recently released test-fwk 1.1.0 contains this bug.

 

 

 


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