test_class.declarator: mockMvc
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: producerChannels
test_class.modifier: @Mock
test_class.original_string: @Mock
  	ProducerChannel producerChannels;
test_class.type: ProducerChannel
test_class.var_name: producerChannels
test_class.declarator: kafkaOperations
test_class.modifier: @Mock
test_class.original_string: @Mock
  	KafkaOps kafkaOperations;
test_class.type: KafkaOps
test_class.var_name: kafkaOperations
test_class.declarator: historyDAO
test_class.modifier: @Mock
test_class.original_string: @Mock
  	HistoryDAO historyDAO;
test_class.type: HistoryDAO
test_class.var_name: historyDAO
test_class.declarator: paramsResolver
test_class.modifier: @Mock
test_class.original_string: @Mock
  	ParamsResolver paramsResolver;
test_class.type: ParamsResolver
test_class.var_name: paramsResolver
test_class.declarator: historyService
test_class.modifier: @InjectMocks
  	@Spy
      private
test_class.original_string: @InjectMocks
  	@Spy
      private HistoryService historyService;
test_class.type: HistoryService
test_class.var_name: historyService
test_class.declarator: uri
test_class.original_string: URI uri;
test_class.type: URI
test_class.var_name: uri
test_class.declarator: temporalPayload
test_class.modifier: private
test_class.original_string: private String temporalPayload;
test_class.type: String
test_class.var_name: temporalPayload
test_class.file: History/HistoryManager/src/test/java/eu/neclab/ngsildbroker/historymanager/service/HistoryServiceTest.java
test_class.identifier: HistoryServiceTest
test_case.body: @Test
  	public void deleteTemporalByIdTest() {
  		List<Object> linkHeaders = null;
  		try {
  			Mockito.doReturn("https://uri.etsi.org/ngsi-ld/default-context/airQualityLevel").when(paramsResolver).expandAttribute(any(),any());
  			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();
  		}		
  	}
test_case.class_method_signature: HistoryServiceTest.deleteTemporalByIdTest()
test_case.full_signature: @Test public void deleteTemporalByIdTest()
test_case.identifier: deleteTemporalByIdTest
test_case.invocations: expandAttribute when doReturn any any delete pushToKafka verify times any any any fail printStackTrace
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void deleteTemporalByIdTest()
focal_class.declarator: logger = LoggerFactory.getLogger(HistoryService.class)
focal_class.modifier: private final static
focal_class.original_string: private final static Logger logger = LoggerFactory.getLogger(HistoryService.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: kafkaOperations
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
  	KafkaOps kafkaOperations;
focal_class.type: KafkaOps
focal_class.var_name: kafkaOperations
focal_class.declarator: paramsResolver
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
  	ParamsResolver paramsResolver;
focal_class.type: ParamsResolver
focal_class.var_name: paramsResolver
focal_class.declarator: historyDAO
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
  	HistoryDAO historyDAO;
focal_class.type: HistoryDAO
focal_class.var_name: historyDAO
focal_class.declarator: parser = new JsonParser()
focal_class.original_string: JsonParser parser = new JsonParser();
focal_class.type: JsonParser
focal_class.var_name: parser
focal_class.declarator: producerChannels
focal_class.modifier: private final
focal_class.original_string: private final ProducerChannel producerChannels;
focal_class.type: ProducerChannel
focal_class.var_name: producerChannels
focal_class.file: History/HistoryManager/src/main/java/eu/neclab/ngsildbroker/historymanager/service/HistoryService.java
focal_class.identifier: HistoryService
focal_class.class_method_signature: HistoryService.HistoryService(ProducerChannel producerChannels)
focal_class.full_signature: public  HistoryService(ProducerChannel producerChannels)
focal_class.identifier: HistoryService
focal_class.modifiers: public
focal_class.parameters: (ProducerChannel producerChannels)
focal_class.signature:  HistoryService(ProducerChannel producerChannels)
focal_class.class_method_signature: HistoryService.createTemporalEntityFromEntity(String payload)
focal_class.full_signature: public URI createTemporalEntityFromEntity(String payload)
focal_class.identifier: createTemporalEntityFromEntity
focal_class.modifiers: public
focal_class.parameters: (String payload)
focal_class.return: URI
focal_class.signature: URI createTemporalEntityFromEntity(String payload)
focal_class.class_method_signature: HistoryService.createTemporalEntityFromBinding(String payload)
focal_class.full_signature: public URI createTemporalEntityFromBinding(String payload)
focal_class.identifier: createTemporalEntityFromBinding
focal_class.modifiers: public
focal_class.parameters: (String payload)
focal_class.return: URI
focal_class.signature: URI createTemporalEntityFromBinding(String payload)
focal_class.class_method_signature: HistoryService.createTemporalEntity(String payload, boolean fromEntity)
focal_class.full_signature: private URI createTemporalEntity(String payload, boolean fromEntity)
focal_class.identifier: createTemporalEntity
focal_class.modifiers: private
focal_class.parameters: (String payload, boolean fromEntity)
focal_class.return: URI
focal_class.signature: URI createTemporalEntity(String payload, boolean fromEntity)
focal_class.class_method_signature: HistoryService.setCommonTemporalProperties(JsonElement jsonElement, String date, boolean fromEntity)
focal_class.full_signature: private JsonElement setCommonTemporalProperties(JsonElement jsonElement, String date, boolean fromEntity)
focal_class.identifier: setCommonTemporalProperties
focal_class.modifiers: private
focal_class.parameters: (JsonElement jsonElement, String date, boolean fromEntity)
focal_class.return: JsonElement
focal_class.signature: JsonElement setCommonTemporalProperties(JsonElement jsonElement, String date, boolean fromEntity)
focal_class.class_method_signature: HistoryService.setTemporalProperty(JsonElement jsonElement, String propertyName, String value)
focal_class.full_signature: private JsonElement setTemporalProperty(JsonElement jsonElement, String propertyName, String value)
focal_class.identifier: setTemporalProperty
focal_class.modifiers: private
focal_class.parameters: (JsonElement jsonElement, String propertyName, String value)
focal_class.return: JsonElement
focal_class.signature: JsonElement setTemporalProperty(JsonElement jsonElement, String propertyName, String value)
focal_class.class_method_signature: HistoryService.setTemporalPropertyinstanceId(JsonElement jsonElement, String propertyName, String value)
focal_class.full_signature: private JsonElement setTemporalPropertyinstanceId(JsonElement jsonElement, String propertyName, String value)
focal_class.identifier: setTemporalPropertyinstanceId
focal_class.modifiers: private
focal_class.parameters: (JsonElement jsonElement, String propertyName, String value)
focal_class.return: JsonElement
focal_class.signature: JsonElement setTemporalPropertyinstanceId(JsonElement jsonElement, String propertyName, String value)
focal_class.class_method_signature: HistoryService.pushAttributeToKafka(String entityId, String entityType, String entityCreatedAt,
  			String entityModifiedAt, String attributeId, String elementValue, Boolean createTemporalEntityIfNotExists,
  			Boolean overwriteOp)
focal_class.full_signature: private void pushAttributeToKafka(String entityId, String entityType, String entityCreatedAt,
  			String entityModifiedAt, String attributeId, String elementValue, Boolean createTemporalEntityIfNotExists,
  			Boolean overwriteOp)
focal_class.identifier: pushAttributeToKafka
focal_class.modifiers: private
focal_class.parameters: (String entityId, String entityType, String entityCreatedAt,
  			String entityModifiedAt, String attributeId, String elementValue, Boolean createTemporalEntityIfNotExists,
  			Boolean overwriteOp)
focal_class.return: void
focal_class.signature: void pushAttributeToKafka(String entityId, String entityType, String entityCreatedAt,
  			String entityModifiedAt, String attributeId, String elementValue, Boolean createTemporalEntityIfNotExists,
  			Boolean overwriteOp)
focal_class.class_method_signature: HistoryService.pushAttributeToKafka(String id, String entityModifiedAt, String attributeId, String elementValue)
focal_class.full_signature: private void pushAttributeToKafka(String id, String entityModifiedAt, String attributeId, String elementValue)
focal_class.identifier: pushAttributeToKafka
focal_class.modifiers: private
focal_class.parameters: (String id, String entityModifiedAt, String attributeId, String elementValue)
focal_class.return: void
focal_class.signature: void pushAttributeToKafka(String id, String entityModifiedAt, String attributeId, String elementValue)
focal_class.class_method_signature: HistoryService.delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_class.full_signature: public void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_class.identifier: delete
focal_class.modifiers: public
focal_class.parameters: (String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_class.return: void
focal_class.signature: void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_class.class_method_signature: HistoryService.addAttrib2TemporalEntity(String entityId, String payload)
focal_class.full_signature: public void addAttrib2TemporalEntity(String entityId, String payload)
focal_class.identifier: addAttrib2TemporalEntity
focal_class.modifiers: public
focal_class.parameters: (String entityId, String payload)
focal_class.return: void
focal_class.signature: void addAttrib2TemporalEntity(String entityId, String payload)
focal_class.class_method_signature: HistoryService.modifyAttribInstanceTemporalEntity(String entityId, String payload, String attribId, String instanceId,
  			List<Object> linkHeaders)
focal_class.full_signature: public void modifyAttribInstanceTemporalEntity(String entityId, String payload, String attribId, String instanceId,
  			List<Object> linkHeaders)
focal_class.identifier: modifyAttribInstanceTemporalEntity
focal_class.modifiers: public
focal_class.parameters: (String entityId, String payload, String attribId, String instanceId,
  			List<Object> linkHeaders)
focal_class.return: void
focal_class.signature: void modifyAttribInstanceTemporalEntity(String entityId, String payload, String attribId, String instanceId,
  			List<Object> linkHeaders)
focal_class.class_method_signature: HistoryService.handleEntityCreate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.full_signature: @KafkaListener(topics = "${entity.create.topic}", groupId = "historyManagerCreate") public void handleEntityCreate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.identifier: handleEntityCreate
focal_class.modifiers: @KafkaListener(topics = "${entity.create.topic}", groupId = "historyManagerCreate") public
focal_class.parameters: (@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.return: void
focal_class.signature: void handleEntityCreate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.class_method_signature: HistoryService.handleEntityAppend(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.full_signature: @KafkaListener(topics = "${entity.append.topic}", groupId = "historyManagerAppend") public void handleEntityAppend(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.identifier: handleEntityAppend
focal_class.modifiers: @KafkaListener(topics = "${entity.append.topic}", groupId = "historyManagerAppend") public
focal_class.parameters: (@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.return: void
focal_class.signature: void handleEntityAppend(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.class_method_signature: HistoryService.handleEntityUpdate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.full_signature: @KafkaListener(topics = "${entity.update.topic}", groupId = "historyManagerUpdate") public void handleEntityUpdate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.identifier: handleEntityUpdate
focal_class.modifiers: @KafkaListener(topics = "${entity.update.topic}", groupId = "historyManagerUpdate") public
focal_class.parameters: (@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.return: void
focal_class.signature: void handleEntityUpdate(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.class_method_signature: HistoryService.handleEntityDelete(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.full_signature: @KafkaListener(topics = "${entity.delete.topic}", groupId = "historyManagerDelete") public void handleEntityDelete(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.identifier: handleEntityDelete
focal_class.modifiers: @KafkaListener(topics = "${entity.delete.topic}", groupId = "historyManagerDelete") public
focal_class.parameters: (@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_class.return: void
focal_class.signature: void handleEntityDelete(@Payload byte[] message, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String key)
focal_method.body: 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");
  	}
focal_method.class_method_signature: HistoryService.delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_method.full_signature: public void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_method.identifier: delete
focal_method.invocations: debug expandAttribute setAttributeId setInstanceId toJson trace pushToKafka temporalEntityWriteChannel getBytes getBytes trace
focal_method.modifiers: public
focal_method.parameters: (String entityId, String attributeId, String instanceId, List<Object> linkHeaders)
focal_method.return: void
focal_method.signature: void delete(String entityId, String attributeId, String instanceId, List<Object> linkHeaders)