Skip to content

Commit

Permalink
fix: 修改motan插件的e2e测试
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmXu committed Dec 29, 2023
1 parent 824bfcb commit 1161706
Showing 1 changed file with 10 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MotanPluginCases implements ShenYuScenarioProvider {
@Override
public List<ScenarioSpec> get() {
return Lists.newArrayList(
testWithUriEquals()
testMotanHi()
);
}

Expand All @@ -50,33 +50,16 @@ public List<ScenarioSpec> get() {
*
* @return ShenYuScenarioSpec
*/
public ShenYuScenarioSpec testWithUriEquals() {
private ShenYuScenarioSpec testMotanHi() {
return ShenYuScenarioSpec.builder()
.name("single-motan uri =]")
.beforeEachSpec(
ShenYuBeforeEachSpec.builder()
.addSelectorAndRule(
newSelectorBuilder("selector", Plugin.MOTAN)
.conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.EQUAL, "/motan/demo/hi"))
.build(),
newRuleBuilder("rule")
.conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.EQUAL, "/motan/demo/hi"))
.handle(DivideRuleHandle.builder().timeout(100000).retry(10).build())
.build()
)
.checker(notExists("/motan/demo/hi"))
.waiting(exists("/motan/demo/hi"))
.build()
)
.caseSpec(
ShenYuCaseSpec.builder()
.addExists("/motan/demo/hi")
.addNotExists("/motan/demo/h")
.addNotExists("/put")
.addNotExists("/get")
.build()
)
.afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists("/motan/demo/hi")).build())
.name("motan test")
.beforeEachSpec(ShenYuBeforeEachSpec.builder()
.checker(exists("/motan/demo/hi"))
.build())
.caseSpec(ShenYuCaseSpec.builder()
.addExists("/motan/demo/hi")
.addNotExists("/motan/demo/h")
.build())
.build();
}
}

0 comments on commit 1161706

Please sign in to comment.