-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add stop biz state #1026
add stop biz state #1026
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,7 @@ | |
*/ | ||
public enum BizState { | ||
/** | ||
* init but not start install yet | ||
* or | ||
* uninstalled | ||
* not init or not start install yet | ||
*/ | ||
UNRESOLVED("unresolved"), | ||
/** | ||
|
@@ -45,9 +43,14 @@ | |
DEACTIVATED("deactivated"), | ||
|
||
/** | ||
* install failed. | ||
* install or uninstall failed. | ||
*/ | ||
BROKEN("broken"); | ||
BROKEN("broken"), | ||
|
||
/** | ||
* uninstall succeed | ||
*/ | ||
STOPPED("stopped"); | ||
|
||
private String state; | ||
|
||
|
@@ -73,6 +76,8 @@ | |
return ACTIVATED; | ||
} else if (DEACTIVATED.name().equalsIgnoreCase(state)) { | ||
return DEACTIVATED; | ||
} else if (STOPPED.name().equalsIgnoreCase(state)) { | ||
return STOPPED; | ||
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add test coverage for STOPPED state handling. The static analysis indicates that the STOPPED state handling in the Would you like me to help generate test cases for the following scenarios?
🧰 Tools🪛 GitHub Check: codecov/patch[warning] 80-80: sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/model/BizState.java#L80 |
||
} else { | ||
return BROKEN; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect constant in cleanup.
The test assertion for the
STOPPED
state is correct. However, there's a mismatch in the cleanup:REMOVE_BIZ_INSTANCE_AFTER_STOP_FAILED
AUTO_UNINSTALL_WHEN_FAILED_ENABLE
This could lead to test pollution affecting other tests.
Apply this fix:
📝 Committable suggestion