二期内容提交
This commit is contained in:
+12
@@ -40,4 +40,16 @@ class InternalMeasurementImageControllerTest {
|
||||
.isInstanceOf(BizException.class)
|
||||
.hasMessageContaining("凭证无效");
|
||||
}
|
||||
@Test
|
||||
void 内部下载同时校验租户入库单和文件ID() {
|
||||
when(images.download(11L, 21L, 41L)).thenReturn(
|
||||
new MeasurementImageService.Download("measure.png", MediaType.IMAGE_PNG_VALUE,
|
||||
new byte[]{1, 2, 3}));
|
||||
|
||||
var response = controller.download("internal-token", 11L, 21L, 41L);
|
||||
|
||||
assertThat(response.getHeaders().getContentType()).isEqualTo(MediaType.IMAGE_PNG);
|
||||
assertThat(response.getBody()).containsExactly(1, 2, 3);
|
||||
verify(images).download(11L, 21L, 41L);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user