org.springframework.data.rest.webmvc.spi.BackendIdConverter Java Examples

The following examples show how to use org.springframework.data.rest.webmvc.spi.BackendIdConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GcpDatastoreAutoConfigurationTests.java    From spring-cloud-gcp with Apache License 2.0 5 votes vote down vote up
@Test
public void testIdConverterCreated() {
	this.contextRunner.run((context) -> {
		BackendIdConverter idConverter = context.getBean(BackendIdConverter.class);
		assertThat(idConverter).isNotNull();
		assertThat(idConverter).isInstanceOf(DatastoreKeyIdConverter.class);
	});
}
 
Example #2
Source File: GcpSpannerAutoConfigurationTests.java    From spring-cloud-gcp with Apache License 2.0 5 votes vote down vote up
@Test
public void testIdConverterCreated() {
	this.contextRunner.run((context) -> {
		BackendIdConverter idConverter = context.getBean(BackendIdConverter.class);
		assertThat(idConverter).isNotNull();
		assertThat(idConverter).isInstanceOf(SpannerKeyIdConverter.class);
	});
}
 
Example #3
Source File: GcpSpannerAutoConfigurationTests.java    From spring-cloud-gcp with Apache License 2.0 5 votes vote down vote up
@Test
public void testIdConverterNotCreated() {
	this.contextRunner
			.withClassLoader(
					new FilteredClassLoader("org.springframework.data.rest.webmvc.spi"))
			.run((context) -> {
				assertThat(
						context.getBeansOfType(BackendIdConverter.class).size()).isEqualTo(0);
				});
}
 
Example #4
Source File: GcpDatastoreAutoConfiguration.java    From spring-cloud-gcp with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public BackendIdConverter datastoreKeyIdConverter(DatastoreMappingContext datastoreMappingContext) {
	return new DatastoreKeyIdConverter(datastoreMappingContext);
}
 
Example #5
Source File: GcpSpannerAutoConfiguration.java    From spring-cloud-gcp with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public BackendIdConverter spannerKeyIdConverter(SpannerMappingContext mappingContext) {
	return new SpannerKeyIdConverter(mappingContext);
}
 
Example #6
Source File: DemoRepositoryEntityLinks.java    From spring-data-dynamodb-demo with Apache License 2.0 4 votes vote down vote up
public DemoRepositoryEntityLinks(Repositories repositories,
		ResourceMappings mappings, RepositoryRestConfiguration config, HateoasPageableHandlerMethodArgumentResolver resolver,org.springframework.plugin.core.PluginRegistry<BackendIdConverter,Class<?>> idConverters) {
	super(repositories, mappings, config, resolver,idConverters);
	this.resourceMappings = mappings;
	this.config = config;
}