### Question:
HistoryService { public void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders) throws ResponseException, Exception { logger.debug("deleting temporal entity with id : " + entityId + "and attributeId : " + attributeId); String resolvedAttrId = null; if (attributeId != null) { resolvedAttrId = paramsResolver.expandAttribute(attributeId, linkHeaders); } TemporalEntityStorageKey tesk = new TemporalEntityStorageKey(entityId); tesk.setAttributeId(resolvedAttrId); tesk.setInstanceId(instanceId); String messageKey = DataSerializer.toJson(tesk); logger.trace("message key created : " + messageKey); kafkaOperations.pushToKafka(producerChannels.temporalEntityWriteChannel(), messageKey.getBytes(), "null".getBytes()); logger.trace("temporal entity (" + entityId + ") deleted"); } HistoryService(ProducerChannel producerChannels); URI createTemporalEntityFromEntity(String payload); URI createTemporalEntityFromBinding(String payload); void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders); void addAttrib2TemporalEntity(String entityId, String payload); void modifyAttribInstanceTemporalEntity(String entityId, String payload, String attribId, String instanceId,
			List<Object> linkHeaders); @KafkaListener(topics = "${entity.create.topic}", groupId = "historyManagerCreate") void handleEntityCreate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key); @KafkaListener(topics = "${entity.append.topic}", groupId = "historyManagerAppend") void handleEntityAppend(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key); @KafkaListener(topics = "${entity.update.topic}", groupId = "historyManagerUpdate") void handleEntityUpdate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key); @KafkaListener(topics = "${entity.delete.topic}", groupId = "historyManagerDelete") void handleEntityDelete(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key);  }### Answer:
@Test public void deleteTemporalByIdTest() { List<Object> linkHeaders = null; try { Mockito.doReturn("https: historyService.delete("urn:ngsi-ld:testunit:151", "airQualityLevel", null, linkHeaders); verify(kafkaOperations, times(1)).pushToKafka(any(),any(),any()); } catch (Exception e) { Assert.fail(); e.printStackTrace(); } }