Skip to content

Commit

Permalink
[Chore] Fix StopWorkflowInstanceExecuteFunctionTest failed on Locale.…
Browse files Browse the repository at this point in the history
…SIMPLIFIED_CHINESE
  • Loading branch information
ruanwenjun committed Dec 12, 2024
1 parent 566651c commit a00cc77
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
import org.apache.dolphinscheduler.dao.entity.WorkflowInstance;
import org.apache.dolphinscheduler.dao.repository.WorkflowInstanceDao;

import java.util.Locale;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
Expand All @@ -34,6 +38,7 @@
import org.mockito.junit.jupiter.MockitoExtension;
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;
import org.springframework.context.i18n.LocaleContextHolder;

@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
Expand All @@ -45,6 +50,16 @@ class StopWorkflowInstanceExecuteFunctionTest {
@InjectMocks
private StopWorkflowInstanceExecutorDelegate stopWorkflowInstanceExecutorDelegate;

@BeforeAll
public static void setUp() {
LocaleContextHolder.setLocale(Locale.US);
}

@AfterAll
public static void tearDown() {
LocaleContextHolder.resetLocaleContext();
}

@ParameterizedTest
@EnumSource(value = WorkflowExecutionStatus.class, names = {
"RUNNING_EXECUTION",
Expand Down

0 comments on commit a00cc77

Please sign in to comment.