<commit_before>package com.balancedpayments;

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import com.balancedpayments.errors.APIError;
import com.balancedpayments.errors.DuplicateAccountEmailAddress;
import com.balancedpayments.errors.HTTPError;
import com.balancedpayments.errors.MultipleResultsFound;
import com.balancedpayments.errors.NoResultsFound;
import com.balancedpayments.errors.NotCreated;

public class MarketplaceTest extends BaseTest {

    @Test(expected = APIError.class)
    public void testDoubleCreate() throws HTTPError {
        Marketplace marketplace2 = new Marketplace();
        marketplace2.save();
    }

    @Test
    public void testMine() throws HTTPError, NoResultsFound, MultipleResultsFound {
        Marketplace mine = Marketplace.mine();
        assertEquals(mine.id, mp.id);
    }

    @Test
    public void testOwner() throws HTTPError, NoResultsFound, MultipleResultsFound {
        Marketplace mine = Marketplace.mine();
        assertNotNull(mine.owner_customer);
    }

    @Test
    public void testMarketplaceResourceFields() throws HTTPError,
            NoResultsFound, MultipleResultsFound{
        Marketplace marketplace = Marketplace.mine();

        assertEquals(marketplace.domain_url, "example.com");
        assertEquals(marketplace.name, "Test Marketplace");
        assertTrue(marketplace.owner_customer instanceof Customer);
        assertEquals(marketplace.support_email_address, "<EMAIL>");
        assertEquals(marketplace.support_phone_number, "+16505551234");
        assertNotNull(marketplace.created_at);
        assertNotNull(marketplace.updated_at);
        assertFalse(marketplace.production);
        assertEquals(marketplace.in_escrow.toString(), "0");
        assertEquals(marketplace.unsettled_fees.toString(), "0");
        assertTrue(marketplace.href.contains("/marketplaces/TEST-MP"));
        assertTrue(marketplace.id.startsWith("TEST-MP"));
        assertTrue(marketplace.bank_accounts instanceof BankAccount.Collection);
        assertTrue(marketplace.cards instanceof Card.Collection);
        assertTrue(marketplace.credits instanceof Credit.Collection);
        assertTrue(marketplace.debits instanceof Debit.Collection);
        assertTrue(marketplace.disputes instanceof Dispute.Collection);
        assertTrue(marketplace.orders instanceof Order.Collection);
        assertTrue(marketplace.refunds instanceof Refund.Collection);
        assertTrue(marketplace.reversals instanceof Reversal.Collection);<commit_msg>inValue<commit_after>package com.balancedpayments;

import static org.junit.Assert.*;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import com.balancedpayments.errors.APIError;
import com.balancedpayments.errors.DuplicateAccountEmailAddress;
import com.balancedpayments.errors.HTTPError;
import com.balancedpayments.errors.MultipleResultsFound;
import com.balancedpayments.errors.NoResultsFound;
import com.balancedpayments.errors.NotCreated;

public class MarketplaceTest extends BaseTest {

    @Test(expected = APIError.class)
    public void testDoubleCreate() throws HTTPError {
        Marketplace marketplace2 = new Marketplace();
        marketplace2.save();
    }

    @Test
    public void testMine() throws HTTPError, NoResultsFound, MultipleResultsFound {
        Marketplace mine = Marketplace.mine();
        assertEquals(mine.id, mp.id);
    }

    @Test
    public void testOwner() throws HTTPError, NoResultsFound, MultipleResultsFound {
        Marketplace mine = Marketplace.mine();
        assertNotNull(mine.owner_customer);
    }

    @Test
    public void testMarketplaceResourceFields() throws HTTPError,
            NoResultsFound, MultipleResultsFound{
        Marketplace marketplace = Marketplace.mine();

        assertEquals(marketplace.domain_url, "example.com");
        assertEquals(marketplace.name, "Test Marketplace");
        assertTrue(marketplace.owner_customer instanceof Customer);
        assertEquals(marketplace.support_email_address, "<EMAIL>");
        assertEquals(marketplace.support_phone_number, "+16505551234");
        assertNotNull(marketplace.created_at);
        assertNotNull(marketplace.updated_at);
        assertFalse(marketplace.production);
        assertEquals(marketplace.in_escrow.intValue(), 0);
        assertEquals(marketplace.unsettled_fees.intValue(), 0);
        assertTrue(marketplace.href.contains("/marketplaces/TEST-MP"));
        assertTrue(marketplace.id.startsWith("TEST-MP"));
        assertTrue(marketplace.bank_accounts instanceof BankAccount.Collection);
        assertTrue(marketplace.cards instanceof Card.Collection);
        assertTrue(marketplace.credits instanceof Credit.Collection);
        assertTrue(marketplace.debits instanceof Debit.Collection);
        assertTrue(marketplace.disputes instanceof Dispute.Collection);
        assertTrue(marketplace.orders instanceof Order.Collection);
        assertTrue(marketplace.refunds instanceof Refund.Collection);
        assertTrue(marketplace.reversals instanceof Reversal.Collection);
{'fraction_non_alphanumeric': 0.09182487407981403, 'fraction_numerical': 0.00581170089112747, 'mean_word_length': 4.252288911495422, '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': '4437755', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1331, 'n_words': 245}