@Test(expected = GriffinException.ServiceException.class) public void testDeleteMetricValuesFailureWithException() throws IOException { given(metricStore.deleteMetricValues("metricName")) .willThrow(new IOException()); service.deleteMetricValues("metricName"); }
@SuppressWarnings("rawtypes") @Override public ResponseEntity deleteMetricValues(String metricName) { try { return metricStore.deleteMetricValues(metricName); } catch (IOException e) { LOGGER.error("Failed to delete metric values named {}. {}", metricName, e.getMessage()); throw new GriffinException.ServiceException( "Failed to delete metric values.", e); } }
MetricServiceImpl implements MetricService { @SuppressWarnings("rawtypes") @Override public ResponseEntity deleteMetricValues(String metricName) { try { return metricStore.deleteMetricValues(metricName); } catch (IOException e) { LOGGER.error("Failed to delete metric values named {}. {}", metricName, e.getMessage()); throw new GriffinException.ServiceException( "Failed to delete metric values.", e); } } }
MetricServiceImpl implements MetricService { @SuppressWarnings("rawtypes") @Override public ResponseEntity deleteMetricValues(String metricName) { try { return metricStore.deleteMetricValues(metricName); } catch (IOException e) { LOGGER.error("Failed to delete metric values named {}. {}", metricName, e.getMessage()); throw new GriffinException.ServiceException( "Failed to delete metric values.", e); } }  }
MetricServiceImpl implements MetricService { @SuppressWarnings("rawtypes") @Override public ResponseEntity deleteMetricValues(String metricName) { try { return metricStore.deleteMetricValues(metricName); } catch (IOException e) { LOGGER.error("Failed to delete metric values named {}. {}", metricName, e.getMessage()); throw new GriffinException.ServiceException( "Failed to delete metric values.", e); } }  @Override Map<String, List<Metric>> getAllMetrics(); @Override List<MetricValue> getMetricValues(String metricName, int offset,
                                             int size, long tmst); @SuppressWarnings("rawtypes") @Override ResponseEntity addMetricValues(List<MetricValue> values); @SuppressWarnings("rawtypes") @Override ResponseEntity deleteMetricValues(String metricName); @Override MetricValue findMetric(Long id); }
MetricServiceImpl implements MetricService { @SuppressWarnings("rawtypes") @Override public ResponseEntity deleteMetricValues(String metricName) { try { return metricStore.deleteMetricValues(metricName); } catch (IOException e) { LOGGER.error("Failed to delete metric values named {}. {}", metricName, e.getMessage()); throw new GriffinException.ServiceException( "Failed to delete metric values.", e); } }  @Override Map<String, List<Metric>> getAllMetrics(); @Override List<MetricValue> getMetricValues(String metricName, int offset,
                                             int size, long tmst); @SuppressWarnings("rawtypes") @Override ResponseEntity addMetricValues(List<MetricValue> values); @SuppressWarnings("rawtypes") @Override ResponseEntity deleteMetricValues(String metricName); @Override MetricValue findMetric(Long id);  }