@Test
public void parseSubmitRequestWithInvalidOptionalParamsV11TooMany() throws Exception {

    StringBuilder string0 = new StringBuilder(200)
        .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
        .append("<operation type=\"submit\">\n")
        .append(" <account username=\"customer1\" password=\"test1\"/>\n")
        .append(" <submitRequest referenceId=\"MYREF102020022\">\n")
        .append("  <operatorId>10</operatorId>\n")
        .append("  <destinationAddress type=\"push_destination\">abcd01234fghij</destinationAddress>\n")
        .append("  <text encoding=\"ISO-8859-1\">48656c6c6f20576f726c64</text>\n")
        .append("  <optionalParams>{");
    for (int i=0; i < 255; i++)
        string0.append("\"").append(i).append("\":1,");
    string0.append("\"#256\":1");
    string0.append("}</optionalParams>\n")
        .append(" </submitRequest>\n")
        .append("</operation>\n")
        .append("");
    ByteArrayInputStream is = new ByteArrayInputStream(string0.toString().getBytes("UTF-8"));
    SxmpParser parser = new SxmpParser(SxmpParser.VERSION_1_1);
    try {
        Operation operation = parser.parse(is);
        Assert.fail();
    } catch (SxmpParsingException e) {
        logger.error("error message: "+e.getMessage());
         // correct behavior
        Assert.assertEquals(SxmpErrorCode.INVALID_VALUE, e.getErrorCode());
        Assert.assertThat(e.getMessage(), CoreMatchers.containsString("Invalid optional parameters"));
        SubmitRequest submitRequest = (SubmitRequest)e.getOperation();
        Assert.assertEquals(Operation.Type.SUBMIT, submitRequest.getType());
    }
}