From 34981c30a78e8bbd7791131059a9210f9928b62c Mon Sep 17 00:00:00 2001
From: 刘光辉 <347230014@qq.com>
Date: 星期四, 17 九月 2026 09:24:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtFlowStatusResolverChecks.java | 67 +++++++++++++++++++++++++++++++++
1 files changed, 67 insertions(+), 0 deletions(-)
diff --git a/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtFlowStatusResolverChecks.java b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtFlowStatusResolverChecks.java
new file mode 100644
index 0000000..09aadb2
--- /dev/null
+++ b/jnpf-lims/jnpf-lims-biz/src/test/java/jnpf/limsService/support/LimsSxtFlowStatusResolverChecks.java
@@ -0,0 +1,67 @@
+package jnpf.limsService.support;
+
+import java.util.Optional;
+
+/**
+ * 鏃犲閮ㄦ祴璇曚緷璧栫殑鐘舵�佹槧灏勫洖褰掓鏌ワ紝閫氳繃 main 鏂规硶鎵ц銆�
+ */
+public class LimsSxtFlowStatusResolverChecks {
+
+ public static void main(String[] args) {
+ resolvesKnownWorkflowStates();
+ doesNotResolveUnknownWorkflowState();
+ onlyPassedWorkflowEnablesPlan();
+ }
+
+ private static void resolvesKnownWorkflowStates() {
+ for (Object[] state : workflowStates()) {
+ assertEquals(Optional.of((String) state[1]),
+ LimsSxtFlowStatusResolver.resolveBizStatus((Integer) state[0]));
+ }
+ }
+
+ private static void doesNotResolveUnknownWorkflowState() {
+ assertEquals(Optional.empty(), LimsSxtFlowStatusResolver.resolveBizStatus(10));
+ assertEquals(Optional.empty(), LimsSxtFlowStatusResolver.resolveBizStatus(null));
+ }
+
+ private static void onlyPassedWorkflowEnablesPlan() {
+ assertTrue(LimsSxtFlowStatusResolver.isApproved(2));
+ assertFalse(LimsSxtFlowStatusResolver.isApproved(3));
+ assertFalse(LimsSxtFlowStatusResolver.isApproved(4));
+ assertFalse(LimsSxtFlowStatusResolver.isApproved(null));
+ }
+
+ private static Object[][] workflowStates() {
+ return new Object[][]{
+ {0, "pending"},
+ {1, "processing"},
+ {5, "processing"},
+ {6, "processing"},
+ {8, "processing"},
+ {2, "completed"},
+ {3, "completed"},
+ {4, "completed"},
+ {7, "completed"},
+ {9, "completed"}
+ };
+ }
+
+ private static void assertEquals(Object expected, Object actual) {
+ if (!expected.equals(actual)) {
+ throw new AssertionError("expected=" + expected + ", actual=" + actual);
+ }
+ }
+
+ private static void assertTrue(boolean value) {
+ if (!value) {
+ throw new AssertionError("expected true");
+ }
+ }
+
+ private static void assertFalse(boolean value) {
+ if (value) {
+ throw new AssertionError("expected false");
+ }
+ }
+}
--
Gitblit v1.8.0