|
5 | 5 | import org.dataone.hashstore.HashStoreFactory; |
6 | 6 |
|
7 | 7 | import java.io.FileInputStream; |
| 8 | +import java.io.FileNotFoundException; |
8 | 9 | import java.io.FileOutputStream; |
9 | 10 | import java.io.IOException; |
10 | 11 | import java.io.InputStream; |
@@ -207,22 +208,18 @@ public void testGetObjectFromHashStore() throws Exception { |
207 | 208 | assertInstanceOf(InputStream.class, objectIS, "This should be an InputStream"); |
208 | 209 | } |
209 | 210 |
|
210 | | - // TODO: Review junit tests related to testGetObjectFromHashStore |
211 | | - |
212 | 211 | /** |
213 | | - * Confirm that no exception bubbles up when a hashstore is null, and the MN and CN API |
214 | | - * throws an exception when retrieving a data object (ex. eml metadata doc) |
| 212 | + * Confirm that a file not found exception is thrown when supplied with a pid that has no |
| 213 | + * data object. |
215 | 214 | */ |
216 | 215 | @Test |
217 | | - @Disabled("Revisit after checking in with team RE: flow") |
218 | | - public void testGetObjectFromHashStore_objectNotFound() throws Exception { |
| 216 | + public void testGetObjectFromHashStore_objectNotFound() { |
219 | 217 | RequestReportJob job = new RequestReportJob(); |
220 | 218 | Identifier pid = new Identifier(); |
221 | | - pid.setValue("pid.not.found"); |
| 219 | + pid.setValue("file.wont.be.found"); |
222 | 220 |
|
223 | | - job.getObjectFromHashStore(pid, hashStore); |
224 | 221 | assertThrows( |
225 | | - IOException.class, |
| 222 | + FileNotFoundException.class, |
226 | 223 | () -> job.getObjectFromHashStore(pid, hashStore)); |
227 | 224 | } |
228 | 225 |
|
|
0 commit comments