diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-08-16 22:36:09 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-08-16 22:36:09 +0200 |
commit | 118604a706f1fd66bcda450c1ac8370eff60e4cf (patch) | |
tree | b181604dbf884a82697e987500ceb2ed81e24f28 /archiva-modules/plugins/metadata-store-cassandra | |
parent | e4f38c2fbe1f6ce82da98ca9d67d6cc41757f833 (diff) | |
download | archiva-118604a706f1fd66bcda450c1ac8370eff60e4cf.tar.gz archiva-118604a706f1fd66bcda450c1ac8370eff60e4cf.zip |
Fixing unit tests
Diffstat (limited to 'archiva-modules/plugins/metadata-store-cassandra')
-rw-r--r-- | archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java index 6bd8c28c9..e7ba4eda0 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/test/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepositoryTest.java @@ -22,8 +22,11 @@ package org.apache.archiva.metadata.repository.cassandra; import org.apache.archiva.metadata.model.MetadataFacetFactory; import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest; import org.apache.archiva.metadata.repository.MetadataRepository; +import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.cassandra.model.ProjectVersionMetadataModel; +import org.easymock.EasyMock; +import org.easymock.IMocksControl; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -49,10 +52,18 @@ public class CassandraMetadataRepositoryTest CassandraMetadataRepository cmr; + IMocksControl sessionFactoryControl; + RepositorySessionFactory sessionFactory; + + IMocksControl sessionControl; + RepositorySession session; + + + @Override protected RepositorySessionFactory getSessionFactory( ) { - return null; + return sessionFactory; } @Override @@ -78,6 +89,15 @@ public class CassandraMetadataRepositoryTest this.cmr = new CassandraMetadataRepository( factories, null, cassandraArchivaManager ); + sessionFactoryControl = EasyMock.createControl( ); + sessionFactory = sessionFactoryControl.createMock( RepositorySessionFactory.class ); + sessionControl = EasyMock.createControl( ); + session = sessionControl.createMock( RepositorySession.class ); + + EasyMock.expect( sessionFactory.createSession( ) ).andStubReturn( session ); + + sessionFactoryControl.replay(); + clearReposAndNamespace( cassandraArchivaManager ); } |