service.createTopic(new TopicInfo(topicName));
service.createSubscription(topicName, new SubscriptionInfo("sub"));
service.createRule(topicName, "sub", new RuleInfo("MyRule2"));
// Act
ListRulesResult result = service.listRules(topicName, "sub");
// Assert
assertNotNull(result);
assertEquals(2, result.getItems().size());
RuleInfo rule0 = result.getItems().get(0);
RuleInfo rule1 = result.getItems().get(1);
if (rule0.getName() == "MyRule2") {
RuleInfo swap = rule1;
rule1 = rule0;
rule0 = swap;
}
assertEquals("$Default", rule0.getName());
assertEquals("MyRule2", rule1.getName());
assertNotNull(result.getItems().get(0).getModel());
}