DATAREST-964 - Removed deprecated configuration methods in RepositoryRestMvcConfiguration.

This commit is contained in:
Oliver Gierke
2016-12-20 11:59:04 +01:00
parent bccb5fdcb8
commit 8c1ee5608b
2 changed files with 13 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +23,10 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
import org.springframework.hateoas.MediaTypes;
import org.springframework.http.HttpHeaders;
@@ -56,9 +58,16 @@ public class HalBrowserIntegrationTests {
@EnableWebMvc
static class TestConfiguration extends RepositoryRestMvcConfiguration {
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setBasePath(BASE_PATH);
@Bean
RepositoryRestConfigurerAdapter configExtension() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setBasePath(BASE_PATH);
}
};
}
}