public void testFlowSecuredState() {
EndStateModel end = new EndStateModel("end");
end.setSecured(new SecuredModel("ROLE_USER"));
model.setStates(asList(AbstractStateModel.class, end));
Flow flow = getFlow(model);
SecurityRule rule = (SecurityRule) flow.getState("end").getAttributes()
.get(SecurityRule.SECURITY_ATTRIBUTE_NAME);
assertNotNull(rule);
assertEquals(SecurityRule.COMPARISON_ANY, rule.getComparisonType());
assertEquals(1, rule.getAttributes().size());
assertTrue(rule.getAttributes().contains("ROLE_USER"));
}