unit test for url redirect

This commit is contained in:
Relex
2015-09-14 11:29:16 +08:00
parent 1c7cb32a97
commit 8263814aea

View File

@@ -1,16 +1,14 @@
package com.danikula.videocache;
import com.danikula.videocache.test.BuildConfig;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import static com.danikula.videocache.support.ProxyCacheTestUtils.ASSETS_DATA_BIG_NAME;
import static com.danikula.videocache.support.ProxyCacheTestUtils.ASSETS_DATA_NAME;
import static com.danikula.videocache.support.ProxyCacheTestUtils.HTTP_DATA_BIG_SIZE;
@@ -67,4 +65,9 @@ public class HttpUrlSourceTest {
assertThat(new HttpUrlSource("http://mysite.by/video.mp4").getMime()).isEqualTo("video/mp4");
assertThat(new HttpUrlSource(HTTP_DATA_URL).getMime()).isEqualTo("image/jpeg");
}
@Test
public void testHttpUrlSourceRedirect() throws Exception {
assertThat(new HttpUrlSource("http://goo.gl/K0gWQW").getMime()).isEqualTo("video/mp4");
}
}