package model;

import org.junit.Test;

import static org.junit.Assert.assertNotNull;

/**
 * Tests {@link FileLink FileLink} class.
 */
public class TestFileLink {
    private static final String API_KEY = "XXXXXXXXXXXXXXXXXXXXXXX";
    private static final String HANDLE = "XXXXXXXXXXXXXXXXXXXXX";

    @Test
    public void testInstantiation() {
        FileLink fileLink = new FileLink(API_KEY, HANDLE);
        assertNotNull("Unable to create FileLink", fileLink);
    }
}

@@ -21,21 +21,212 @@
 rt o
-rg.junit.Test
+khttp3.OkHttpClient;%0Aimport okhttp3.ResponseBody;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport util.Networking;%0Aimport util.MockInterceptor;%0A%0Aimport java.io.File;%0Aimport java.io.IOException
 ;%0A%0Ai
@@ -269,16 +269,59 @@
 NotNull;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0A/**%0A *
@@ -439,31 +439,20 @@
  = %22
-XXXXXXXXXXXXXXXXXXXXXXX
+TEST_API_KEY
 %22;%0A 
@@ -496,206 +496,1492 @@
  = %22
-XXXXXXXXXXXXXXXXXXXXX%22;%0A%0A    @Test%0A    public void testInstantiation() %7B%0A        FileLink fileLink = new FileLink(API_KEY, HANDLE);%0A        assertNotNull(%22Unable to create FileLink%22, fileLink);%0A    %7D
+TEST_FILE_HANDLE%22;%0A%0A    private static final String DIRECTORY = %22/tmp/%22;%0A    private static final String CUSTOM_FILENAME = %22filestack_test_custom_filename.txt%22;%0A%0A    /**%0A     * Set a custom httpClient for our testing.%0A     * This custom client has an added interceptor to create mock responses.%0A     */%0A    @BeforeClass%0A    public static void setup() %7B%0A        OkHttpClient httpClient = new OkHttpClient.Builder()%0A                .addInterceptor(new MockInterceptor())%0A                .build();%0A        Networking.setHttpClient(httpClient);%0A    %7D%0A%0A    @Test%0A    public void testInstantiation() %7B%0A        FileLink fileLink = new FileLink(API_KEY, HANDLE);%0A        assertNotNull(%22Unable to create FileLink%22, fileLink);%0A    %7D%0A%0A    @Test%0A    public void testGetContent() throws IOException %7B%0A        FileLink fileLink = new FileLink(API_KEY, HANDLE);%0A%0A        ResponseBody body = fileLink.getContent();%0A        String text = body.string();%0A        assertTrue(%22Unexpected content in response%22, text.contains(%22Test content%22));%0A    %7D%0A%0A    @Test%0A    public void testDownload() throws IOException %7B%0A        FileLink fileLink = new FileLink(API_KEY, HANDLE);%0A%0A        File file = fileLink.download(DIRECTORY);%0A        assertTrue(file.isFile());%0A    %7D%0A%0A    @Test%0A    public void testDownloadCustomFilename() throws IOException %7B%0A        FileLink fileLink = new FileLink(API_KEY, HANDLE);%0A        File file = fileLink.download(DIRECTORY, CUSTOM_FILENAME);%0A        assertTrue(file.isFile());%0A    %7D%0A
 %0A%7D%0A

Add tests for download() and getContent() methods.