<commit_before>package org.sagebionetworks.bridge.crypto;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

import java.security.KeyPair;
import java.security.cert.X509Certificate;

import org.junit.Before;
import org.junit.Test;

import scala.actors.threadpool.Arrays;

public class BcCmsEncryptorTest {

    private CmsEncryptor encryptor;
    private CmsEncryptor decryptor;

    @Before
    public void before() throws Exception {
        KeyPair keyPair = KeyPairFactory.newRsa2048();
        CertificateFactory certFactory = new BcCertificateFactory();
        X509Certificate cert = certFactory.newCertificate(keyPair);
        encryptor = new BcCmsEncryptor(cert, keyPair.getPrivate());
        decryptor = new BcCmsEncryptor(cert, keyPair.getPrivate());
    }

    @Test
    public void test() throws Exception {
        String text = "some text";
        byte[] bytes = text.getBytes();
        byte[] encrypted = encryptor.encrypt(bytes);
        assertNotNull(encrypted);
        assertFalse(text.equals(new String(encrypted)));
        byte[] decrypted = encryptor.decrypt(encrypted);
        assertEquals(text, new String(decrypted));
    }

    @Test<commit_msg>Fix compilation error<commit_after>package org.sagebionetworks.bridge.crypto;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

import java.security.KeyPair;
import java.security.cert.X509Certificate;
import java.util.Arrays;

import org.junit.Before;
import org.junit.Test;

public class BcCmsEncryptorTest {

    private CmsEncryptor encryptor;
    private CmsEncryptor decryptor;

    @Before
    public void before() throws Exception {
        KeyPair keyPair = KeyPairFactory.newRsa2048();
        CertificateFactory certFactory = new BcCertificateFactory();
        X509Certificate cert = certFactory.newCertificate(keyPair);
        encryptor = new BcCmsEncryptor(cert, keyPair.getPrivate());
        decryptor = new BcCmsEncryptor(cert, keyPair.getPrivate());
    }

    @Test
    public void test() throws Exception {
        String text = "some text";
        byte[] bytes = text.getBytes();
        byte[] encrypted = encryptor.encrypt(bytes);
        assertNotNull(encrypted);
        assertFalse(text.equals(new String(encrypted)));
        byte[] decrypted = encryptor.decrypt(encrypted);
        assertEquals(text, new String(decrypted));
    }

    @Test
{'fraction_non_alphanumeric': 0.096390321301071, 'fraction_numerical': 0.007933359777865925, 'mean_word_length': 3.731707317073171, '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': '3108201', 'n_tokens_mistral': 747, 'n_tokens_neox': 717, 'n_words': 161}