| | |
| | | package com.zy.core.network.real; |
| | | |
| | | import com.zy.core.model.StationObjModel; |
| | | import org.junit.jupiter.api.Test; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import static org.junit.jupiter.api.Assertions.assertEquals; |
| | | |
| | |
| | | |
| | | assertEquals("扫码异常;急停;路径查询异常;", merged); |
| | | } |
| | | |
| | | @Test |
| | | void sortStationObjModelsByStationIdShouldSortAscending() { |
| | | List<StationObjModel> sorted = ZyStationV4RealConnect.sortStationObjModelsByStationId(Arrays.asList( |
| | | station(107), |
| | | station(101), |
| | | station(104) |
| | | )); |
| | | |
| | | assertEquals(101, sorted.get(0).getStationId()); |
| | | assertEquals(104, sorted.get(1).getStationId()); |
| | | assertEquals(107, sorted.get(2).getStationId()); |
| | | } |
| | | |
| | | private static StationObjModel station(Integer stationId) { |
| | | StationObjModel model = new StationObjModel(); |
| | | model.setStationId(stationId); |
| | | return model; |
| | | } |
| | | } |