// Path: src/main/java/com/xti/jenkins/plugin/awslambda/util/JenkinsProxy.java
// public class JenkinsProxy {
//     public static ProxyConfiguration getConfig(){
//         Jenkins instance = Jenkins.getInstance();
// 
//         if (instance != null) {
//             return instance.proxy;
//         } else {
//             return null;
//         }
//     }
// }
// 
// Path: src/main/java/com/xti/jenkins/plugin/awslambda/util/LambdaClientConfig.java
// public class LambdaClientConfig implements Serializable {
//     private String region;
//     private String accessKeyId;
//     private String secretKey;
//     private Boolean useDefaultAWSCredentials;
//     private ProxyConfiguration proxyConfiguration;
// 
//     public LambdaClientConfig(String region, ProxyConfiguration proxyConfiguration){
//         this.region = region;
//         this.useDefaultAWSCredentials = true;
//         this.proxyConfiguration = proxyConfiguration;
//     }
// 
//     public LambdaClientConfig(String accessKeyId, String secretKey, String region, ProxyConfiguration proxyConfiguration) {
//         this.region = region;
//         this.accessKeyId = accessKeyId;
//         this.secretKey = secretKey;
//         this.useDefaultAWSCredentials = false;
//         this.proxyConfiguration = proxyConfiguration;
//     }
// 
//     public AWSLambdaClient getClient() {
//         if(useDefaultAWSCredentials){
//             return new AWSLambdaClient(new DefaultAWSCredentialsProviderChain(), getClientConfiguration())
//                     .withRegion(Region.getRegion(Regions.fromName(region)));
//         } else {
//             return new AWSLambdaClient(new BasicAWSCredentials(accessKeyId, secretKey), getClientConfiguration())
//                     .withRegion(Region.getRegion(Regions.fromName(region)));
//         }
//     }
// 
//     private ClientConfiguration getClientConfiguration() {
//         /*
//         Jenkins instance = Jenkins.getInstance();
// 
//         if (instance != null) {
//             ProxyConfiguration proxy = instance.proxy;
//         */
//         ClientConfiguration config = new ClientConfiguration();
// 
//         if (proxyConfiguration != null) {
//             config.setProxyHost(proxyConfiguration.name);
//             config.setProxyPort(proxyConfiguration.port);
//             if (proxyConfiguration.getUserName() != null) {
//                 config.setProxyUsername(proxyConfiguration.getUserName());
//                 config.setProxyPassword(proxyConfiguration.getPassword());
//             }
//             if (proxyConfiguration.noProxyHost != null) {
//                 config.setNonProxyHosts(proxyConfiguration.noProxyHost);
//             }
//         }
// 
//         return config;
// 
//     }
// }


import com.xti.jenkins.plugin.awslambda.util.JenkinsProxy;
import com.xti.jenkins.plugin.awslambda.util.LambdaClientConfig;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
package com.xti.jenkins.plugin.awslambda.service;



public class LambdaClientConfigTest {

    @Test
    public void testGetClient() throws Exception {
// Path: src/main/java/com/xti/jenkins/plugin/awslambda/util/JenkinsProxy.java
// public class JenkinsProxy {
//     public static ProxyConfiguration getConfig(){
//         Jenkins instance = Jenkins.getInstance();
// 
//         if (instance != null) {
//             return instance.proxy;
//         } else {
//             return null;
//         }
//     }
// }
// 
// Path: src/main/java/com/xti/jenkins/plugin/awslambda/util/LambdaClientConfig.java
// public class LambdaClientConfig implements Serializable {
//     private String region;
//     private String accessKeyId;
//     private String secretKey;
//     private Boolean useDefaultAWSCredentials;
//     private ProxyConfiguration proxyConfiguration;
// 
//     public LambdaClientConfig(String region, ProxyConfiguration proxyConfiguration){
//         this.region = region;
//         this.useDefaultAWSCredentials = true;
//         this.proxyConfiguration = proxyConfiguration;
//     }
// 
//     public LambdaClientConfig(String accessKeyId, String secretKey, String region, ProxyConfiguration proxyConfiguration) {
//         this.region = region;
//         this.accessKeyId = accessKeyId;
//         this.secretKey = secretKey;
//         this.useDefaultAWSCredentials = false;
//         this.proxyConfiguration = proxyConfiguration;
//     }
// 
//     public AWSLambdaClient getClient() {
//         if(useDefaultAWSCredentials){
//             return new AWSLambdaClient(new DefaultAWSCredentialsProviderChain(), getClientConfiguration())
//                     .withRegion(Region.getRegion(Regions.fromName(region)));
//         } else {
//             return new AWSLambdaClient(new BasicAWSCredentials(accessKeyId, secretKey), getClientConfiguration())
//                     .withRegion(Region.getRegion(Regions.fromName(region)));
//         }
//     }
// 
//     private ClientConfiguration getClientConfiguration() {
//         /*
//         Jenkins instance = Jenkins.getInstance();
// 
//         if (instance != null) {
//             ProxyConfiguration proxy = instance.proxy;
//         */
//         ClientConfiguration config = new ClientConfiguration();
// 
//         if (proxyConfiguration != null) {
//             config.setProxyHost(proxyConfiguration.name);
//             config.setProxyPort(proxyConfiguration.port);
//             if (proxyConfiguration.getUserName() != null) {
//                 config.setProxyUsername(proxyConfiguration.getUserName());
//                 config.setProxyPassword(proxyConfiguration.getPassword());
//             }
//             if (proxyConfiguration.noProxyHost != null) {
//                 config.setNonProxyHosts(proxyConfiguration.noProxyHost);
//             }
//         }
// 
//         return config;
// 
//     }
// }


// Path: src/test/java/com/xti/jenkins/plugin/awslambda/service/LambdaClientConfigTest.java
import com.xti.jenkins.plugin.awslambda.util.JenkinsProxy;
import com.xti.jenkins.plugin.awslambda.util.LambdaClientConfig;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

package com.xti.jenkins.plugin.awslambda.service;



public class LambdaClientConfigTest {

    @Test
    public void testGetClient() throws Exception {
        LambdaClientConfig lambdaClientConfig = new LambdaClientConfig("abc", "def", "eu-west-1", JenkinsProxy.getConfig());