package be.iminds.ilabt.jfed.util;

import org.testng.annotations.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

public class DataConversionUtilsTest {

    @Test
    public void testCompressFromBase64() throws Exception {
        String orig = "This is a test. This is a test. This is a test. This is a test. This is a test.";
        String compressed = DataConversionUtils.compressToBase64(orig);
        String reconstructed = DataConversionUtils.decompressFromBase64(compressed);
        assertThat(orig, not(isEmptyString()));
        assertThat(compressed, not(isEmptyString()));
        assertThat(reconstructed, not(isEmptyString()));
        assertThat(orig, equalTo(reconstructed));
    }
}