This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HttpServletRequestUtils { | |
public static String getIp(final HttpServletRequest request) { | |
PreConditions.checkNull(request, "request cannot be null"); | |
String ip = request.getHeader("X-FORWARDED-FOR"); | |
if (ip==null || ip.trim().length()==0)) { | |
ip = request.getRemoteAddr(); | |
} | |
return ip; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################### Logging ################ | |
logging.level.org.springframework.web=debug | |
################### Security ################ | |
security.basic.enabled=false | |
################### DataSource ################ | |
spring.datasource.url=jdbc:h2:mem:devDb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################## Profiles ################ | |
spring.profiles.active=dev | |
################### Logging ################ | |
logging.level.org.springframework.web=debug | |
################### Security ################ | |
security.basic.enabled=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' | |
compile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4' | |
compile group: 'com.google.guava', name: 'guava', version: '19.0' | |
compile group: 'org.spockframework', name: 'spock-spring', version: '1.0-groovy-2.4' | |
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.1' | |
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Bean(name="testRestTemplate") | |
public RestTemplate getPubPostbackRestTemplate(){ | |
final int readTimeOut = 5000; | |
final int connectTimeout = 5000; | |
final HttpComponentsClientHttpRequestFactory clientHttpRequestFactory = | |
new HttpComponentsClientHttpRequestFactory(); | |
clientHttpRequestFactory.setConnectTimeout(connectTimeout); | |
clientHttpRequestFactory.setReadTimeout(readTimeOut); | |
return new RestTemplate(clientHttpRequestFactory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Category { | |
//IAB1 : Arts & Entertainment | |
IAB1_1("IAB1-1","Books & Literature"), | |
IAB1_2("IAB1-2","Celebrity Fan/Gossip"), | |
IAB1_3("IAB1-3","Fine Art"), | |
IAB1_4("IAB1-4","Humour"), | |
IAB1_5("IAB1-5","Movies"), | |
IAB1_6("IAB1-6","Music"), | |
IAB1_7("IAB1-7","Television"), |
OlderNewer