优化
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package com.baiyue.firstleg.outbound.dispatch;
|
||||
|
||||
import com.baiyue.firstleg.outbound.dispatch.mapper.OutboundDispatchReadMapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class OutboundDispatchReadMapperContractTest {
|
||||
@Test
|
||||
void pickTaskQueryOrdersByTheSchemaStartedAtColumn() throws Exception {
|
||||
String sql = OutboundDispatchReadMapper.class.getMethod("pick", long.class)
|
||||
.getAnnotation(Select.class).value()[0];
|
||||
|
||||
assertThat(sql)
|
||||
.contains("ORDER BY started_at DESC,id DESC")
|
||||
.doesNotContain("created_at");
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -9,9 +9,7 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@SpringJUnitConfig(MeasurementSubmissionService.class)
|
||||
@@ -37,7 +35,7 @@ class MeasurementSubmissionServiceTest {
|
||||
|
||||
assertThat(service.submit(10001L, 88L, 9L, request)).isSameAs(submitted);
|
||||
|
||||
verifyNoInteractions(locations);
|
||||
verify(locations).occupy(10001L, 88L, 9L, 30L, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -47,6 +45,6 @@ class MeasurementSubmissionServiceTest {
|
||||
30L, 3, "MEASURE_PENDING", "PENDING", "STANDARD", null, null, null);
|
||||
when(measurements.submit(10001L, 88L, 9L, request)).thenReturn(submitted);
|
||||
assertThat(service.submit(10001L, 88L, 9L, request)).isSameAs(submitted);
|
||||
verifyNoInteractions(locations);
|
||||
verify(locations).occupy(10001L, 88L, 9L, 30L, 3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user