001/*-------------------------------------------------------------------------+ 002| | 003| Copyright (c) 2005-2020 The ConQAT Project | 004| | 005| Licensed under the Apache License, Version 2.0 (the "License"); | 006| you may not use this file except in compliance with the License. | 007| You may obtain a copy of the License at | 008| | 009| http://www.apache.org/licenses/LICENSE-2.0 | 010| | 011| Unless required by applicable law or agreed to in writing, software | 012| distributed under the License is distributed on an "AS IS" BASIS, | 013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 014| See the License for the specific language governing permissions and | 015| limitations under the License. | 016| | 017+-------------------------------------------------------------------------*/ 018package org.conqat.lib.commons.test.mockserver; 019 020import java.lang.annotation.ElementType; 021import java.lang.annotation.Inherited; 022import java.lang.annotation.Retention; 023import java.lang.annotation.RetentionPolicy; 024import java.lang.annotation.Target; 025 026import org.junit.jupiter.api.Tag; 027import org.junit.jupiter.api.extension.ExtendWith; 028 029/** 030 * Meta-annotation for mock server tests. This tags all tests, ensures to load 031 * the Junit5 {@link MockServerExtension} and configures the target server. 032 */ 033@Target(ElementType.TYPE) 034@Retention(RetentionPolicy.RUNTIME) 035@Inherited 036@Tag("MockServerTest") 037@ExtendWith(MockServerExtension.class) 038public @interface MockServerTest { 039 /** The URL of the target server. */ 040 String value(); 041 042 /** 043 * Whether the target host points to a docker test container. If true, 044 * transparently maps to localhost if running locally or in k8s. 045 */ 046 boolean dockerHost() default false; 047}