Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RagnarW committed May 4, 2018
1 parent 0b0b701 commit 1e65e54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Expand Up @@ -148,7 +148,8 @@ public void shouldListExpectedFilesCorrectly() throws Exception
assertTransactionIdMatches( prepareStoreCopyResponse.lastTransactionId() );

//and
assertIndexIdsAreEmpty( prepareStoreCopyResponse.getIndexIds() );
assertTrue( "Expected an empty set of ids. Found size " + prepareStoreCopyResponse.getIndexIds().size(),
prepareStoreCopyResponse.getIndexIds().isEmpty() );
}

@Test
Expand Down Expand Up @@ -277,11 +278,6 @@ private void listOfDownloadedFilesMatchesServer( NeoStoreDataSource neoStoreData
assertThat( givenFile, containsInAnyOrder( expectedStoreFiles.toArray( new String[givenFile.size()] ) ) );
}

private void assertIndexIdsAreEmpty( PrimitiveLongSet indexIds )
{
assertTrue( indexIds.isEmpty() );
}

private PrimitiveLongSet getExpectedIndexIds( NeoStoreDataSource neoStoreDataSource )
{
return neoStoreDataSource.getNeoStoreFileListing().getNeoStoreFileIndexListing().getIndexIds();
Expand Down
Expand Up @@ -26,6 +26,8 @@
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

import org.neo4j.collection.primitive.Primitive;
import org.neo4j.collection.primitive.PrimitiveLongSet;
Expand Down Expand Up @@ -129,11 +131,11 @@ public void shouldHandleEmptyDescriptors()
}

@Test
public void shouldReturnEmptySetOfIds()
public void shouldReturnEmptySetOfIdsAndIgnoreIndexListing()
{
PrimitiveLongSet expectedIndexIds = Primitive.longSet();
expectedIndexIds.add( 42 );
when( indexListingMock.getIndexIds() ).thenReturn( expectedIndexIds );
PrimitiveLongSet existingIds = Primitive.longSet();
existingIds.add( 42 );
when( indexListingMock.getIndexIds() ).thenReturn( existingIds );

PrimitiveLongSet actualIndexIndexIds = prepareStoreCopyFiles.getNonAtomicIndexIds();

Expand Down

0 comments on commit 1e65e54

Please sign in to comment.