OrganizationRemoteSubscriptionPermissionsChecks { @Inject public void register(RemoteSubscriptionPermissionManager permissionFilter) { MembershipsChangedSubscriptionCheck membershipsEventsCheck = new MembershipsChangedSubscriptionCheck(); permissionFilter.registerCheck(membershipsEventsCheck, ORGANIZATION_MEMBERSHIP_METHOD_NAME); OrganizationChangedSubscriptionCheck organizationChangedCheck = new OrganizationChangedSubscriptionCheck(permissionsManager); permissionFilter.registerCheck(organizationChangedCheck, ORGANIZATION_CHANGED_METHOD_NAME); } @Inject  OrganizationRemoteSubscriptionPermissionsChecks(PermissionsManager permissionsManager); @Inject void register(RemoteSubscriptionPermissionManager permissionFilter);  }
@Test public void shouldRegisterChecks() { permissionsChecks.register(permissionManager); verify(permissionManager) .registerCheck( any(OrganizationChangedSubscriptionCheck.class), eq(ORGANIZATION_CHANGED_METHOD_NAME)); verify(permissionManager) .registerCheck( any(MembershipsChangedSubscriptionCheck.class), eq(ORGANIZATION_MEMBERSHIP_METHOD_NAME)); }