<commit_before>package de.bornemisza.users;

import io.restassured.builder.RequestSpecBuilder;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
import io.restassured.response.ResponseBody;
import io.restassured.specification.RequestSpecification;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static io.restassured.RestAssured.given;

import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;

import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import static org.junit.Assert.*;

import de.bornemisza.users.entity.User;

public class IntegrationTestBase {

    protected static final String BASE_URI_PROP = "BASE.URI";
    protected static final String USERNAME_PROP = "ADMIN.USERNAME";
    protected static final String PASSWORD_PROP = "<PASSWORD>";
    protected RequestSpecification requestSpec;
    protected URI baseUri;
    protected User user;

    @Rule
    public TestRule watcher = new TestWatcher() {
        @Override
        protected void starting(Description description) {
            System.out.println("\n>>>> Starting test: " + description.getMethodName() + "\n");
        }
    };

    @Before
    public void setUp() throws AddressException {
        String configuredUri = System.getProperty(BASE_URI_PROP);
        if (configuredUri == null) fail("Please configure " + BASE_URI_PROP + " in your build.properties");
        String userName = System.getProperty(USERNAME_PROP);
        if (userName == null) fail("Please configure " + USERNAME_PROP + " in your build.properties");
        String password = System.getProperty(PASSWORD_PROP);
        if (password == null) fail("Please configure " + PASSWORD_PROP + " in your build.properties");
        baseUri = URI.create(configuredUri);
        requestSpec = new RequestSpecBuilder()
                .setBaseUri(baseUri)
                .addFilter(new RequestLoggingFilter())
                .addFilter(new ResponseLoggingFilter())
                .build();
        requestSpec.auth().preemptive().basic(userName, password);
        user = new User();
        user.setName("<NAME>");
        user.setPassword(new char[]{'s','e','c','<PASSWORD>'});
        user.setEmail(new InternetAddress("<EMAIL>"));
        List<String> roles = Arrays.asList(new String[]{"customer", "user"});
        user.setRoles(roles);
    }
<commit_msg>renamed TESTUSER to ADMIN<commit_after>package de.bornemisza.users;

import io.restassured.builder.RequestSpecBuilder;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
import io.restassured.response.ResponseBody;
import io.restassured.specification.RequestSpecification;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static io.restassured.RestAssured.given;

import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;

import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import static org.junit.Assert.*;

import de.bornemisza.users.entity.User;

public class IntegrationTestBase {

    protected static final String BASE_URI_PROP = "BASE.URI";
    protected static final String ADMIN_USERNAME_PROP = "ADMIN.USERNAME";
    protected static final String ADMIN_PASSWORD_PROP = "<PASSWORD>";
    protected RequestSpecification requestSpec;
    protected URI baseUri;
    protected User user;

    @Rule
    public TestRule watcher = new TestWatcher() {
        @Override
        protected void starting(Description description) {
            System.out.println("\n>>>> Starting test: " + description.getMethodName() + "\n");
        }
    };

    @Before
    public void setUp() throws AddressException {
        String configuredUri = System.getProperty(BASE_URI_PROP);
        if (configuredUri == null) fail("Please configure " + BASE_URI_PROP + " in your build.properties");
        String userName = System.getProperty(ADMIN_USERNAME_PROP);
        if (userName == null) fail("Please configure " + ADMIN_USERNAME_PROP + " in your build.properties");
        String password = System.getProperty(ADMIN_PASSWORD_PROP);
        if (password == null) fail("Please configure " + ADMIN_PASSWORD_PROP + " in your build.properties");
        baseUri = URI.create(configuredUri);
        requestSpec = new RequestSpecBuilder()
                .setBaseUri(baseUri)
                .addFilter(new RequestLoggingFilter())
                .addFilter(new ResponseLoggingFilter())
                .build();
        requestSpec.auth().preemptive().basic(userName, password);
        user = new User();
        user.setName("<NAME>");
        user.setPassword(new char[]{'s','<PASSWORD>'});
        user.setEmail(new InternetAddress("<EMAIL>"));
        List<String> roles = Arrays.asList(new String[]{"customer", "user"});
        user.setRoles(roles);
    }

{'fraction_non_alphanumeric': 0.11244377811094453, 'fraction_numerical': 0.0, 'mean_word_length': 3.731382978723404, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, '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': '2144340', 'n_tokens_mistral': 1512, 'n_tokens_neox': 1486, 'n_words': 325}