-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathUnbabelBeansConfig.java
More file actions
35 lines (27 loc) · 1.08 KB
/
UnbabelBeansConfig.java
File metadata and controls
35 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.unbabel.challenge.configuration;
import com.unbabel.challenge.configuration.beans.ApiRequestBuilderUtil;
import com.unbabel.challenge.configuration.beans.SessionAttributes;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.WebApplicationContext;
@Configuration
public class UnbabelBeansConfig
{
@Bean
public RestTemplate getRestTemplate(){
return new RestTemplate();
}
@Bean
public ApiRequestBuilderUtil getEndpointUrlBuilderUtil(){return new ApiRequestBuilderUtil();}
@Bean
public ModelMapper modelMapper() {return new ModelMapper();}
@Bean
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
public SessionAttributes SessionAttributes() {
return new SessionAttributes();
}
}