|
|
@@ -25,6 +25,7 @@ import org.springframework.test.util.ReflectionTestUtils;
|
|
|
import java.util.List;
|
|
|
import java.io.InputStream;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
+import java.lang.reflect.Field;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
@@ -120,6 +121,12 @@ class WaterFacilityQueryServiceTest {
|
|
|
pipe.setLayingYear(1998);
|
|
|
|
|
|
assertEquals(1998, WaterPipeExportDTO.from(pipe).getLayingYear());
|
|
|
+ try {
|
|
|
+ Field field = WaterPipeExportDTO.class.getDeclaredField("layingYear");
|
|
|
+ assertEquals("铺设年份", field.getAnnotation(com.zksy.common.annotation.Excel.class).name());
|
|
|
+ } catch (ReflectiveOperationException e) {
|
|
|
+ throw new AssertionError("layingYear must be an exported Excel field", e);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private static <T> Page<T> pageOf(T record) {
|