<commit_before>package io.enmasse.systemtest.authz;

import io.enmasse.systemtest.*;
import io.enmasse.systemtest.amqp.AmqpClient;
import org.apache.qpid.proton.message.Message;
import org.junit.Before;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public abstract class AuthorizationTestBase extends TestBaseWithDefault {

    private static final Destination queue = Destination.queue("authz-queue");
    private static final Destination topic = Destination.topic("authz-topic");
    private static final Destination anycast = Destination.anycast("authz-anycast");
    private static final Destination multicast = Destination.multicast("authz-multicast");

    @Before
    public void initAddresses() throws Exception {
        setAddresses(defaultAddressSpace, queue, topic);
        if(getAddressSpaceType() == AddressSpaceType.STANDARD){
            appendAddresses(defaultAddressSpace, anycast, multicast);
        }
    }

    protected void doTestSendAuthz() throws Exception {
        KeycloakCredentials allowedUser = new KeycloakCredentials("sender", "senderPa55");
        getKeycloakClient().createUser(defaultAddressSpace.getName(), allowedUser.getUsername(), allowedUser.getPassword(), Group.SEND_ALL.toString());<commit_msg>FIX addresses initialization<commit_after>package io.enmasse.systemtest.authz;

import io.enmasse.systemtest.*;
import io.enmasse.systemtest.amqp.AmqpClient;
import org.apache.qpid.proton.message.Message;
import org.junit.Before;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public abstract class AuthorizationTestBase extends TestBaseWithDefault {

    private static final Destination queue = Destination.queue("authz-queue");
    private static final Destination topic = Destination.topic("authz-topic");
    private static final Destination anycast = Destination.anycast("authz-anycast");
    private static final Destination multicast = Destination.multicast("authz-multicast");

    @Before
    public void initAddresses() throws Exception {
        List<Destination> addresses = new ArrayList<>();
        addresses.add(queue);
        addresses.add(topic);
        if(getAddressSpaceType() == AddressSpaceType.STANDARD){
            addresses.add(anycast);
            addresses.add(multicast);
        }
        setAddresses(defaultAddressSpace, addresses.toArray(new Destination[0]));
    }

    protected void doTestSendAuthz() throws Exception {
        KeycloakCredentials allowedUser = new KeycloakCredentials("sender", "senderPa55");
        getKeycloakClient().createUser(defaultAddressSpace.getName(), allowedUser.getUsername(), allowedUser.getPassword(), Group.SEND_ALL.toString());
{'fraction_non_alphanumeric': 0.10096313517103953, 'fraction_numerical': 0.0016605778811026237, 'mean_word_length': 4.837209302325581, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2657076', 'n_tokens_mistral': 823, 'n_tokens_neox': 812, 'n_words': 172}