// Path: src/test/java/com/lob/BaseTest.java
// public class BaseTest {
// 
//     @BeforeClass
//     public static void beforeClass() {
//         Lob.init(System.getenv("LOB_API_KEY"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/net/LobResponse.java
// public class LobResponse<T> {
// 
//     int responseCode;
//     T responseBody;
//     Map<String, List<String>> responseHeaders;
// 
//     public LobResponse(int responseCode, T responseBody) {
//         this.responseCode = responseCode;
//         this.responseBody = responseBody;
//         this.responseHeaders = null;
//     }
// 
//     public LobResponse(int responseCode, T responseBody, Map<String, List<String>> responseHeaders) {
//         this.responseCode = responseCode;
//         this.responseBody = responseBody;
//         this.responseHeaders = responseHeaders;
//     }
// 
//     public int getResponseCode() {
//         return responseCode;
//     }
// 
//     public T getResponseBody() {
//         return responseBody;
//     }
// 
//     public Map<String, List<String>> getResponseHeaders() {
//         return responseHeaders;
//     }
// }


import com.lob.BaseTest;
import com.lob.net.LobResponse;
import org.junit.Test;
import java.io.File;
import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.*;
package com.lob.model;




public class SelfMailerTest extends BaseTest {

    @Test
    public void testListSelfMailers() throws Exception {
        LobResponse<SelfMailerCollection> response = SelfMailer.list();

        assertEquals(200, response.getResponseCode());
        assertTrue(response.getResponseBody().getCount() > 0);
        assertThat(response.getResponseBody().getData().get(0), instanceOf(SelfMailer.class));
    }

    @Test
    public void testListSelfMailersWithParams() throws Exception {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("limit", 1);

        LobResponse<SelfMailerCollection> response = SelfMailer.list(params);

        assertEquals(200, response.getResponseCode());
        assertEquals(1, response.getResponseBody().getCount());
        assertThat(response.getResponseBody().getData().get(0), instanceOf(SelfMailer.class));
    }

    @Test
    public void testListSelfMailersWithMetadata() throws Exception {
        Map<String, String> metadata = new HashMap<String, String>();
        metadata.put("campaign", "LOB-TEST");

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("metadata", metadata);

// Path: src/test/java/com/lob/BaseTest.java
// public class BaseTest {
// 
//     @BeforeClass
//     public static void beforeClass() {
//         Lob.init(System.getenv("LOB_API_KEY"));
//     }
// 
// }
// 
// Path: src/main/java/com/lob/net/LobResponse.java
// public class LobResponse<T> {
// 
//     int responseCode;
//     T responseBody;
//     Map<String, List<String>> responseHeaders;
// 
//     public LobResponse(int responseCode, T responseBody) {
//         this.responseCode = responseCode;
//         this.responseBody = responseBody;
//         this.responseHeaders = null;
//     }
// 
//     public LobResponse(int responseCode, T responseBody, Map<String, List<String>> responseHeaders) {
//         this.responseCode = responseCode;
//         this.responseBody = responseBody;
//         this.responseHeaders = responseHeaders;
//     }
// 
//     public int getResponseCode() {
//         return responseCode;
//     }
// 
//     public T getResponseBody() {
//         return responseBody;
//     }
// 
//     public Map<String, List<String>> getResponseHeaders() {
//         return responseHeaders;
//     }
// }


// Path: src/test/java/com/lob/model/SelfMailerTest.java
import com.lob.BaseTest;
import com.lob.net.LobResponse;
import org.junit.Test;
import java.io.File;
import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.*;

package com.lob.model;




public class SelfMailerTest extends BaseTest {

    @Test
    public void testListSelfMailers() throws Exception {
        LobResponse<SelfMailerCollection> response = SelfMailer.list();

        assertEquals(200, response.getResponseCode());
        assertTrue(response.getResponseBody().getCount() > 0);
        assertThat(response.getResponseBody().getData().get(0), instanceOf(SelfMailer.class));
    }

    @Test
    public void testListSelfMailersWithParams() throws Exception {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("limit", 1);

        LobResponse<SelfMailerCollection> response = SelfMailer.list(params);

        assertEquals(200, response.getResponseCode());
        assertEquals(1, response.getResponseBody().getCount());
        assertThat(response.getResponseBody().getData().get(0), instanceOf(SelfMailer.class));
    }

    @Test
    public void testListSelfMailersWithMetadata() throws Exception {
        Map<String, String> metadata = new HashMap<String, String>();
        metadata.put("campaign", "LOB-TEST");

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("metadata", metadata);

        LobResponse<SelfMailer> createResponse = new SelfMailer.RequestBuilder()