@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); } }
ModifyResult<String> result = statement.execute(dataStorage); if (result.isSuccess()) { List<String> keys = result.getIdentifiers();
@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)); }
ModifyResult<String> result = statement.execute(dataStorage); if (result.isSuccess()) { List<String> keys = result.getIdentifiers();
ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){ meta.put(ELAPSEDMS, stopWatch.getTime());
ModifyResult<String> deleteResult = deleteStatement.execute(dataStorage); if(deleteResult.isSuccess()){ meta.put(ELAPSEDMS, stopWatch.getTime());