|
21 | 21 |
|
22 | 22 | import org.dataone.service.types.v1.Identifier; |
23 | 23 | import org.dataone.service.types.v1.Session; |
| 24 | +import org.dataone.service.types.v2.SystemMetadata; |
24 | 25 | import org.junit.jupiter.api.AfterAll; |
25 | 26 | import org.junit.jupiter.api.BeforeAll; |
26 | 27 | import org.junit.jupiter.api.Test; |
@@ -48,8 +49,8 @@ public class RequestReportJobTest { |
48 | 49 | private static final String testPid = "dou.test.eml.1"; |
49 | 50 |
|
50 | 51 | /** |
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. |
53 | 54 | */ |
54 | 55 | @BeforeAll |
55 | 56 | public static void prepareJunitHashStore() |
@@ -146,6 +147,24 @@ public static void overrideConfigFilePathInMDQConfig(String fullPathToMetadigPro |
146 | 147 |
|
147 | 148 | // Junit Tests |
148 | 149 |
|
| 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 | + |
149 | 168 | /** |
150 | 169 | * Confirm that an input stream to a data object is returned. No exception should be thrown. |
151 | 170 | */ |
|
0 commit comments