* Test parsing of a response with a (optional) Control element
*/
@Test
public void testResponseWith1Control()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( ModifyDNResponseTest.class.getResource( "response_with_1_control.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
ModifyDnResponse modifyDNResponse = ( ModifyDnResponse ) parser.getBatchResponse().getCurrentResponse();
Map<String, Control> controls = modifyDNResponse.getControls();
assertEquals( 1, modifyDNResponse.getControls().size() );
Control control = controls.get( "1.2.840.113556.1.4.643" );