Skip to content

Commit a9496b0

Browse files
Reactivate and fix junit test 'testGetObjectFromHashStore_objectNotFound'
1 parent 5084b3f commit a9496b0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/test/java/edu/ucsb/nceas/mdqengine/scheduler/RequestReportJobTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.dataone.hashstore.HashStoreFactory;
66

77
import java.io.FileInputStream;
8+
import java.io.FileNotFoundException;
89
import java.io.FileOutputStream;
910
import java.io.IOException;
1011
import java.io.InputStream;
@@ -207,22 +208,18 @@ public void testGetObjectFromHashStore() throws Exception {
207208
assertInstanceOf(InputStream.class, objectIS, "This should be an InputStream");
208209
}
209210

210-
// TODO: Review junit tests related to testGetObjectFromHashStore
211-
212211
/**
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.
215214
*/
216215
@Test
217-
@Disabled("Revisit after checking in with team RE: flow")
218-
public void testGetObjectFromHashStore_objectNotFound() throws Exception {
216+
public void testGetObjectFromHashStore_objectNotFound() {
219217
RequestReportJob job = new RequestReportJob();
220218
Identifier pid = new Identifier();
221-
pid.setValue("pid.not.found");
219+
pid.setValue("file.wont.be.found");
222220

223-
job.getObjectFromHashStore(pid, hashStore);
224221
assertThrows(
225-
IOException.class,
222+
FileNotFoundException.class,
226223
() -> job.getObjectFromHashStore(pid, hashStore));
227224
}
228225

0 commit comments

Comments
 (0)