use of org.javarosa.core.model.test.DummyReference in project javarosa by opendatakit.
the class SubmissionParserTest method parseSubmission.
@Test
public void parseSubmission() throws Exception {
// Given
final SubmissionParser submissionParser = new SubmissionParser();
final Element element = new Element();
element.setAttribute(null, "mediatype", "application/xml");
element.setAttribute(null, "custom_attribute", "custom value");
final String method = "POST";
final String action = "ACTION";
final IDataReference ref = new DummyReference();
// When
final SubmissionProfile submissionProfile = submissionParser.parseSubmission(method, action, ref, element);
// Then
assertEquals(action, submissionProfile.getAction());
assertEquals(method, submissionProfile.getMethod());
assertEquals(ref, submissionProfile.getRef());
assertEquals("application/xml", submissionProfile.getMediaType());
assertEquals("custom value", submissionProfile.getAttribute("custom_attribute"));
}
Aggregations