mvysny / karibu-testing

Vaadin Server-Side Browserless Containerless Unit Testing
Apache License 2.0
111 stars 14 forks source link

In karibu testing 2.1.5 MockRequest was removed. Why and what is the replacement? #170

Closed satorstefan closed 5 months ago

satorstefan commented 5 months ago

import com.github.mvysny.kaributesting.mockhttp.MockRequest;

Here the class is still there: image

Thats how I use it currently: image

satorstefan commented 5 months ago

image

TheHaf-at-FraunhoferIOSB commented 5 months ago

For some reason, that dependency mock-servlet-environment5 is not (yet) available in version 2.1.5. You could try adding the dependency in version 2.1.4 to your project explicitely. Personally I am just staying on version 2.1.4 for the time being.

mvysny commented 5 months ago

That's true. The mock-servlet-environment5 and mock-servlet-environment held fake classes implementing bits of jakarta.servlet and javax.servlet respectively. They were almost identical yet present in two distinct KaribuTesting branches, master and 1.4.0, duplicating maintenance efforts.

I've extracted the library to https://github.com/mvysny/fake-servlet which KaribuTesting pulls in as a dependency. The classes were renamed to FakeSession and such, however there should still be deprecated typealiases for MockSession classes.

In short, the mock-servlet-environment5 dependency was replaced by the fake-servlet5 dependency, and you shouldn't really notice any difference.