* Test parsing of a response with a (optional) Control element with empty value
*/
@Test
public void testResponseWith1ControlEmptyValue()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( SearchResultReferenceTest.class.getResource( "response_with_1_control_empty_value.xml" )
.openStream(), "UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
.getCurrentResponse().getDecorated() ).getCurrentSearchResultReference();
Map<String, Control> controls = searchResultReference.getControls();
assertEquals( 1, searchResultReference.getControls().size() );