Example usage for org.springframework.boot.web.client RestTemplateBuilder RestTemplateBuilder

List of usage examples for org.springframework.boot.web.client RestTemplateBuilder RestTemplateBuilder

Introduction

In this page you can find the example usage for org.springframework.boot.web.client RestTemplateBuilder RestTemplateBuilder.

Prototype

public RestTemplateBuilder(RestTemplateCustomizer... customizers) 

Source Link

Document

Create a new RestTemplateBuilder instance.

Usage

From source file:org.springframework.boot.web.client.RestTemplateBuilderTests.java

@Test
public void createWhenCustomizersAreNullShouldThrowException() throws Exception {
    this.thrown.expect(IllegalArgumentException.class);
    this.thrown.expectMessage("Customizers must not be null");
    RestTemplateCustomizer[] customizers = null;
    new RestTemplateBuilder(customizers);
}

From source file:org.springframework.boot.web.client.RestTemplateBuilderTests.java

@Test
public void createWithCustomizersShouldApplyCustomizers() throws Exception {
    RestTemplateCustomizer customizer = mock(RestTemplateCustomizer.class);
    RestTemplate template = new RestTemplateBuilder(customizer).build();
    verify(customizer).customize(template);
}