|
| 1 | +/* |
| 2 | + * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved. |
| 3 | + * |
| 4 | + * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | + * |
| 6 | + * Modifications copyright (C) 2017 Uber Technologies, Inc. |
| 7 | + * |
| 8 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | + * you may not use this material except in compliance with the License. |
| 10 | + * You may obtain a copy of the License at |
| 11 | + * |
| 12 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | + * |
| 14 | + * Unless required by applicable law or agreed to in writing, software |
| 15 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | + * See the License for the specific language governing permissions and |
| 18 | + * limitations under the License. |
| 19 | + */ |
| 20 | + |
| 21 | +package io.temporal.workflow.versionTests; |
| 22 | + |
| 23 | +import io.temporal.internal.common.SdkFlag; |
| 24 | +import io.temporal.internal.statemachines.WorkflowStateMachines; |
| 25 | +import java.util.Arrays; |
| 26 | +import java.util.Collections; |
| 27 | +import org.junit.Before; |
| 28 | +import org.junit.runner.RunWith; |
| 29 | +import org.junit.runners.Parameterized; |
| 30 | + |
| 31 | +@RunWith(Parameterized.class) |
| 32 | +public abstract class BaseVersionTest { |
| 33 | + |
| 34 | + @Parameterized.Parameter public static boolean setVersioningFlag; |
| 35 | + |
| 36 | + @Parameterized.Parameters() |
| 37 | + public static Object[] data() { |
| 38 | + return new Object[][] {{true}, {false}}; |
| 39 | + } |
| 40 | + |
| 41 | + @Before |
| 42 | + public void setup() { |
| 43 | + if (setVersioningFlag) { |
| 44 | + WorkflowStateMachines.initialFlags = |
| 45 | + Collections.unmodifiableList( |
| 46 | + Arrays.asList(SdkFlag.SKIP_YIELD_ON_DEFAULT_VERSION, SdkFlag.SKIP_YIELD_ON_VERSION)); |
| 47 | + } |
| 48 | + } |
| 49 | +} |
0 commit comments