Skip to content
Snippets Groups Projects
Commit 5741fa7d authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6810 fix naming

parent b7f9cd7f
No related branches found
No related tags found
1 merge request!4Revert "OZG-6810 [tmp] update version"
......@@ -351,8 +351,8 @@ class PostfachMailITCase {
var mails = callGrpcListEndpoint();
assertThat(mails).hasSize(1);
var binaryFiles = loadAttachments(mails.getFirst());
assertThat(binaryFiles).hasSize(1).first().extracting(OzgCloudFile::getContentType)
var ozgCloudFiles = loadAttachments(mails.getFirst());
assertThat(ozgCloudFiles).hasSize(1).first().extracting(OzgCloudFile::getContentType)
.isEqualTo("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
}
......
......@@ -42,7 +42,7 @@ public class TestConfiguration {
}
@Bean
OzgCloudFileTestUtil binaryFileTestUtil(MongoOperations mongoOperations, GridFsTemplate gridFsTemplate) {
OzgCloudFileTestUtil ozgCloudFileTestUtil(MongoOperations mongoOperations, GridFsTemplate gridFsTemplate) {
return new OzgCloudFileTestUtil(mongoOperations, gridFsTemplate);
}
}
\ No newline at end of file
......@@ -165,7 +165,7 @@ class CollaborationITCase {
void shouldReturnStoredSmallFile() {
var fileId = ozgCloudFileTestUtil.saveOzgCloudFile().getId();
var file = downloadBinaryFile(fileId);
var file = downloadOzgCloudFile(fileId);
assertThat(file).hasSameSizeAs(OzgCloudFileTestFactory.CONTENT).isEqualTo(OzgCloudFileTestFactory.CONTENT);
}
......@@ -175,7 +175,7 @@ class CollaborationITCase {
var content = OzgCloudFileTestFactory.createContentInByte(FileService.CHUNK_SIZE);
var fileId = ozgCloudFileTestUtil.saveOzgCloudFile(content).getId();
var file = downloadBinaryFile(fileId);
var file = downloadOzgCloudFile(fileId);
assertThat(file).hasSameSizeAs(content).isEqualTo(content);
}
......@@ -185,12 +185,12 @@ class CollaborationITCase {
var input = OzgCloudFileTestFactory.createContentInMiB(5);
var fileId = ozgCloudFileTestUtil.saveOzgCloudFile(input).getId();
var downloadedFile = downloadBinaryFile(fileId);
var downloadedFile = downloadOzgCloudFile(fileId);
assertThat(downloadedFile).hasSameSizeAs(input).isEqualTo(input);
}
private byte[] downloadBinaryFile(String fileId) {
private byte[] downloadOzgCloudFile(String fileId) {
var request = GrpcGetFileContentRequest.newBuilder().setId(fileId).build();
var it = getServiceStub().getFileContent(request);
var content = new ByteArrayOutputStream();
......
......@@ -78,15 +78,15 @@ class M013_CreateOzgCloudFileCollectionTest { // NOSONAR
void shouldMigrateMetadata() {
migration.doMigration(template);
assertThat(loadBinaryFile()).containsAllEntriesOf(createBinaryFileFromMetadata(fileId));
assertThat(loadOzgCloudFile()).containsAllEntriesOf(createOzgCloudFileFromMetadata(fileId));
}
@Test
void shouldLoadContentByContentId() {
migration.doMigration(template);
var binaryFileDocument = loadBinaryFile();
assertThat(getFileContentByContentId(binaryFileDocument)).hasBinaryContent(CONTENT);
var ozgCloudFileDocument = loadOzgCloudFile();
assertThat(getFileContentByContentId(ozgCloudFileDocument)).hasBinaryContent(CONTENT);
}
@Test
......@@ -96,8 +96,8 @@ class M013_CreateOzgCloudFileCollectionTest { // NOSONAR
migration.doMigration(template);
var binaryFiles = template.findAll(Document.class, M013_CreateOzgCloudFileCollection.NEW_COLLECTION_NAME);
assertThat(binaryFiles).hasSize(1).first().usingRecursiveComparison().isEqualTo(ozgCloudFile);
var ozgCloudFiles = template.findAll(Document.class, M013_CreateOzgCloudFileCollection.NEW_COLLECTION_NAME);
assertThat(ozgCloudFiles).hasSize(1).first().usingRecursiveComparison().isEqualTo(ozgCloudFile);
}
private String uploadFile() {
......@@ -119,7 +119,7 @@ class M013_CreateOzgCloudFileCollectionTest { // NOSONAR
return ozgCloudFile;
}
private Document createBinaryFileFromMetadata(String fileId) {
private Document createOzgCloudFileFromMetadata(String fileId) {
var ozgCloudFile = createMetadata();
ozgCloudFile.append(M013_CreateOzgCloudFileCollection.FIELD_ID, new ObjectId(fileId));
ozgCloudFile.append(M013_CreateOzgCloudFileCollection.FIELD_CONTENT_ID, fileId);
......@@ -138,7 +138,7 @@ class M013_CreateOzgCloudFileCollectionTest { // NOSONAR
return metadata;
}
private Document loadBinaryFile() {
private Document loadOzgCloudFile() {
return template.findById(fileId, Document.class, M013_CreateOzgCloudFileCollection.NEW_COLLECTION_NAME);
}
......
......@@ -220,7 +220,7 @@ class OzgCloudFileRepositoryITCase {
}
@Test
void shouldPatchBinaryFile() {
void shouldPatchOzgCloudFile() {
repository.patch(FileId.from(ozgCloudFile.getId()), ozgCloudFile.getVersion(), PATCH_MAP);
var loaded = mongoOperations.findById(ozgCloudFile.getId(), OzgCloudFile.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment