@Test public void testResultNotNullIds() throws IOException { DeleteStatement deleteStatement = new DeleteStatement("TestTimeSeriesAPIEntity"); deleteStatement.setIds(new ArrayList<>()); deleteStatement.execute(mockDataStorage); verify(mockDataStorage).deleteByID(anyList(), any(EntityDefinition.class)); }
@Test public void testResultNotNullEntities() throws IOException { DeleteStatement deleteStatement = new DeleteStatement(TestTimeSeriesAPIEntity.class.getSimpleName()); deleteStatement.setEntities(new ArrayList<>()); deleteStatement.execute(mockDataStorage); verify(mockDataStorage).delete(anyList(), any(EntityDefinition.class)); }
@Test(expected = IOException.class) public void testResultAllNull() throws IOException { DeleteStatement deleteStatement = new DeleteStatement(TestTimeSeriesAPIEntity.class); deleteStatement.execute(mockDataStorage); } }
stopWatch.start(); dataStorage = DataStorageManager.getDataStorageByEagleConfig(); DeleteStatement statement = new DeleteStatement(serviceName); statement.setIds(deleteIds); }else { LOG.info("Deleting "+serviceName+" by entities"); statement.setEntities(entities); ModifyResult<String> result = statement.execute(dataStorage); if (result.isSuccess()) { List<String> keys = result.getIdentifiers();
stopWatch.start(); dataStorage = DataStorageManager.getDataStorageByEagleConfig(); DeleteStatement statement = new DeleteStatement(serviceName); statement.setIds(deleteIds); }else { LOG.info("Deleting "+serviceName+" by entities"); statement.setEntities(entities); ModifyResult<String> result = statement.execute(dataStorage); if (result.isSuccess()) { List<String> keys = result.getIdentifiers();
@Test public void testResultNotNullQuery() throws Exception { RawQuery query = mock(RawQuery.class); CompiledQuery compiledQuery = mock(CompiledQuery.class); DeleteStatement deleteStatement = new DeleteStatement(query); when(mockDataStorage.compile(query)).thenReturn(compiledQuery); when(compiledQuery.getServiceName()).thenReturn("TestTimeSeriesAPIEntity"); deleteStatement.execute(mockDataStorage); verify(mockDataStorage).delete(any(CompiledQuery.class), any(EntityDefinition.class)); }
DeleteStatement deleteStatement = new DeleteStatement(rawQuery); ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){ meta.put(ELAPSEDMS, stopWatch.getTime());
DeleteStatement deleteStatement = new DeleteStatement(rawQuery); ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){ meta.put(ELAPSEDMS, stopWatch.getTime());