package dev.rheinsw.shared.rest;

import org.junit.jupiter.api.Test;
import org.springframework.web.client.RestTemplate;

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

class RestTemplateConfigTest {

    private final RestTemplateConfig restTemplateConfig = new RestTemplateConfig();

    @Test
    void mailRestTemplate_shouldReturnNonNullRestTemplate() {
        // Act
        RestTemplate restTemplate = restTemplateConfig.mailRestTemplate();

        // Assert
        assertNotNull(restTemplate, "RestTemplate should not be null");
    }

    @Test
    void mailRestTemplate_shouldCreateNewInstanceEachTime() {
        // Act
        RestTemplate restTemplate1 = restTemplateConfig.mailRestTemplate();
        RestTemplate restTemplate2 = restTemplateConfig.mailRestTemplate();

        // Assert
        assertNotSame(restTemplate1, restTemplate2, "Each call should create a new RestTemplate instance");
    }
}
