package com.cf.imes.module.system.controller.admin.oauth2;

import com.cf.imes.framework.es.core.service.ESDocumentService;
import com.cf.imes.framework.test.core.ut.BaseMockitoUnitTest;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import jakarta.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;

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

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class EsTest extends BaseMockitoUnitTest {

    @Resource
    private ESDocumentService esDocumentService;

    @Test
    public void t1() throws IOException {
        HashMap test2 = esDocumentService.getById("test2", "145116052710363136", HashMap.class);
        assertNotNull(test2);
        System.out.println(test2);
    }

    @Test
    public void d1() throws IOException {
        Boolean delete = esDocumentService.deleteById("t1", "145125592260546560");
        assertTrue(delete);
    }


}
