Skip to content

Commit 8442e3c

Browse files
committed
Minor cleanup
1 parent bddddbd commit 8442e3c

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎spring-data-mongodb/src/test/java/org/baeldung/gridfs/GridFSIntegrationTest.java‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ public void whenStoringFileWithMetadata_thenFileAndMetadataAreStored() {
5757
inputStream = new FileInputStream("src/main/resources/test.png");
5858
id = gridFsTemplate.store(inputStream, "test.png", "image/png", metaData).getId().toString();
5959
} catch (FileNotFoundException ex) {
60-
logger.error("", ex);
60+
logger.error("File not found", ex);
6161
} finally {
6262
if (inputStream != null) {
6363
try {
6464
inputStream.close();
6565
} catch (IOException ex) {
66-
logger.error("", ex);
66+
logger.error("Failed to close", ex);
6767
}
6868
}
6969
}
@@ -81,13 +81,13 @@ public void givenFileWithMetadataExist_whenFindingFileById_thenFileWithMetadataI
8181
inputStream = new FileInputStream("src/main/resources/test.png");
8282
id = gridFsTemplate.store(inputStream, "test.png", "image/png", metaData).getId().toString();
8383
} catch (FileNotFoundException ex) {
84-
logger.error("", ex);
84+
logger.error("File not found", ex);
8585
} finally {
8686
if (inputStream != null) {
8787
try {
8888
inputStream.close();
8989
} catch (IOException ex) {
90-
logger.error("", ex);
90+
logger.error("Failed to close", ex);
9191
}
9292
}
9393
}
@@ -110,13 +110,13 @@ public void givenMetadataAndFilesExist_whenFindingAllFiles_thenFilesWithMetadata
110110
gridFsTemplate.store(inputStream, "test.png", "image/png", metaData);
111111
gridFsTemplate.store(inputStream, "test.png", "image/png", metaData);
112112
} catch (FileNotFoundException ex) {
113-
logger.error("", ex);
113+
logger.error("File not found", ex);
114114
} finally {
115115
if (inputStream != null) {
116116
try {
117117
inputStream.close();
118118
} catch (IOException ex) {
119-
logger.error("", ex);
119+
logger.error("Failed to close", ex);
120120
}
121121
}
122122
}
@@ -137,13 +137,13 @@ public void givenFileWithMetadataExist_whenDeletingFileById_thenFileWithMetadata
137137
inputStream = new FileInputStream("src/main/resources/test.png");
138138
id = gridFsTemplate.store(inputStream, "test.png", "image/png", metaData).getId().toString();
139139
} catch (FileNotFoundException ex) {
140-
logger.error("", ex);
140+
logger.error("File not found", ex);
141141
} finally {
142142
if (inputStream != null) {
143143
try {
144144
inputStream.close();
145145
} catch (IOException ex) {
146-
logger.error("", ex);
146+
logger.error("Failed to close", ex);
147147
}
148148
}
149149
}
@@ -163,13 +163,13 @@ public void givenFileWithMetadataExist_whenGettingFileByResource_thenFileWithMet
163163
inputStream = new FileInputStream("src/main/resources/test.png");
164164
id = gridFsTemplate.store(inputStream, "test.png", "image/png", metaData).getId().toString();
165165
} catch (FileNotFoundException ex) {
166-
logger.error("", ex);
166+
logger.error("File not found", ex);
167167
} finally {
168168
if (inputStream != null) {
169169
try {
170170
inputStream.close();
171171
} catch (IOException ex) {
172-
logger.error("", ex);
172+
logger.error("Failed to close", ex);
173173
}
174174
}
175175
}

0 commit comments

Comments
 (0)