Skip to content

Commit

Permalink
Merge pull request #19 from hmcts/EM-1875-openId-connect-proxy-2
Browse files Browse the repository at this point in the history
Updated the changes for proxy
  • Loading branch information
yogesh-hullatti authored Feb 10, 2020
2 parents 3574e6a + a5d5dbf commit b3881d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
24 changes: 0 additions & 24 deletions src/main/java/uk/gov/hmcts/reform/em/FooConfiguration.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import uk.gov.hmcts.reform.em.FooConfiguration;

@FeignClient(
name = "idam-test-api-delete",
url = "${idam.api.url}/testing-support",
configuration = FooConfiguration.class
configuration = IdamConfiguration.class
)
@ConditionalOnProperty("idam.api.url")
public interface DeleteUserApi {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package uk.gov.hmcts.reform.em.test.idam;

import okhttp3.OkHttpClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import uk.gov.hmcts.reform.idam.client.IdamClient;
import uk.gov.hmcts.reform.idam.client.IdamTestApi;

import java.net.InetSocketAddress;
import java.net.Proxy;

@Configuration
@ConditionalOnProperty("idam.api.url")
@ComponentScan(basePackages = "uk.gov.hmcts.reform.idam.client")
Expand All @@ -18,4 +23,15 @@ public class IdamConfiguration {
IdamHelper idamHelper(IdamClient idamClient, IdamTestApi idamTestApi, DeleteUserApi deleteUserApi) {
return new IdamHelper(idamClient, idamTestApi, deleteUserApi);
}

@Bean
@Scope("prototype")
public OkHttpClient client() {

OkHttpClient okHttpClient = new OkHttpClient.Builder()
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyout.reform.hmcts.net", 8080)))
.build();

return okHttpClient;
}
}

0 comments on commit b3881d0

Please sign in to comment.