use of uk.ac.ebi.spot.goci.model.deposition.util.DepositionSubmissionListWrapper in project goci by EBISPOT.
the class DepositionSubmissionTest method testReadSubmissions.
@Test
public void testReadSubmissions() {
try {
Resource resource = new ClassPathResource("submissions.json");
assertTrue(resource.exists());
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
DepositionSubmissionListWrapper submissionList = objectMapper.readValue(resource.getFile(), DepositionSubmissionListWrapper.class);
assertNotNull(submissionList);
assertTrue(submissionList.getWrapper().getSubmissions().get(0).getCreated().getTimestamp().toString().equals("2019-08-12T11:33:45.005Z"));
assertNotNull(submissionList.getWrapper().getSubmissions().get(0).getStatus());
} catch (IOException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of uk.ac.ebi.spot.goci.model.deposition.util.DepositionSubmissionListWrapper in project goci by EBISPOT.
the class DepositionSubmissionTest method testCreateSubmissionWrapper.
@Test
public void testCreateSubmissionWrapper() {
DepositionSubmissionListWrapper wrapper = new DepositionSubmissionListWrapper();
wrapper.setWrapper(new DepositionSubmissionList());
DepositionSubmission submission = new DepositionSubmission();
wrapper.getWrapper().getSubmissions().add(submission);
try {
String json = new ObjectMapper().writeValueAsString(wrapper);
assertNotNull(json);
} catch (JsonProcessingException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
Aggregations