<commit_before>package com.novoda.downloadmanager.lib;

import org.junit.Test;

import static org.fest.assertions.api.Assertions.assertThat;

public class DownloadInfoTest {

    private static final DownloadClientReadyChecker IS_READY = new DownloadClientReadyChecker() {
        @Override
        public boolean isAllowedToDownload(DownloadBatch downloadBatch) {
            return true;
        }
    };

    private static final DownloadClientReadyChecker IS_NOT_READY = new DownloadClientReadyChecker() {
        @Override
        public boolean isAllowedToDownload(DownloadBatch downloadBatch) {
            return false;
        }
    };

    @Test
    public void givenClientIsReadyToDownloadThenStartDownload() {
        DownloadInfo downloadInfo = new DownloadInfo(
                null,
                null,
                null,
                null,
                null,
                IS_READY,
                null);

        boolean isReady = downloadInfo.isReadyToDownload(null);

        assertThat(isReady).isTrue();
    }

    @Test
    public void givenClientIsNotReadyToDownloadThenDownloadDoesNotStart() {
        DownloadInfo downloadInfo = new DownloadInfo(
                null,
                null,
                null,
                null,
                null,
                IS_NOT_READY,
                null);

        boolean isReady = downloadInfo.isReadyToDownload(null);

        assertThat(isReady).isFalse();
    }
}

<commit_msg>applying api change to tests<commit_after>package com.novoda.downloadmanager.lib;

import org.junit.Test;

import static org.fest.assertions.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

public class DownloadInfoTest {

    private static final DownloadClientReadyChecker IS_READY = new DownloadClientReadyChecker() {
        @Override
        public boolean isAllowedToDownload(Download download) {
            return true;
        }
    };

    private static final DownloadClientReadyChecker IS_NOT_READY = new DownloadClientReadyChecker() {
        @Override
        public boolean isAllowedToDownload(Download download) {
            return false;
        }
    };

    @Test
    public void givenClientIsReadyToDownloadThenStartDownload() {
        DownloadInfo downloadInfo = new DownloadInfo(
                null,
                null,
                null,
                null,
                null,
                IS_READY,
                null);

        boolean isReady = downloadInfo.isReadyToDownload(mock(DownloadBatch.class));

        assertThat(isReady).isTrue();
    }

    @Test
    public void givenClientIsNotReadyToDownloadThenDownloadDoesNotStart() {
        DownloadInfo downloadInfo = new DownloadInfo(
                null,
                null,
                null,
                null,
                null,
                IS_NOT_READY,
                null);

        boolean isReady = downloadInfo.isReadyToDownload(mock(DownloadBatch.class));

        assertThat(isReady).isFalse();
    }
}


{'fraction_non_alphanumeric': 0.06541129831516353, 'fraction_numerical': 0.0, 'mean_word_length': 1.9541463414634146, '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': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5109165', 'n_tokens_mistral': 767, 'n_tokens_neox': 735, 'n_words': 159}