when(method.getReturnType()).thenReturn((Class) void.class);
when(jpaQuery.createQuery(Mockito.any(Object[].class))).thenReturn(query);
when(jpaQuery.getQueryMethod()).thenReturn(method);
ModifyingExecution execution = new ModifyingExecution(method, em);
execution.execute(jpaQuery, new Object[] {});
verify(em, times(1)).clear();
}
@Test