Java Code Examples for org.springframework.web.reactive.config.ViewResolverRegistry

The following examples show how to use org.springframework.web.reactive.config.ViewResolverRegistry. These examples are extracted from open source projects. 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 Project: spring-analysis-note   Source File: DefaultControllerSpecTests.java    License: MIT License 5 votes vote down vote up
@Test
public void configurerConsumers() {
	TestConsumer<ArgumentResolverConfigurer> argumentResolverConsumer = new TestConsumer<>();
	TestConsumer<RequestedContentTypeResolverBuilder> contenTypeResolverConsumer = new TestConsumer<>();
	TestConsumer<CorsRegistry> corsRegistryConsumer = new TestConsumer<>();
	TestConsumer<FormatterRegistry> formatterConsumer = new TestConsumer<>();
	TestConsumer<ServerCodecConfigurer> codecsConsumer = new TestConsumer<>();
	TestConsumer<PathMatchConfigurer> pathMatchingConsumer = new TestConsumer<>();
	TestConsumer<ViewResolverRegistry> viewResolverConsumer = new TestConsumer<>();

	new DefaultControllerSpec(new MyController())
			.argumentResolvers(argumentResolverConsumer)
			.contentTypeResolver(contenTypeResolverConsumer)
			.corsMappings(corsRegistryConsumer)
			.formatters(formatterConsumer)
			.httpMessageCodecs(codecsConsumer)
			.pathMatching(pathMatchingConsumer)
			.viewResolvers(viewResolverConsumer)
			.build();

	assertNotNull(argumentResolverConsumer.getValue());
	assertNotNull(contenTypeResolverConsumer.getValue());
	assertNotNull(corsRegistryConsumer.getValue());
	assertNotNull(formatterConsumer.getValue());
	assertNotNull(codecsConsumer.getValue());
	assertNotNull(pathMatchingConsumer.getValue());
	assertNotNull(viewResolverConsumer.getValue());

}
 
Example 2
Source Project: java-technology-stack   Source File: DefaultControllerSpecTests.java    License: MIT License 5 votes vote down vote up
@Test
public void configurerConsumers() {
	TestConsumer<ArgumentResolverConfigurer> argumentResolverConsumer = new TestConsumer<>();
	TestConsumer<RequestedContentTypeResolverBuilder> contenTypeResolverConsumer = new TestConsumer<>();
	TestConsumer<CorsRegistry> corsRegistryConsumer = new TestConsumer<>();
	TestConsumer<FormatterRegistry> formatterConsumer = new TestConsumer<>();
	TestConsumer<ServerCodecConfigurer> codecsConsumer = new TestConsumer<>();
	TestConsumer<PathMatchConfigurer> pathMatchingConsumer = new TestConsumer<>();
	TestConsumer<ViewResolverRegistry> viewResolverConsumer = new TestConsumer<>();

	new DefaultControllerSpec(new MyController())
			.argumentResolvers(argumentResolverConsumer)
			.contentTypeResolver(contenTypeResolverConsumer)
			.corsMappings(corsRegistryConsumer)
			.formatters(formatterConsumer)
			.httpMessageCodecs(codecsConsumer)
			.pathMatching(pathMatchingConsumer)
			.viewResolvers(viewResolverConsumer)
			.build();

	assertNotNull(argumentResolverConsumer.getValue());
	assertNotNull(contenTypeResolverConsumer.getValue());
	assertNotNull(corsRegistryConsumer.getValue());
	assertNotNull(formatterConsumer.getValue());
	assertNotNull(codecsConsumer.getValue());
	assertNotNull(pathMatchingConsumer.getValue());
	assertNotNull(viewResolverConsumer.getValue());

}
 
Example 3
@Override
protected void configureViewResolvers(ViewResolverRegistry registry) {
	registry.viewResolver((viewName, locale) -> Mono.just(new DummyView(locale)));
}
 
Example 4
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
	registry.freeMarker();
}
 
Example 5
Source Project: spring-analysis-note   Source File: DefaultControllerSpec.java    License: MIT License 4 votes vote down vote up
@Override
public DefaultControllerSpec viewResolvers(Consumer<ViewResolverRegistry> consumer) {
	this.configurer.viewResolversConsumer = consumer;
	return this;
}
 
Example 6
Source Project: spring-analysis-note   Source File: DefaultControllerSpec.java    License: MIT License 4 votes vote down vote up
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
	if (this.viewResolversConsumer != null) {
		this.viewResolversConsumer.accept(registry);
	}
}
 
Example 7
@Override
protected void configureViewResolvers(ViewResolverRegistry registry) {
	registry.viewResolver((viewName, locale) -> Mono.just(new DummyView(locale)));
}
 
Example 8
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
	registry.freeMarker();
}
 
Example 9
Source Project: java-technology-stack   Source File: DefaultControllerSpec.java    License: MIT License 4 votes vote down vote up
@Override
public DefaultControllerSpec viewResolvers(Consumer<ViewResolverRegistry> consumer) {
	this.configurer.viewResolversConsumer = consumer;
	return this;
}
 
Example 10
Source Project: java-technology-stack   Source File: DefaultControllerSpec.java    License: MIT License 4 votes vote down vote up
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
	if (this.viewResolversConsumer != null) {
		this.viewResolversConsumer.accept(registry);
	}
}
 
Example 11
@Override
 public void configureViewResolvers(ViewResolverRegistry registry) {
     registry.scriptTemplate();
  //   registry.freeMarker();
     registry.viewResolver(thymeleafChunkedAndDataDrivenViewResolver());
}
 
Example 12
@Override
 public void configureViewResolvers(ViewResolverRegistry registry) {
    // registry.scriptTemplate();
     //registry.freeMarker();
}
 
Example 13
@Override
 public void configureViewResolvers(ViewResolverRegistry registry) {
    // registry.scriptTemplate();
     //registry.freeMarker();
}
 
Example 14
@Override
 public void configureViewResolvers(ViewResolverRegistry registry) {
    // registry.scriptTemplate();
     //registry.freeMarker();
}
 
Example 15
@Override
 public void configureViewResolvers(ViewResolverRegistry registry) {
     registry.scriptTemplate();
     registry.freeMarker();
}
 
Example 16
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.freeMarker();
}
 
Example 17
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(thymeleafChunkedAndDataDrivenViewResolver());
}
 
Example 18
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(mustacheViewResolver());
}
 
Example 19
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.freeMarker();
}
 
Example 20
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(thymeleafChunkedAndDataDrivenViewResolver());
}
 
Example 21
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(thymeleafChunkedAndDataDrivenViewResolver());
}
 
Example 22
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(thymeleafChunkedAndDataDrivenViewResolver());
}
 
Example 23
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.viewResolver(mustacheViewResolver);
}
 
Example 24
Source Project: spring-analysis-note   Source File: WebTestClient.java    License: MIT License 2 votes vote down vote up
/**
 * Configure view resolution.
 * @see WebFluxConfigurer#configureViewResolvers
 */
ControllerSpec viewResolvers(Consumer<ViewResolverRegistry> consumer);
 
Example 25
Source Project: java-technology-stack   Source File: WebTestClient.java    License: MIT License 2 votes vote down vote up
/**
 * Configure view resolution.
 * @see WebFluxConfigurer#configureViewResolvers
 */
ControllerSpec viewResolvers(Consumer<ViewResolverRegistry> consumer);