package com.easyagents.store.milvus;

import org.junit.Assert;
import org.junit.Test;

public class MilvusVectorStoreConfigTest {

    @Test
    public void testUriIsRequired() {
        MilvusVectorStoreConfig config = new MilvusVectorStoreConfig();
        Assert.assertFalse(config.checkAvailable());
    }

    @Test
    public void testUriOnlyIsAvailable() {
        MilvusVectorStoreConfig config = new MilvusVectorStoreConfig();
        config.setUri("http://127.0.0.1:19530");
        Assert.assertTrue(config.checkAvailable());
    }

    @Test
    public void testTokenModeIsAvailable() {
        MilvusVectorStoreConfig config = new MilvusVectorStoreConfig();
        config.setUri("http://127.0.0.1:19530");
        config.setToken("root:Milvus");
        Assert.assertTrue(config.checkAvailable());
    }

    @Test
    public void testUsernamePasswordModeIsAvailable() {
        MilvusVectorStoreConfig config = new MilvusVectorStoreConfig();
        config.setUri("http://127.0.0.1:19530");
        config.setUsername("root");
        config.setPassword("Milvus");
        Assert.assertTrue(config.checkAvailable());
    }
}
