Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VOSpace INAF
vospace-datamodel
Commits
2007e86b
Commit
2007e86b
authored
Feb 03, 2021
by
Sonia Zorba
Browse files
Allowed unknown JSON properties in JobSummary
parent
af9345e9
Pipeline
#962
passed with stages
in 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/ivoa/xml/uws/v1/JobSummary.java
View file @
2007e86b
...
...
@@ -8,6 +8,7 @@
package
net.ivoa.xml.uws.v1
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
it.inaf.oats.vospace.datamodel.JobInfoDeserializer
;
...
...
@@ -20,7 +21,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import
javax.xml.bind.annotation.XmlAnyElement
;
import
javax.xml.bind.annotation.XmlAttribute
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlElementRef
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
import
javax.xml.bind.annotation.XmlRootElement
;
import
javax.xml.bind.annotation.XmlSchemaType
;
...
...
@@ -98,6 +98,7 @@ import org.w3c.dom.Element;
// <edit>
@XmlSeeAlso
({
Transfer
.
class
})
// Necessary for setting a Transfer inside the jobInfo property.
@XmlRootElement
(
name
=
"job"
)
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
// </edit>
public
class
JobSummary
{
...
...
src/test/java/net/ivoa/xml/uws/v1/JobSummaryTest.java
View file @
2007e86b
...
...
@@ -51,6 +51,15 @@ public class JobSummaryTest {
verifyJobsAreEquals
(
deserialized
);
}
/**
* Uses JSON extracted from real job executed by transfer service. Contains extra field jobType.
*/
@Test
public
void
testDeserializeTransferServiceResponse
()
throws
Exception
{
String
response
=
"{\"jobId\": \"917c784f814c4a1a91a9d5d1af07dbe9\", \"ownerId\": \"2386\", \"jobType\": \"pullToVoSpace\", \"phase\": \"PENDING\", \"startTime\": null, \"endTime\": null, \"creationTime\": \"2021-02-03T15:05:57.233602\", \"jobInfo\": {\"transfer\": {\"view\": null, \"target\": \"vos://example.com!vospace/szorba/aaa\", \"version\": null, \"direction\": \"pullToVoSpace\", \"keepBytes\": null, \"protocols\": [{\"uri\": \"ia2:async-recall\", \"param\": [{\"uri\": \"ia2:node-type\", \"value\": \"single\"}], \"endpoint\": null}]}}, \"results\": null}"
;
MAPPER
.
readValue
(
response
,
JobSummary
.
class
);
}
private
JobSummary
getJobSummary
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment