Comments (2)
The link building methods in Spring HATEOAS rely on Spring Framework's RequestContextHolder
to access the current request. The current request is used to determine the scheme, host, and port in the link. Given that you're trying to build a link in a test when there should be no current request, I'm surprised that it works at all.
The above doesn't really matter as I don't think you should be using a link builder in your test. By reusing the exact same logic in your test that you're using in your controller, you're not really testing that the controller is doing the right thing – if there's a bug in the controller then there's a high chance that you test will contain the same bug. I'd update your test to hardcode the expected URI for the Location header.
from spring-restdocs.
cool, that's what I wanted to hear :)
from spring-restdocs.
Related Issues (20)
- How to hide Request Body and curl particular fields like "Token"? while generating spring rest docs through rest assured approach HOT 1
- Request-body.adoc is coming as blank in case of get call HOT 3
- Except body fields how can I add others mandate fields like headers(correlationId, destination, srDate) HOT 1
- Getting issue related to query parameter. HOT 5
- Latest dependencies issue is coming while generating rest docs HOT 2
- Any concern that the underlying asciidoc gradle plugin doesn't work with Java 17 or 21? HOT 1
- Upgrade Gradle Enterprise Plugins
- Using JWT Token to Access Resource Server HOT 2
- Cannot document form parameters when using Rest Assured's MockMvc support when contentType is multipart/form-data HOT 5
- Upgrade to Gradle Enterprise Conventions 0.0.16
- Move to GitHub Actions to build and deploy snapshots
- Run Windows and Java compatibility builds on GitHub Actions
- Document that the query string should be provided in the URL or by using queryParam when using MockMvc HOT 1
- JavaDoc support HOT 1
- Upgrade to Gradle Enterprise Conventions 0.0.17
- Issue with the Junit Rest Documentation with the spring docs 2.0.5.Release and spring boot version 2.7.6 version in controller testcases HOT 2
- Facing issue with asciidoctor.jvm.convert 2.4.0 and spring docs 2.0.5 release Which is unable to load the child.html in the index html HOT 2
- Facing issue with asciidoctor.jvm.convert 2.4.0 and spring docs 2.0.5 release while creating war using gradle 8.6 the public/docs folder is not getting created HOT 3
- Improve usage documentation for markdown HOT 2
- multipart/form-data PATCH request produces http-request snippet with no request body HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-restdocs.