Skip to content

Commit efc9344

Browse files
Add new junit test 'testGetSystemMetadataFromHashStoreOrNode' to 'RequestReportJobTest' class
1 parent 270448c commit efc9344

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.dataone.service.types.v1.Identifier;
2323
import org.dataone.service.types.v1.Session;
24+
import org.dataone.service.types.v2.SystemMetadata;
2425
import org.junit.jupiter.api.AfterAll;
2526
import org.junit.jupiter.api.BeforeAll;
2627
import org.junit.jupiter.api.Test;
@@ -48,8 +49,8 @@ public class RequestReportJobTest {
4849
private static final String testPid = "dou.test.eml.1";
4950

5051
/**
51-
* Create a HashStore before all junit tests inside a temp folder with a data object and sysmeta
52-
* object to work with.
52+
* Create a HashStore before all junit tests run inside a temp folder with a data object and
53+
* sysmeta object to work with.
5354
*/
5455
@BeforeAll
5556
public static void prepareJunitHashStore()
@@ -146,6 +147,24 @@ public static void overrideConfigFilePathInMDQConfig(String fullPathToMetadigPro
146147

147148
// Junit Tests
148149

150+
/**
151+
* Confirm that a sysmeta object is returned. No exception should be thrown.
152+
*/
153+
@Test
154+
public void testGetSystemMetadataFromHashStoreOrNode() throws Exception {
155+
RequestReportJob job = new RequestReportJob();
156+
MultipartCNode cnNode = null;
157+
MultipartMNode mnNode = null;
158+
Session session = null;
159+
Identifier pid = new Identifier();
160+
pid.setValue(testPid);
161+
162+
SystemMetadata sysmeta =
163+
job.getSystemMetadataFromHashStoreOrNode(pid, hashStore, cnNode, mnNode, false,
164+
session);
165+
assertInstanceOf(SystemMetadata.class, sysmeta, "This should be a sysmeta object");
166+
}
167+
149168
/**
150169
* Confirm that an input stream to a data object is returned. No exception should be thrown.
151170
*/

0 commit comments

Comments
 (0)