TestNew | Basic middleware initialization | Creates middleware with default options and adds self link to JSON response |
TestSelfLink | Self link generation with base URL | Automatically adds self link with correct base URL and rel=“self” |
TestAddLink | Adding single link to response | Successfully adds custom link to response links array |
TestAddLinks | Adding multiple links at once | Adds multiple links in a single call to the response |
TestLinkProvider | Dynamic link generation via provider | Invokes link provider function to generate context-aware links |
TestNonJSONResponse | Non-JSON response handling | Passes through non-JSON responses unchanged without adding links |
TestCustomLinksKey | Custom links key configuration | Uses custom key instead of default “_links” for link storage |
TestResource | Resource wrapper with links | Creates resource structure with data and links fields |
TestCollection | Paginated collection with links | Generates collection with pagination metadata and navigation links (first, prev, next, last) |
TestCollectionFirstPage | First page pagination | Omits “prev” link on first page of results |
TestCollectionLastPage | Last page pagination | Omits “next” link on last page of results |
TestHAL | HAL+JSON resource creation | Creates HAL resource with properties and links, marshals correctly |
TestHALEmbedded | HAL embedded resources | Embeds related resources within HAL response structure |
TestGetLinks | Retrieving current links | Returns current links from context during request handling |