### Question:
RecordApi extends BaseProvider implements RecordProvider { @Override public Record getRecord(String id) throws OaiPmhException { ResponseEntity<String> response = getResponseForRecord(id); RDFMetadata rdf = new RDFMetadata(response.getBody()); Header header = new Header(); header.setIdentifier(id); header.setDatestamp(new Date()); return new Record(header, rdf); }  @Override Record getRecord(String id); @Override void checkRecordExists(String id); @Override ListRecords listRecords(List<Header> identifiers); void close();  }### Answer:
@Test public void getRecord() throws OaiPmhException, IOException { Record record = new Record(null, loadRecord()); given(recordApi.getRecord(TEST_RECORD_ID)).willReturn(record); Record xml = recordApi.getRecord(TEST_RECORD_ID); Assert.assertNotNull(xml); Assert.assertTrue(xml.getMetadata().getMetadata().contains("about=\"http: }
@Test(expected=IdDoesNotExistException.class) public void getRecordNotExists() throws OaiPmhException { given(recordApi.getRecord("INCORRECT/ID")).willThrow(new IdDoesNotExistException("INCORRECT/ID")); recordApi.getRecord("INCORRECT/ID"); fail(); }