<commit_before>package net.dean.jraw.test.auth;

import net.dean.jraw.ApiException;
import net.dean.jraw.OAuth2RedditClient;
import net.dean.jraw.http.Credentials;
import net.dean.jraw.http.NetworkException;
import org.testng.annotations.Test;

public class OAuth2Test extends AuthenticatedRedditTest {
    private OAuth2RedditClient redditOAuth;

    public OAuth2Test() {
        this.redditOAuth = new OAuth2RedditClient(getUserAgent(getClass()));
    }

    @Test
    public void testLoginScript() {
        Credentials creds = getCredentials();
        try {
            validateModel(redditOAuth.login(Credentials.oauth2Script(
                    creds.getUsername(),
                    creds.getPassword(),
                    creds.getClientId(),
                    creds.getClientSecret())));
        } catch (NetworkException | ApiException e) {
            handle(e);
        }
    }
}<commit_msg>Simplify OAuth2Test login<commit_after>package net.dean.jraw.test.auth;

import net.dean.jraw.ApiException;
import net.dean.jraw.OAuth2RedditClient;
import net.dean.jraw.http.NetworkException;
import org.testng.annotations.Test;

public class OAuth2Test extends AuthenticatedRedditTest {
    private OAuth2RedditClient redditOAuth;

    public OAuth2Test() {
        this.redditOAuth = new OAuth2RedditClient(getUserAgent(getClass()));
        try {
            redditOAuth.login(getCredentials());
        } catch (NetworkException | ApiException e) {
            handle(e);
        }
    }

    @Test
    public void testLoginScript() {
        try {
            redditOAuth.logout();
            validateModel(redditOAuth.login(getCredentials()));
        } catch (NetworkException | ApiException e) {
            handle(e);
        }
    }
}
{'fraction_non_alphanumeric': 0.09851936218678815, 'fraction_numerical': 0.00683371298405467, 'mean_word_length': 2.6528066528066527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2398750', 'n_tokens_mistral': 524, 'n_tokens_neox': 529, 'n_words': 87}