@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)); }
@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);
@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 public void testResultNotNullIds() throws IOException { DeleteStatement deleteStatement = new DeleteStatement("TestTimeSeriesAPIEntity"); deleteStatement.setIds(new ArrayList<>()); deleteStatement.execute(mockDataStorage); verify(mockDataStorage).deleteByID(anyList(), any(EntityDefinition.class)); }
stopWatch.start(); dataStorage = DataStorageManager.getDataStorageByEagleConfig(); DeleteStatement statement = new DeleteStatement(serviceName);
DeleteStatement deleteStatement = new DeleteStatement(rawQuery); ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){
DeleteStatement deleteStatement = new DeleteStatement(rawQuery); ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){