1 package com.acumenvelocity.ath.integration;
2
3 import com.fasterxml.jackson.databind.JsonNode;
4 import org.junit.jupiter.api.Test;
5
6 import static org.junit.jupiter.api.Assertions.*;
7
8 public class TestEncodings_IT extends BaseIntegrationTest {
9
10 @Test
11 public void testGetEncodings() throws Exception {
12 HttpResponse response = sendGetRequest("/encodings");
13
14 assertEquals(200, response.getStatusCode(), "Expected HTTP 200");
15
16 JsonNode json = parseJson(response.getBody());
17 assertTrue(json.has("encodings"), "Response should have 'encodings' field");
18
19 JsonNode encodings = json.get("encodings");
20 assertTrue(encodings.isArray(), "Encodings should be an array");
21 assertTrue(encodings.size() > 0, "Encodings array should not be empty");
22
23
24 JsonNode firstEncoding = encodings.get(0);
25 assertTrue(firstEncoding.has("name"), "Encoding should have 'name' field");
26 assertTrue(firstEncoding.has("iana_name"), "Encoding should have 'iana_name' field");
27 assertTrue(firstEncoding.has("code_page"), "Encoding should have 'code_page' field");
28
29 System.out.println("Found " + encodings.size() + " encodings");
30 }
31 }