package cz.senslog.connector.push.rest.senslog.v1;

import cz.senslog.connector.model.config.DefaultConfig;
import cz.senslog.connector.push.api.ConnectorPushProvider;
import cz.senslog.connector.push.api.ConnectorPusher;
import org.junit.jupiter.api.Test;

import java.util.HashMap;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

class SenslogV1ConnectorPushProviderTest {

    @Test
    void createPusher_NewInstance_True() {

        DefaultConfig defaultConfig = new DefaultConfig("senslog", null);
        defaultConfig.setProperty("host", new HashMap<String, String>(){{
            put("domain", "http://test.com");
            put("path", "test");
        }});

        ConnectorPushProvider provider = new SenslogV1ConnectorPushProvider();
        ConnectorPusher pusher = provider.createPusher(defaultConfig);

        assertNotNull(pusher);
        assertEquals(SenslogV1Pusher.class, pusher.getClass());
    }
}