update attachment & post

This commit is contained in:
jooho
2021-11-02 17:15:27 +09:00
parent 06975932b6
commit c50df972e9
13 changed files with 229 additions and 90 deletions

View File

@@ -156,40 +156,5 @@ class AttachmentRepositoryTest {
System.out.println(byId.get());
}
@Test
public void 중복된유니크인덱스_오류() throws Exception {
//given
String code = UUID.randomUUID().toString();
String uniqueId = UUID.randomUUID().toString();
AttachmentId attachmentId1 = AttachmentId.builder()
.code(code)
.seq(1L).build();
Attachment attachment1 = Attachment.builder()
.attachmentId(attachmentId1)
.uniqueId(uniqueId)
.originalFileName("test1.png")
.physicalFileName(UUID.randomUUID().toString())
.size(1232L)
.build();
AttachmentId attachmentId2 = AttachmentId.builder()
.code(code)
.seq(2L)
.build();
Attachment attachment2 = Attachment.builder()
.attachmentId(attachmentId2)
.uniqueId(uniqueId)
.originalFileName("test2.png")
.physicalFileName(UUID.randomUUID().toString())
.size(1232L)
.build();
//when
attachmentRepository.save(attachment1);
attachmentRepository.save(attachment2);
//then
}
}