// Path: src/test/java/org/simplify4u/plugins/utils/ProxyUtil.java
// public static Proxy makeMavenProxy(String proxyUser, String proxyPassword, String id, boolean active) {
//     Proxy proxy = new Proxy();
//     proxy.setHost("localhost");
//     proxy.setActive(active);
//     proxy.setNonProxyHosts("*");
//     proxy.setUsername(proxyUser);
//     proxy.setPassword(proxyPassword);
//     proxy.setId(id);
//     proxy.setProtocol("http");
//     return proxy;
// }


import org.mockito.testng.MockitoTestNGListener;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static org.simplify4u.plugins.utils.ProxyUtil.makeMavenProxy;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import org.mockito.Mock;
/*
 * Copyright 2021 Slawomir Jaranowski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.simplify4u.plugins.keyserver;




/**
 * test on methods in the mojo itself
 */
@Listeners(MockitoTestNGListener.class)
public class KeyServerClientSettingsTest {

    @Mock
    private MavenSession mavenSession;

    @Mock
    private Settings settings;

    /**
     * test that if we set a proxy, we want to ensure that it is the right one from our config
     *
     */
    @Test
    public void testIfProxyDeterminationWorksUsingIDs() {

        List<Proxy> proxies = Arrays.asList(
// Path: src/test/java/org/simplify4u/plugins/utils/ProxyUtil.java
// public static Proxy makeMavenProxy(String proxyUser, String proxyPassword, String id, boolean active) {
//     Proxy proxy = new Proxy();
//     proxy.setHost("localhost");
//     proxy.setActive(active);
//     proxy.setNonProxyHosts("*");
//     proxy.setUsername(proxyUser);
//     proxy.setPassword(proxyPassword);
//     proxy.setId(id);
//     proxy.setProtocol("http");
//     return proxy;
// }


// Path: src/test/java/org/simplify4u/plugins/keyserver/KeyServerClientSettingsTest.java
import org.mockito.testng.MockitoTestNGListener;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static org.simplify4u.plugins.utils.ProxyUtil.makeMavenProxy;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import org.mockito.Mock;

/*
 * Copyright 2021 Slawomir Jaranowski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.simplify4u.plugins.keyserver;




/**
 * test on methods in the mojo itself
 */
@Listeners(MockitoTestNGListener.class)
public class KeyServerClientSettingsTest {

    @Mock
    private MavenSession mavenSession;

    @Mock
    private Settings settings;

    /**
     * test that if we set a proxy, we want to ensure that it is the right one from our config
     *
     */
    @Test
    public void testIfProxyDeterminationWorksUsingIDs() {

        List<Proxy> proxies = Arrays.asList(
                makeMavenProxy(null, null, "p1", true),