package com.ruoyi.web.modules.booking.service.impl;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import com.ruoyi.web.modules.farming.mapper.BizServiceAppointmentReviewMapper;
import com.ruoyi.web.modules.farming.mapper.BizTechResourceMapper;

@ExtendWith(MockitoExtension.class)
@DisplayName("ExpertRatingSyncServiceImpl")
class ExpertRatingSyncServiceImplTest
{
    @Mock
    private BizServiceAppointmentReviewMapper bizServiceAppointmentReviewMapper;

    @Mock
    private BizTechResourceMapper bizTechResourceMapper;

    @InjectMocks
    private ExpertRatingSyncServiceImpl service;

    @Test
    @DisplayName("委托批量重算")
    void syncAll()
    {
        when(bizServiceAppointmentReviewMapper.selectExpertProviderIdsForRatingSync())
                .thenReturn(java.util.Collections.singletonList(1L));
        when(bizServiceAppointmentReviewMapper.selectExpertRatingScoreByProviderId(1L))
                .thenReturn(new java.math.BigDecimal("12.0"));
        assertEquals(1, service.syncAllExpertRatings());
    }
}
