### Question:
CommonAbstractStore implements RecordStore<RECORD>, AutoCloseable { void initialise( boolean createIfNotExists ) { try { checkAndLoadStorage( createIfNotExists ); } catch ( Exception e ) { closeAndThrow( e ); } } CommonAbstractStore(
            File file,
            File idFile,
            Config configuration,
            IdType idType,
            IdGeneratorFactory idGeneratorFactory,
            PageCache pageCache,
            LogProvider logProvider,
            String typeDescriptor,
            RecordFormat<RECORD> recordFormat,
            StoreHeaderFormat<HEADER> storeHeaderFormat,
            String storeVersion,
            OpenOption... openOptions ); String getTypeDescriptor(); @Override int getRecordsPerPage(); byte[] getRawRecordData( long id ); boolean isInUse( long id ); @Override PageCursor openPageCursorForReading( long id ); @Override long nextId(); @Override IdRange nextIdBatch( int size ); @Override void freeId( long id ); @Override long getHighId(); void setHighId( long highId ); @Override File getStorageFile(); @Override final int getRecordSize(); @Override int getRecordDataSize(); @Override void flush(); @Override void close(); @Override long getHighestPossibleIdInUse(); @Override void setHighestPossibleIdInUse( long highId ); long getNumberOfIdsInUse(); @Override int getNumberOfReservedLowIds(); IdType getIdType(); @Override long getNextRecordReference( RECORD record ); @Override RECORD newRecord(); @Override RECORD getRecord( long id, RECORD record, RecordLoad mode ); @Override void getRecordByCursor( long id, RECORD record, RecordLoad mode, PageCursor cursor ); @Override void nextRecordByCursor( RECORD record, RecordLoad mode, PageCursor cursor ); @Override void updateRecord( RECORD record ); @Override void prepareForCommit( RECORD record ); @Override void prepareForCommit( RECORD record, IdSequence idSequence ); @Override void scanAllRecords( Visitor<RECORD,EXCEPTION> visitor ); @Override List<RECORD> getRecords( long firstId, RecordLoad mode ); @Override void ensureHeavy( RECORD record ); @Override String toString(); @Override int getStoreHeaderInt();  }### Answer:
@Test public void failStoreInitializationWhenHeaderRecordCantBeRead() throws IOException { File storeFile = dir.file( "a" ); File idFile = dir.file( "idFile" ); PageCache pageCache = mock( PageCache.class ); PagedFile pagedFile = mock( PagedFile.class ); PageCursor pageCursor = mock( PageCursor.class ); when( pageCache.map( eq( storeFile ), anyInt(), any( OpenOption.class ) ) ).thenReturn( pagedFile ); when( pagedFile.io( 0L, PagedFile.PF_SHARED_READ_LOCK ) ).thenReturn( pageCursor ); when( pageCursor.next() ).thenReturn( false ); RecordFormats recordFormats = Standard.LATEST_RECORD_FORMATS; expectedException.expect( StoreNotFoundException.class ); expectedException.expectMessage( "Fail to read header record of store file: " + storeFile.getAbsolutePath() ); try ( DynamicArrayStore dynamicArrayStore = new DynamicArrayStore( storeFile, idFile, config, IdType.NODE_LABELS, idGeneratorFactory, pageCache, NullLogProvider.getInstance(), Settings.INTEGER.apply( GraphDatabaseSettings.label_block_size.getDefaultValue() ), recordFormats ) ) { dynamicArrayStore.initialise( false ); } }