当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryRestMvcConfiguration类代码示例

本文整理汇总了Java中org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration的典型用法代码示例。如果您正苦于以下问题:Java RepositoryRestMvcConfiguration类的具体用法?Java RepositoryRestMvcConfiguration怎么用?Java RepositoryRestMvcConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RepositoryRestMvcConfiguration类属于org.springframework.data.rest.webmvc.config包,在下文中一共展示了RepositoryRestMvcConfiguration类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeConstrainedConverterFromSpringDataDoesNotPreventAutoConfigurationOfJacksonConverter

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void typeConstrainedConverterFromSpringDataDoesNotPreventAutoConfigurationOfJacksonConverter()
		throws Exception {
	this.context.register(JacksonObjectMapperBuilderConfig.class,
			RepositoryRestMvcConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class);
	this.context.refresh();

	Map<String, MappingJackson2HttpMessageConverter> beansOfType = this.context
			.getBeansOfType(MappingJackson2HttpMessageConverter.class);
	System.out.println(beansOfType);
	BeanDefinition beanDefinition = this.context
			.getBeanDefinition("mappingJackson2HttpMessageConverter");
	assertThat(beanDefinition.getFactoryBeanName()).isEqualTo(
			MappingJackson2HttpMessageConverterConfiguration.class.getName());
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:HttpMessageConvertersAutoConfigurationTests.java

示例2: testWithCustomSettings

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testWithCustomSettings() throws Exception {
	load(TestConfiguration.class, "spring.data.rest.default-page-size:42",
			"spring.data.rest.max-page-size:78",
			"spring.data.rest.page-param-name:_page",
			"spring.data.rest.limit-param-name:_limit",
			"spring.data.rest.sort-param-name:_sort",
			"spring.data.rest.default-media-type:application/my-json",
			"spring.data.rest.return-body-on-create:false",
			"spring.data.rest.return-body-on-update:false",
			"spring.data.rest.enable-enum-translation:true");
	assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class))
			.isNotNull();
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	assertThat(bean.getDefaultPageSize()).isEqualTo(42);
	assertThat(bean.getMaxPageSize()).isEqualTo(78);
	assertThat(bean.getPageParamName()).isEqualTo("_page");
	assertThat(bean.getLimitParamName()).isEqualTo("_limit");
	assertThat(bean.getSortParamName()).isEqualTo("_sort");
	assertThat(bean.getDefaultMediaType())
			.isEqualTo(MediaType.parseMediaType("application/my-json"));
	assertThat(bean.returnBodyOnCreate(null)).isFalse();
	assertThat(bean.returnBodyOnUpdate(null)).isFalse();
	assertThat(bean.isEnableEnumTranslation()).isTrue();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:27,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例3: typeConstrainedConverterFromSpringDataDoesNotPreventAutoConfigurationOfJacksonConverter

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void typeConstrainedConverterFromSpringDataDoesNotPreventAutoConfigurationOfJacksonConverter()
		throws Exception {
	this.context.register(JacksonObjectMapperBuilderConfig.class,
			RepositoryRestMvcConfiguration.class,
			HttpMessageConvertersAutoConfiguration.class);
	this.context.refresh();

	Map<String, MappingJackson2HttpMessageConverter> beansOfType = this.context
			.getBeansOfType(MappingJackson2HttpMessageConverter.class);
	System.out.println(beansOfType);
	BeanDefinition beanDefinition = this.context
			.getBeanDefinition("mappingJackson2HttpMessageConverter");
	assertThat(beanDefinition.getFactoryBeanName(), is(equalTo(
			MappingJackson2HttpMessageConverterConfiguration.class.getName())));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:17,代码来源:HttpMessageConvertersAutoConfigurationTests.java

示例4: testWithCustomBasePath

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testWithCustomBasePath() throws Exception {
	load(TestConfiguration.class, "spring.data.rest.base-path:foo");
	assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class))
			.isNotNull();
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	URI expectedUri = URI.create("/foo");
	assertThat(bean.getBaseUri()).as("Custom basePath not set")
			.isEqualTo(expectedUri);
	BaseUri baseUri = this.context.getBean(BaseUri.class);
	assertThat(expectedUri).as("Custom basePath has not been applied to BaseUri bean")
			.isEqualTo(baseUri.getUri());
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例5: backOffWithCustomConfiguration

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void backOffWithCustomConfiguration() {
	load(TestConfigurationWithRestMvcConfig.class, "spring.data.rest.base-path:foo");
	assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class))
			.isNotNull();
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	assertThat(bean.getBaseUri()).isEqualTo(URI.create(""));
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例6: testWithCustomBasePath

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testWithCustomBasePath() throws Exception {
	load(TestConfiguration.class, "spring.data.rest.base-path:foo");
	assertNotNull(this.context.getBean(RepositoryRestMvcConfiguration.class));
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	URI expectedUri = URI.create("/foo");
	assertEquals("Custom basePath not set", expectedUri, bean.getBaseUri());
	BaseUri baseUri = this.context.getBean(BaseUri.class);
	assertEquals("Custom basePath has not been applied to BaseUri bean", expectedUri,
			baseUri.getUri());
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例7: testWithCustomSettings

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testWithCustomSettings() throws Exception {
	load(TestConfiguration.class, "spring.data.rest.default-page-size:42",
			"spring.data.rest.max-page-size:78",
			"spring.data.rest.page-param-name:_page",
			"spring.data.rest.limit-param-name:_limit",
			"spring.data.rest.sort-param-name:_sort",
			"spring.data.rest.default-media-type:application/my-json",
			"spring.data.rest.return-body-on-create:false",
			"spring.data.rest.return-body-on-update:false",
			"spring.data.rest.enable-enum-translation:true");
	assertNotNull(this.context.getBean(RepositoryRestMvcConfiguration.class));
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	assertEquals("Custom default page size not set", 42, bean.getDefaultPageSize());
	assertEquals("Custom max page size not set", 78, bean.getMaxPageSize());
	assertEquals("Custom page param name not set", "_page", bean.getPageParamName());
	assertEquals("Custom limit param name not set", "_limit",
			bean.getLimitParamName());
	assertEquals("Custom sort param name not set", "_sort", bean.getSortParamName());
	assertEquals("Custom default media type not set",
			MediaType.parseMediaType("application/my-json"),
			bean.getDefaultMediaType());
	assertEquals("Custom return body on create flag not set", false,
			bean.returnBodyOnCreate(null));
	assertEquals("Custom return body on update flag not set", false,
			bean.returnBodyOnUpdate(null));
	assertEquals("Custom enable enum translation flag not set", true,
			bean.isEnableEnumTranslation());
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:31,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例8: backOffWithCustomConfiguration

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void backOffWithCustomConfiguration() {
	load(TestConfigurationWithRestMvcConfig.class, "spring.data.rest.base-path:foo");
	assertNotNull(this.context.getBean(RepositoryRestMvcConfiguration.class));
	RepositoryRestConfiguration bean = this.context
			.getBean(RepositoryRestConfiguration.class);
	assertEquals("Custom base URI should not have been set", URI.create(""),
			bean.getBaseUri());
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例9: testDefaultRepositoryConfiguration

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
	load(TestConfiguration.class);
	assertThat(this.context.getBean(RepositoryRestMvcConfiguration.class))
			.isNotNull();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:RepositoryRestMvcAutoConfigurationTests.java

示例10: testDefaultRepositoryConfiguration

import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; //导入依赖的package包/类
@Test
public void testDefaultRepositoryConfiguration() throws Exception {
	load(TestConfiguration.class);
	assertNotNull(this.context.getBean(RepositoryRestMvcConfiguration.class));
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:6,代码来源:RepositoryRestMvcAutoConfigurationTests.java


注:本文中的org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。