// Path: common/src/main/java/cz/gopay/api/v3/IGPConnector.java
// public interface IGPConnector {
// 
//     IGPConnector getAppToken(String clientId, String clientCredentials) throws GPClientException;
// 
//     IGPConnector getAppToken(String clientId, String clientCredentials,
//             String scope) throws GPClientException;
// 
//     Payment createPayment(BasePayment payment) throws GPClientException;
// 
//     PaymentResult refundPayment(Long id, Long amount) throws GPClientException;
// 
//     Payment createRecurrentPayment(Long id, NextPayment nextPayment) throws GPClientException;
// 
//     PaymentResult voidRecurrency(Long id) throws GPClientException;
// 
//     PaymentResult capturePayment(Long id) throws GPClientException;
//     
//     PaymentResult capturePayment(Long id, CapturePayment capturePayment) throws GPClientException;
// 
//     PaymentResult voidAuthorization(Long id) throws GPClientException;
// 
//     Payment paymentStatus(Long id) throws GPClientException;
//     
//     PaymentResult refundPayment(Long id, RefundPayment refundPayment) throws GPClientException;
// 
//     List<EETReceipt> findEETREceiptsByFilter(EETReceiptFilter filter) throws GPClientException;
//     
//     PaymentInstrumentRoot generatePaymentInstruments(Long goId, Currency currency) throws GPClientException;
//     
//     List<EETReceipt> getEETReceiptByPaymentId(Long id) throws GPClientException;
//     
//     byte[] generateStatement(AccountStatement accountStatement) throws GPClientException;
//     
//     String getApiUrl();
// 
//     AccessToken getAccessToken();
//     
//     void setAccessToken(AccessToken accessToken);
// }
// 
// Path: apache-http-client/src/main/java-templates/cz/gopay/api/v3/impl/apacheclient/HttpClientGPConnector.java
// public class HttpClientGPConnector extends AbstractGPConnector {
// 
//     public static HttpClientGPConnector build(String apiUrl) {
//         return new HttpClientGPConnector(apiUrl);
//     }
// 
//     private HttpClientGPConnector(String apiUrl) {
//         super(apiUrl);
//     }
// 
//     @Override
//     protected <T> T createRESTClientProxy(String apiUrl, Class<T> proxy) {
//         if (proxy == AuthClient.class) {
//             return (T) new HttpClientAuthClientImpl(apiUrl);
//         } else if (proxy == PaymentClient.class) {
//             return (T) new HttpClientPaymentClientImpl(apiUrl);
//         }
//         throw new IllegalArgumentException("Unknown interface");
//     }
//     
//     @Override
//     protected String getImplementationName() {
//         return "${project.artifactId}";
//     }
// }
// 
// Path: common-tests/src/main/java/test/utils/LoginTests.java
// public abstract class LoginTests implements RestClientTest {
// 
//     private static final Logger logger = LogManager.getLogger(LoginTests.class);
// 
//     @Test
//     public void testAuthApacheHttpClient() {
//         try {
//             IGPConnector connector = getConnector().getAppToken(TestUtils.CLIENT_ID, TestUtils.CLIENT_SECRET);
//             Assertions.assertNotNull(connector.getAccessToken());
//         } catch (GPClientException ex) {
//             TestUtils.handleException(ex, logger);
//         }
//     }
//     
//     
// }
// 
// Path: common-tests/src/main/java/test/utils/TestUtils.java
// public class TestUtils {
// 
//     public static final String API_URL = "https://gw.sandbox.gopay.com/api";
//     public static final String CLIENT_ID = "1744960415";
//     public static final String CLIENT_SECRET = "h9wyRz2s";
//     public static final Long GOID = 8339303643L;
//   // public static final String API_URL = "http://gopay-gw:8180/gp/api";
//   // public static final String CLIENT_ID = "app@musicshop.cz";
//   // public static final String CLIENT_SECRET = "VpnJVcTn";
//   // public static final Long GOID = 8761908826L;
//     
//     public static void handleException(GPClientException e, Logger logger) {
//         List<ErrorElement> errorMessages = e.getErrorMessages();
//         StringBuilder builder = new StringBuilder();
//         builder.append("E: ");
//         for (ErrorElement element : errorMessages) {
//             builder.append(element.getErrorName()).append(", ");
//         }
//         logger.fatal(builder.toString());
//         Assertions.fail(builder.toString());
//     }
// }


import cz.gopay.api.v3.IGPConnector;
import cz.gopay.api.v3.impl.apacheclient.HttpClientGPConnector;
import test.utils.LoginTests;
import test.utils.TestUtils;
package cz.gopay.cfx;




public class ApacheHttpClientLoginTest extends LoginTests {
    
    public IGPConnector getConnector() {
// Path: common/src/main/java/cz/gopay/api/v3/IGPConnector.java
// public interface IGPConnector {
// 
//     IGPConnector getAppToken(String clientId, String clientCredentials) throws GPClientException;
// 
//     IGPConnector getAppToken(String clientId, String clientCredentials,
//             String scope) throws GPClientException;
// 
//     Payment createPayment(BasePayment payment) throws GPClientException;
// 
//     PaymentResult refundPayment(Long id, Long amount) throws GPClientException;
// 
//     Payment createRecurrentPayment(Long id, NextPayment nextPayment) throws GPClientException;
// 
//     PaymentResult voidRecurrency(Long id) throws GPClientException;
// 
//     PaymentResult capturePayment(Long id) throws GPClientException;
//     
//     PaymentResult capturePayment(Long id, CapturePayment capturePayment) throws GPClientException;
// 
//     PaymentResult voidAuthorization(Long id) throws GPClientException;
// 
//     Payment paymentStatus(Long id) throws GPClientException;
//     
//     PaymentResult refundPayment(Long id, RefundPayment refundPayment) throws GPClientException;
// 
//     List<EETReceipt> findEETREceiptsByFilter(EETReceiptFilter filter) throws GPClientException;
//     
//     PaymentInstrumentRoot generatePaymentInstruments(Long goId, Currency currency) throws GPClientException;
//     
//     List<EETReceipt> getEETReceiptByPaymentId(Long id) throws GPClientException;
//     
//     byte[] generateStatement(AccountStatement accountStatement) throws GPClientException;
//     
//     String getApiUrl();
// 
//     AccessToken getAccessToken();
//     
//     void setAccessToken(AccessToken accessToken);
// }
// 
// Path: apache-http-client/src/main/java-templates/cz/gopay/api/v3/impl/apacheclient/HttpClientGPConnector.java
// public class HttpClientGPConnector extends AbstractGPConnector {
// 
//     public static HttpClientGPConnector build(String apiUrl) {
//         return new HttpClientGPConnector(apiUrl);
//     }
// 
//     private HttpClientGPConnector(String apiUrl) {
//         super(apiUrl);
//     }
// 
//     @Override
//     protected <T> T createRESTClientProxy(String apiUrl, Class<T> proxy) {
//         if (proxy == AuthClient.class) {
//             return (T) new HttpClientAuthClientImpl(apiUrl);
//         } else if (proxy == PaymentClient.class) {
//             return (T) new HttpClientPaymentClientImpl(apiUrl);
//         }
//         throw new IllegalArgumentException("Unknown interface");
//     }
//     
//     @Override
//     protected String getImplementationName() {
//         return "${project.artifactId}";
//     }
// }
// 
// Path: common-tests/src/main/java/test/utils/LoginTests.java
// public abstract class LoginTests implements RestClientTest {
// 
//     private static final Logger logger = LogManager.getLogger(LoginTests.class);
// 
//     @Test
//     public void testAuthApacheHttpClient() {
//         try {
//             IGPConnector connector = getConnector().getAppToken(TestUtils.CLIENT_ID, TestUtils.CLIENT_SECRET);
//             Assertions.assertNotNull(connector.getAccessToken());
//         } catch (GPClientException ex) {
//             TestUtils.handleException(ex, logger);
//         }
//     }
//     
//     
// }
// 
// Path: common-tests/src/main/java/test/utils/TestUtils.java
// public class TestUtils {
// 
//     public static final String API_URL = "https://gw.sandbox.gopay.com/api";
//     public static final String CLIENT_ID = "1744960415";
//     public static final String CLIENT_SECRET = "h9wyRz2s";
//     public static final Long GOID = 8339303643L;
//   // public static final String API_URL = "http://gopay-gw:8180/gp/api";
//   // public static final String CLIENT_ID = "app@musicshop.cz";
//   // public static final String CLIENT_SECRET = "VpnJVcTn";
//   // public static final Long GOID = 8761908826L;
//     
//     public static void handleException(GPClientException e, Logger logger) {
//         List<ErrorElement> errorMessages = e.getErrorMessages();
//         StringBuilder builder = new StringBuilder();
//         builder.append("E: ");
//         for (ErrorElement element : errorMessages) {
//             builder.append(element.getErrorName()).append(", ");
//         }
//         logger.fatal(builder.toString());
//         Assertions.fail(builder.toString());
//     }
// }


// Path: apache-http-client/src/test/java/cz/gopay/cfx/ApacheHttpClientLoginTest.java
import cz.gopay.api.v3.IGPConnector;
import cz.gopay.api.v3.impl.apacheclient.HttpClientGPConnector;
import test.utils.LoginTests;
import test.utils.TestUtils;

package cz.gopay.cfx;




public class ApacheHttpClientLoginTest extends LoginTests {
    
    public IGPConnector getConnector() {
        return HttpClientGPConnector.build(TestUtils.API_URL);