Skip to content

Commit 097a194

Browse files
committed
xds: Use Rule order instead of RuleChain
This is now the preferred way to specify rule execution order.
1 parent 48192db commit 097a194

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

xds/src/test/java/io/grpc/xds/FakeControlPlaneXdsIntegrationTest.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import io.grpc.testing.protobuf.SimpleServiceGrpc;
4545
import org.junit.Rule;
4646
import org.junit.Test;
47-
import org.junit.rules.RuleChain;
4847
import org.junit.runner.RunWith;
4948
import org.junit.runners.JUnit4;
5049

@@ -71,18 +70,10 @@
7170
@RunWith(JUnit4.class)
7271
public class FakeControlPlaneXdsIntegrationTest {
7372

74-
public ControlPlaneRule controlPlane;
75-
public DataPlaneRule dataPlane;
76-
77-
/**
78-
* The {@link ControlPlaneRule} should run before the {@link DataPlaneRule}.
79-
*/
80-
@Rule
81-
public RuleChain ruleChain() {
82-
controlPlane = new ControlPlaneRule();
83-
dataPlane = new DataPlaneRule(controlPlane);
84-
return RuleChain.outerRule(controlPlane).around(dataPlane);
85-
}
73+
@Rule(order = 0)
74+
public ControlPlaneRule controlPlane = new ControlPlaneRule();
75+
@Rule(order = 1)
76+
public DataPlaneRule dataPlane = new DataPlaneRule(controlPlane);
8677

8778
@Test
8879
public void pingPong() throws Exception {

0 commit comments

Comments
 (0)