+
+ public static void verifyMatchFieldTypeDontExist(List<MatchInfoBase> flowMatches, NxMatchFieldType matchType) {
+ Iterable<MatchInfoBase> matches = filter(flowMatches,
+ (item -> ((MatchInfo) item).getMatchField().equals(matchType)));
+ Assert.assertTrue("unexpected match type " + matchType.name(), Iterables.isEmpty(matches));
+ }
+
+ public static void prepareAclDataUtil(AclInterface inter, String... updatedAclNames) {
+ AclDataUtil.addAclInterfaceMap(prapreaAclIds(updatedAclNames), inter);
+ }
+
+ public static Acl prepareAcl(String aclName, String... aces) {
+ AccessListEntries aceEntries = mock(AccessListEntries.class);
+ List<Ace> aceList = prepareAceList(aces);
+ when(aceEntries.getAce()).thenReturn(aceList);
+
+ Acl acl = mock(Acl.class);
+ when(acl.getAccessListEntries()).thenReturn(aceEntries);
+ when(acl.getAclName()).thenReturn(aclName);
+ return acl;
+ }
+
+ public static List<Ace> prepareAceList(String... aces) {
+ List<Ace> aceList = new ArrayList<>();
+ for (String aceName : aces) {
+ Ace aceMock = mock(Ace.class);
+ when(aceMock.getRuleName()).thenReturn(aceName);
+ aceList.add(aceMock);
+ }
+ return aceList;
+ }
+
+ public static List<Uuid> prapreaAclIds(String... names) {
+ return Stream.of(names).map(name -> new Uuid(name)).collect(Collectors.toList());
+ }
+
+ public static void clearStaticData(AclInterface inter, String... aclNames) {
+ AclDataUtil.removeAclInterfaceMap(prapreaAclIds(aclNames), inter);
+ }