use of org.apache.curator.framework.api.DeleteBuilder in project metron by apache.
the class SensorEnrichmentConfigServiceImplTest method deleteShouldProperlyCatchNoNodeExceptionAndReturnFalse.
@Test
public void deleteShouldProperlyCatchNoNodeExceptionAndReturnFalse() throws Exception {
DeleteBuilder builder = mock(DeleteBuilder.class);
when(curatorFramework.delete()).thenReturn(builder);
when(builder.forPath(ConfigurationType.ENRICHMENT.getZookeeperRoot() + "/bro")).thenThrow(KeeperException.NoNodeException.class);
assertFalse(sensorEnrichmentConfigService.delete("bro"));
}
use of org.apache.curator.framework.api.DeleteBuilder in project metron by apache.
the class SensorEnrichmentConfigServiceImplTest method deleteShouldProperlyCatchNonNoNodeExceptionAndThrowRestException.
@Test
public void deleteShouldProperlyCatchNonNoNodeExceptionAndThrowRestException() throws Exception {
exception.expect(RestException.class);
DeleteBuilder builder = mock(DeleteBuilder.class);
when(curatorFramework.delete()).thenReturn(builder);
when(builder.forPath(ConfigurationType.ENRICHMENT.getZookeeperRoot() + "/bro")).thenThrow(Exception.class);
assertFalse(sensorEnrichmentConfigService.delete("bro"));
}
Aggregations