001/* 002 * Copyright 2023 the original author or authors. 003 * <p> 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 * <p> 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * <p> 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 de.cuioss.test.valueobjects.api.object; 017 018import java.lang.annotation.ElementType; 019import java.lang.annotation.Repeatable; 020import java.lang.annotation.Retention; 021import java.lang.annotation.RetentionPolicy; 022import java.lang.annotation.Target; 023 024/** 025 * A contract Veto is used for suppressing certain test-contracts. The default 026 * implementations run usually all available contracts, e.g. it will run 027 * {@link ObjectTestContracts#EQUALS_AND_HASHCODE}, 028 * {@link ObjectTestContracts#SERIALIZABLE} and 029 * {@link ObjectTestContracts#TO_STRING}. If one of the contracts is not 030 * suitable for your concrete test you can suppress this contract to be run by 031 * using this annotation. 032 * 033 * @author Oliver Wolff 034 */ 035@Retention(RetentionPolicy.RUNTIME) 036@Target({ ElementType.TYPE }) 037@Repeatable(VetoObjectTestContracts.class) 038public @interface VetoObjectTestContract { 039 040 /** 041 * @return the concrete contract to be suppressed / ignored 042 */ 043 ObjectTestContracts[] value(); 044}