コード例 #1
0
 @Test
 public void validateFails() {
   cmd =
       spy(
           new StopGeoRepSessionCommand(
               new GlusterVolumeGeoRepSessionParameters(stoppedVolumeId, geoRepSessionId)));
   prepareMocks(cmd);
   assertFalse(cmd.validate());
 }
コード例 #2
0
 @Test
 public void validateSucceeds() {
   cmd =
       spy(
           new StopGeoRepSessionCommand(
               new GlusterVolumeGeoRepSessionParameters(startedVolumeId, geoRepSessionId)));
   prepareMocks(cmd);
   assertTrue(cmd.validate());
 }
コード例 #3
0
 @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());
 }
コード例 #4
0
 @Test
 public void validateFailsOnNull() {
   cmd = spy(new StopGeoRepSessionCommand(new GlusterVolumeGeoRepSessionParameters(null, null)));
   prepareMocks(cmd);
   assertFalse(cmd.validate());
 }