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: paramResolver
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private ParamsResolver paramResolver;
test_class.type: ParamsResolver
test_class.var_name: paramResolver
test_class.declarator: historyService
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private HistoryService historyService;
test_class.type: HistoryService
test_class.var_name: historyService
test_class.declarator: validate
test_class.modifier: @MockBean
  	private
test_class.original_string: @MockBean
  	private Validator validate;
test_class.type: Validator
test_class.var_name: validate
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: contextResolver
test_class.modifier: @Autowired
test_class.original_string: @Autowired
  	ContextResolverBasic contextResolver;
test_class.type: ContextResolverBasic
test_class.var_name: contextResolver
test_class.declarator: atContextServerUrl
test_class.modifier: @Value("${atcontext.url}")
test_class.original_string: @Value("${atcontext.url}")
  	String atContextServerUrl;
test_class.type: String
test_class.var_name: atContextServerUrl
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.declarator: uri
test_class.modifier: private
test_class.original_string: private URI uri;
test_class.type: URI
test_class.var_name: uri
test_class.file: History/HistoryManager/src/test/java/eu/neclab/ngsildbroker/historymanager/controller/HistoryControllerTest.java
test_class.identifier: HistoryControllerTest
test_case.body: @Test
  	public void modifyAttribInstanceTemporalEntityBadRequest() {
  
  		try {
  			Mockito.doThrow(new ResponseException(ErrorType.BadRequestData)).when(historyService)
  					.modifyAttribInstanceTemporalEntity(any(), any(), any(), any(), any());
  			mockMvc.perform(patch("/ngsi-ld/v1/temporal/entities/{entityId}/attrs/{attrId}/{instanceId}",
  					"urn:ngsi-ld:testunit:151", "airQualityLevel", "urn:ngsi-ld:d43aa0fe-a986-4479-9fac-35b7eba232041")
  							.contentType(AppConstants.NGB_APPLICATION_JSON).accept(AppConstants.NGB_APPLICATION_JSONLD)
  							.content(temporalPayload))
  					.andExpect(status().isBadRequest());
  		} catch (Exception e) {
  			Assert.fail(e.getMessage());
  		}
  	}
test_case.class_method_signature: HistoryControllerTest.modifyAttribInstanceTemporalEntityBadRequest()
test_case.full_signature: @Test public void modifyAttribInstanceTemporalEntityBadRequest()
test_case.identifier: modifyAttribInstanceTemporalEntityBadRequest
test_case.invocations: modifyAttribInstanceTemporalEntity when doThrow any any any any any andExpect perform content accept contentType patch isBadRequest status fail getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void modifyAttribInstanceTemporalEntityBadRequest()
focal_class.declarator: logger = LoggerFactory.getLogger(HistoryController.class)
focal_class.modifier: private final static
focal_class.original_string: private final static Logger logger = LoggerFactory.getLogger(HistoryController.class);
focal_class.type: Logger
focal_class.var_name: logger
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: historyService
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
  	HistoryService historyService;
focal_class.type: HistoryService
focal_class.var_name: historyService
focal_class.declarator: contextResolver
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
  	ContextResolverBasic contextResolver;
focal_class.type: ContextResolverBasic
focal_class.var_name: contextResolver
focal_class.declarator: atContextServerUrl
focal_class.modifier: @Value("${atcontext.url}")
focal_class.original_string: @Value("${atcontext.url}")
  	String atContextServerUrl;
focal_class.type: String
focal_class.var_name: atContextServerUrl
focal_class.declarator: httpUtils
focal_class.modifier: private
focal_class.original_string: private HttpUtils httpUtils;
focal_class.type: HttpUtils
focal_class.var_name: httpUtils
focal_class.file: History/HistoryManager/src/main/java/eu/neclab/ngsildbroker/historymanager/controller/HistoryController.java
focal_class.identifier: HistoryController
focal_class.class_method_signature: HistoryController.setup()
focal_class.full_signature: @PostConstruct private void setup()
focal_class.identifier: setup
focal_class.modifiers: @PostConstruct private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setup()
focal_class.class_method_signature: HistoryController.createTemporalEntity(HttpServletRequest request,
  			@RequestBody(required = false) String payload)
focal_class.full_signature: @PostMapping public ResponseEntity<byte[]> createTemporalEntity(HttpServletRequest request,
  			@RequestBody(required = false) String payload)
focal_class.identifier: createTemporalEntity
focal_class.modifiers: @PostMapping public
focal_class.parameters: (HttpServletRequest request,
  			@RequestBody(required = false) String payload)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> createTemporalEntity(HttpServletRequest request,
  			@RequestBody(required = false) String payload)
focal_class.class_method_signature: HistoryController.retrieveTemporalEntity(HttpServletRequest request)
focal_class.full_signature: @GetMapping public ResponseEntity<byte[]> retrieveTemporalEntity(HttpServletRequest request)
focal_class.identifier: retrieveTemporalEntity
focal_class.modifiers: @GetMapping public
focal_class.parameters: (HttpServletRequest request)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> retrieveTemporalEntity(HttpServletRequest request)
focal_class.class_method_signature: HistoryController.retrieveTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.full_signature: @GetMapping("/{entityId}") public ResponseEntity<byte[]> retrieveTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.identifier: retrieveTemporalEntityById
focal_class.modifiers: @GetMapping("/{entityId}") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> retrieveTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.class_method_signature: HistoryController.deleteTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.full_signature: @DeleteMapping("/{entityId}") public ResponseEntity<byte[]> deleteTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.identifier: deleteTemporalEntityById
focal_class.modifiers: @DeleteMapping("/{entityId}") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> deleteTemporalEntityById(HttpServletRequest request,
  			@PathVariable("entityId") String entityId)
focal_class.class_method_signature: HistoryController.addAttrib2TemopralEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @RequestBody(required = false) String payload)
focal_class.full_signature: @PostMapping("/{entityId}/attrs") public ResponseEntity<byte[]> addAttrib2TemopralEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @RequestBody(required = false) String payload)
focal_class.identifier: addAttrib2TemopralEntity
focal_class.modifiers: @PostMapping("/{entityId}/attrs") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @RequestBody(required = false) String payload)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> addAttrib2TemopralEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @RequestBody(required = false) String payload)
focal_class.class_method_signature: HistoryController.deleteAttrib2TemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId)
focal_class.full_signature: @DeleteMapping("/{entityId}/attrs/{attrId}") public ResponseEntity<byte[]> deleteAttrib2TemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId)
focal_class.identifier: deleteAttrib2TemporalEntity
focal_class.modifiers: @DeleteMapping("/{entityId}/attrs/{attrId}") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> deleteAttrib2TemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId)
focal_class.class_method_signature: HistoryController.modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_class.full_signature: @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}") public ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_class.identifier: modifyAttribInstanceTemporalEntity
focal_class.modifiers: @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_class.class_method_signature: HistoryController.deleteAtrribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId)
focal_class.full_signature: @DeleteMapping("/{entityId}/attrs/{attrId}/{instanceId}") public ResponseEntity<byte[]> deleteAtrribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId)
focal_class.identifier: deleteAtrribInstanceTemporalEntity
focal_class.modifiers: @DeleteMapping("/{entityId}/attrs/{attrId}/{instanceId}") public
focal_class.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId)
focal_class.return: ResponseEntity<byte[]>
focal_class.signature: ResponseEntity<byte[]> deleteAtrribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId)
focal_method.body: @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}")
  	public ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload) {
  		try {
  			logger.trace("modifyAttribInstanceTemporalEntity :: started");
  			logger.debug("entityId : " + entityId + " attrId : " + attrId + " instanceId : " + instanceId);
  
  			String resolved = httpUtils.expandPayload(request, payload, AppConstants.HISTORY_URL_ID);
  
  			// TODO : TBD- conflict between specs and implementation <mentioned no request
  			// body in specs>
  			historyService.modifyAttribInstanceTemporalEntity(entityId, resolved, attrId, instanceId,
  					HttpUtils.parseLinkHeader(request, NGSIConstants.HEADER_REL_LDCONTEXT));
  			logger.trace("modifyAttribInstanceTemporalEntity :: completed");
  			return ResponseEntity.noContent().build();
  		} catch (ResponseException ex) {
  			logger.error("Exception", ex);
  			return ResponseEntity.status(ex.getHttpStatus()).body(new RestResponse(ex).toJsonBytes());
  		} catch (Exception ex) {
  			logger.error("Exception", ex);
  			return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
  					.body(new RestResponse(ErrorType.InternalError, ex.getLocalizedMessage()).toJsonBytes());
  		}
  	}
focal_method.class_method_signature: HistoryController.modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_method.full_signature: @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}") public ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_method.identifier: modifyAttribInstanceTemporalEntity
focal_method.invocations: trace debug expandPayload modifyAttribInstanceTemporalEntity parseLinkHeader trace build noContent error body status getHttpStatus toJsonBytes error body status toJsonBytes getLocalizedMessage
focal_method.modifiers: @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}") public
focal_method.parameters: (HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)
focal_method.return: ResponseEntity<byte[]>
focal_method.signature: ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
  			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
  			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload)