Newer
Older
sendgrid-api / src / test / java / io / ljunggren / sendgrid / api / model / StatisticsTest.java
@Alex Ljunggren Alex Ljunggren on 8 Nov 2025 709 bytes Initial commit
package io.ljunggren.sendgrid.api.model;

import static org.junit.jupiter.api.Assertions.*;

import java.io.IOException;
import java.util.List;

import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;

import io.ljunggren.json.utils.JsonUtils;

class StatisticsTest {

    private String readFromResources(String file) throws IOException {
        return IOUtils.toString(this.getClass().getResourceAsStream(file), "UTF-8");
    }

	@Test
	void instantiateTest() throws IOException {
		String json = readFromResources("/io/ljunggren/sendgrid/api/model/stats.json");
		List<Statistics> statisticses = JsonUtils.jsonToList(json, Statistics.class);
		assertEquals(2, statisticses.size());
	}

}