Browse Source

[Chore] Fix StopWorkflowInstanceExecuteFunctionTest failed on Locale.SIMPLIFIED_CHINESE (#16893)

dev
Wenjun Ruan 2 weeks ago committed by GitHub
parent
commit
7e9df4b14d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/executor/workflow/StopWorkflowInstanceExecuteFunctionTest.java

15
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/executor/workflow/StopWorkflowInstanceExecuteFunctionTest.java

@ -25,7 +25,11 @@ import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
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;
@ -34,6 +38,7 @@ import org.mockito.Mock;
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)
@ -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",

Loading…
Cancel
Save