#1980 - RepositoryEntityLinks now overrides ….linkForItemResource(…).

This commit is contained in:
Oliver Drotbohm
2021-02-24 17:55:23 +01:00
parent 22f5a027ae
commit 21556e68c1
2 changed files with 24 additions and 4 deletions

View File

@@ -18,7 +18,6 @@ package org.springframework.data.rest.webmvc.support;
import static org.assertj.core.api.Assertions.*;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
@@ -157,4 +156,12 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getVariableNames()).contains("projection");
}
}
@Test // #1980
public void considersIdConverterInLinkForItemResource() {
Link link = entityLinks.linkForItemResource(Book.class, 7L).withSelfRel();
assertThat(link.getHref()).endsWith("/books/7-7-7-7-7-7-7");
}
}