summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/resources/modelOperation/expected-additional_types-2.yaml
blob: 2d2c54206e3b71c9040c2897e224e6b70a8b0139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
tosca_definitions_version: tosca_simple_yaml_1_3
description: Auto-generated file that contains package custom types or types added
  after system installation.
data_types:
  tosca.datatypes.nfv.PreviouslyExistingType1:
    derived_from: tosca.datatypes.Root
    description: additional type
  tosca.datatypes.nfv.PreviouslyExistingType2:
    derived_from: tosca.datatypes.Root
    description: additional type
  tosca.datatypes.nfv.ServiceAvailability:
    derived_from: tosca.datatypes.Root
    description: additional type
  tosca.datatypes.nfv.L2AddressData:
    derived_from: tosca.datatypes.Root
    description: additional type
  tosca.datatypes.nfv.Unknown:
    derived_from: tosca.datatypes.Root
    description: additional type
span class="kn">import java.util.ArrayList; import java.util.List; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.util.CollectionUtils; import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * @author Sheel Bajpai (sheel.bajpai@orange.com) * */ @Configuration @Profile("serviceMesh") class HttpHeaderForwarderConfig implements WebMvcConfigurer { @Bean public RestTemplate restTemplate() { RestTemplate restTemplate = new RestTemplate(); List<ClientHttpRequestInterceptor> interceptors = restTemplate.getInterceptors(); if (CollectionUtils.isEmpty(interceptors)) interceptors = new ArrayList<>(); interceptors.add(new HttpHeaderForwarderRequestInterceptor()); restTemplate.setInterceptors(interceptors); return restTemplate; } @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new HttpHeaderForwarderHandlerInterceptor()); } }