<commit_before>package org.ccci.gto.android.common.jsonapi.retrofit2;

import android.text.TextUtils;

import org.ccci.gto.android.common.testing.CommonMocks;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;

@RunWith(PowerMockRunner.class)
@PrepareForTest({TextUtils.class})
public class JsonApiParamsTest {
    @Before
    public void setup() throws Exception {
        CommonMocks.mockTextUtils();
    }

    @Test
    public void verifyInclude() throws Exception {
        final JsonApiParams params = new JsonApiParams();
        params.put("param1", "value");
        params.include("a", "a.b", "c");

        assertThat(params.size(), is(2));
        assertThat(params.get("param1"), is("value"));
        assertThat(params.get(JsonApiParams.PARAM_INCLUDE), is("a,a.b,c"));
        assertThat(params.get("param2"), is(nullValue()));

        // make sure other params don't interfere with the include param
        params.put("param2", "value");
        assertThat(params.size(), is(3));<commit_msg>JsonApiParams no longer uses TextUtils, so no need to mock it<commit_after>package org.ccci.gto.android.common.jsonapi.retrofit2;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;

public class JsonApiParamsTest {
    @Test
    public void verifyInclude() throws Exception {
        final JsonApiParams params = new JsonApiParams();
        params.put("param1", "value");
        params.include("a", "a.b", "c");

        assertThat(params.size(), is(2));
        assertThat(params.get("param1"), is("value"));
        assertThat(params.get(JsonApiParams.PARAM_INCLUDE), is("a,a.b,c"));
        assertThat(params.get("param2"), is(nullValue()));

        // make sure other params don't interfere with the include param
        params.put("param2", "value");
        assertThat(params.size(), is(3));
{'fraction_non_alphanumeric': 0.13671344499773652, 'fraction_numerical': 0.006790402897238569, 'mean_word_length': 4.011337868480726, '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': '6083388', 'n_tokens_mistral': 671, 'n_tokens_neox': 665, 'n_words': 138}