Search in sources :

Example 1 with FeatureGroupCommitController

use of io.hops.hopsworks.common.featurestore.featuregroup.cached.FeatureGroupCommitController in project hopsworks by logicalclocks.

the class TestCommitBuilder method setup.

@Before
public void setup() {
    featureGroupCommitController = Mockito.mock(FeatureGroupCommitController.class);
    Mockito.when(featureGroupCommitController.getCommitDetails(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt(), Mockito.anySet(), Mockito.anySet())).thenReturn(new AbstractFacade.CollectionInfo(0L, new ArrayList()));
    // throws exception if limit or offset is null
    Mockito.when(featureGroupCommitController.getCommitDetails(Mockito.anyInt(), Mockito.anyInt(), Mockito.isNull(), Mockito.anySet(), Mockito.anySet())).thenThrow(new NullPointerException());
    Mockito.when(featureGroupCommitController.getCommitDetails(Mockito.anyInt(), Mockito.isNull(), Mockito.anyInt(), Mockito.anySet(), Mockito.anySet())).thenThrow(new NullPointerException());
    commitBuilder = new CommitBuilder(featureGroupCommitController);
    mockUriInfo = Mockito.mock(UriInfo.class);
    UriBuilder mockUriBuilder = Mockito.mock(UriBuilder.class);
    Mockito.when(mockUriBuilder.path(Mockito.anyString())).thenReturn(mockUriBuilder);
    Mockito.when(mockUriInfo.getBaseUriBuilder()).thenReturn(mockUriBuilder);
    featuregroup = new Featuregroup();
    featuregroup.setId(0);
    Featurestore featurestore = new Featurestore();
    featurestore.setId(0);
    featuregroup.setFeaturestore(featurestore);
    project = new Project();
    project.setId(0);
}
Also used : Project(io.hops.hopsworks.persistence.entity.project.Project) Featurestore(io.hops.hopsworks.persistence.entity.featurestore.Featurestore) AbstractFacade(io.hops.hopsworks.common.dao.AbstractFacade) Featuregroup(io.hops.hopsworks.persistence.entity.featurestore.featuregroup.Featuregroup) ArrayList(java.util.ArrayList) FeatureGroupCommitController(io.hops.hopsworks.common.featurestore.featuregroup.cached.FeatureGroupCommitController) UriBuilder(javax.ws.rs.core.UriBuilder) UriInfo(javax.ws.rs.core.UriInfo) Before(org.junit.Before)

Aggregations

AbstractFacade (io.hops.hopsworks.common.dao.AbstractFacade)1 FeatureGroupCommitController (io.hops.hopsworks.common.featurestore.featuregroup.cached.FeatureGroupCommitController)1 Featurestore (io.hops.hopsworks.persistence.entity.featurestore.Featurestore)1 Featuregroup (io.hops.hopsworks.persistence.entity.featurestore.featuregroup.Featuregroup)1 Project (io.hops.hopsworks.persistence.entity.project.Project)1 ArrayList (java.util.ArrayList)1 UriBuilder (javax.ws.rs.core.UriBuilder)1 UriInfo (javax.ws.rs.core.UriInfo)1 Before (org.junit.Before)1