@Test
public void testGeoNetworksResponse()
                        throws XMLStreamException, FactoryConfigurationError, OWSExceptionReport {

    OwsHttpResponseImpl mock = Mockito.mock( OwsHttpResponseImpl.class );
    XMLStreamReader xmlStream = getExampleResponseReader( "geonetworks_response.invalid" );
    Mockito.when( mock.getAsXMLStream() ).thenReturn( xmlStream );
    GetRecordsResponse response = new GetRecordsResponse( mock );
    Iterator<MetadataRecord> iter = response.getRecords();
    int i = 0;
    while ( iter.hasNext() ) {
        assertTrue( xmlStream.isStartElement() );
        assertEquals( ISO_RECORD_NS, xmlStream.getNamespaceURI() );
        assertEquals( "MD_Metadata", xmlStream.getLocalName() );
        ISORecord isoRecord = null;
        isoRecord = (ISORecord) iter.next();
        assertNotNull( isoRecord.getIdentifier() );
        i++;
    }
    assertEquals( 10, i );
}