package com.navercorp.utilset.string;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowLog;

/**
 * @author jaemin.woo
 *
 */
@RunWith(RobolectricTestRunner.class)
@Config(manifest=Config.NONE)
public class CompressUtilsTest {
	private static String LONG_LONG_STRING = "qwertyuiopassdfghjklxcvbnm!@#$%^&*()";

	@Before
	public void setUp() {
		ShadowLog.stream = System.out;
	}

	@Test
	public void shouldCompressString() {
		String compressed = CompressUtils.compressString(LONG_LONG_STRING);
		assertThat(compressed, is(not(LONG_LONG_STRING)));
	}
	
	@Test
	public void shouoldRestoreCompressedStringToOriginalString() {
		String compressed = CompressUtils.compressString(LONG_LONG_STRING);
		assertThat(compressed, is(not(LONG_LONG_STRING)));
		
		String restored = CompressUtils.decompressString(compressed);
		assertThat(restored, is(not(compressed)));
		assertEquals(LONG_LONG_STRING, restored);
	}
}

@@ -68,18 +68,17 @@
 atchers.
-is
+*
 ;%0Aimport
@@ -109,101 +109,16 @@
 cher
-s.not;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertThat
+Assert.*
 ;%0A%0Ai
@@ -811,17 +811,16 @@
 oid shou
-o
 ldRestor
@@ -1104,13 +1104,24 @@
 sert
-Equal
+That(restored, i
 s(LO
@@ -1138,20 +1138,13 @@
 RING
-, restored);
+));%09%09
 %0A%09%7D%0A

Fix typo in SystemUtilsTest