优化
This commit is contained in:
@@ -60,7 +60,10 @@ class LocalQualificationStorageTest {
|
||||
assertTrue(Files.isRegularFile(stored.path()));
|
||||
assertEquals(stored.path().toAbsolutePath(),
|
||||
storage.load(10001L, stored.fileName()).getFile().toPath().toAbsolutePath());
|
||||
assertThrows(BizException.class, () -> storage.load(10002L, stored.fileName()));
|
||||
BizException crossTenant = assertThrows(BizException.class,
|
||||
() -> storage.load(10002L, stored.fileName()));
|
||||
assertEquals(ResultCode.NOT_FOUND, crossTenant.getResultCode());
|
||||
assertEquals("File not found", crossTenant.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -111,9 +114,22 @@ class LocalQualificationStorageTest {
|
||||
|
||||
@Test
|
||||
void legacySeedPathCannotBePretendedToBeAStoredFile() {
|
||||
|
||||
assertThrows(BizException.class,
|
||||
BizException exception = assertThrows(BizException.class,
|
||||
() -> storage.load(10001L, "demo-business-license.jpg"));
|
||||
|
||||
assertEquals(ResultCode.NOT_FOUND, exception.getResultCode());
|
||||
assertEquals("File not found", exception.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
void missingQualificationReturnsNotFoundWithoutRevealingOwnership() {
|
||||
storage.initialize();
|
||||
|
||||
BizException exception = assertThrows(BizException.class,
|
||||
() -> storage.load(10001L, "00000000-0000-0000-0000-000000000000.pdf"));
|
||||
|
||||
assertEquals(ResultCode.NOT_FOUND, exception.getResultCode());
|
||||
assertEquals("File not found", exception.getMessage());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user