001/**
002 * Copyright (C) 2006-2022 Talend Inc. - www.talend.com
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.talend.sdk.component.junit.http.junit5;
017
018import static java.lang.annotation.ElementType.TYPE;
019import static java.lang.annotation.RetentionPolicy.RUNTIME;
020
021import java.lang.annotation.Retention;
022import java.lang.annotation.Target;
023import java.util.concurrent.Executor;
024import java.util.function.Predicate;
025import java.util.function.Supplier;
026
027import org.junit.jupiter.api.extension.ExtendWith;
028import org.talend.sdk.component.junit.http.api.ResponseLocator;
029import org.talend.sdk.component.junit.http.internal.junit5.JUnit5HttpApi;
030
031@Target(TYPE)
032@Retention(RUNTIME)
033@ExtendWith(JUnit5HttpApi.class)
034public @interface HttpApi {
035
036    /**
037     * @return the port to use for the server.
038     */
039    int port() default 0;
040
041    /**
042     * @return should the JVM be configured with the server as a proxy.
043     */
044    boolean globalProxyConfiguration() default true;
045
046    /**
047     * @return the log level for the network data.
048     */
049    String logLevel() default "DEBUG";
050
051    /**
052     * @return the response locator to use.
053     */
054    Class<? extends ResponseLocator> responseLocator() default ResponseLocator.class;
055
056    /**
057     * @return the header filter to use.
058     */
059    Class<? extends Predicate> headerFilter() default Predicate.class;
060
061    /**
062     * @return the executor to use.
063     */
064    Class<? extends Executor> executor() default Executor.class;
065
066    /**
067     * @return the SSLContext supplier to use.
068     */
069    Class<? extends Supplier> sslContext() default Supplier.class;
070
071    /**
072     * @return true if a default sslContext should be created for the test.
073     */
074    boolean useSsl() default false;
075
076    /**
077     * @return true if the proxy shouldn't add meta headers (X-Talend) at all.
078     */
079    boolean skipProxyHeaders() default false;
080}