package cn.yunzhixue.ability.center.examsprint.configuration;

import cn.yunzhixue.ability.center.examsprint.application.report.ExamSprintReportProperties;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class ExamSprintReportRuntimeConfigurationTest {

    @Test
    void examSprintReportPropertiesCopiesStorageDownloadUrlPrefixFromBoundProperties() {
        ExamSprintReportRuntimeConfiguration configuration = new ExamSprintReportRuntimeConfiguration();
        ExamSprintReportRuntimeConfiguration.BoundExamSprintReportProperties bound =
                new ExamSprintReportRuntimeConfiguration.BoundExamSprintReportProperties();
        bound.getStorage().setDownloadUrlPrefix("https://dcjxbtest.blob.core.chinacloudapi.cn");

        ExamSprintReportProperties properties = configuration.examSprintReportProperties(bound);

        assertThat(properties.getStorage().getDownloadUrlPrefix())
                .isEqualTo("https://dcjxbtest.blob.core.chinacloudapi.cn");
    }
}
