@Test public void validateFails() { cmd = spy( new StopGeoRepSessionCommand( new GlusterVolumeGeoRepSessionParameters(stoppedVolumeId, geoRepSessionId))); prepareMocks(cmd); assertFalse(cmd.validate()); }
@Test public void validateSucceeds() { cmd = spy( new StopGeoRepSessionCommand( new GlusterVolumeGeoRepSessionParameters(startedVolumeId, geoRepSessionId))); prepareMocks(cmd); assertTrue(cmd.validate()); }
@Test public void validateFailsIfStopped() { cmd = spy( new StopGeoRepSessionCommand( new GlusterVolumeGeoRepSessionParameters(stoppedVolumeId, geoRepSessionId))); prepareMocks(cmd); doReturn(getGeoRepSession(geoRepSessionId, GeoRepSessionStatus.STOPPED)) .when(geoRepDao) .getById(geoRepSessionId); assertFalse(cmd.validate()); }
@Test public void validateFailsOnNull() { cmd = spy(new StopGeoRepSessionCommand(new GlusterVolumeGeoRepSessionParameters(null, null))); prepareMocks(cmd); assertFalse(cmd.validate()); }