### Question:
HistoryController { @PostMapping public ResponseEntity<byte[]> createTemporalEntity(HttpServletRequest request, @RequestBody(required = false) String payload) { try { logger.trace("createTemporalEntity :: started"); Validator.validateTemporalEntity(payload); String resolved = httpUtils.expandPayload(request, payload, AppConstants.HISTORY_URL_ID); URI uri = historyService.createTemporalEntityFromBinding(resolved); logger.trace("createTemporalEntity :: completed"); return ResponseEntity.status(HttpStatus.CREATED).header("Location", uri.toString()).body(uri.toString().getBytes()); } catch (ResponseException exception) { logger.error("Exception", exception); return ResponseEntity.status(exception.getHttpStatus()).body(new RestResponse(exception).toJsonBytes()); } catch (Exception exception) { logger.error("Exception", exception); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new RestResponse(ErrorType.InternalError, exception.getLocalizedMessage()).toJsonBytes()); } }  @PostMapping ResponseEntity<byte[]> createTemporalEntity(HttpServletRequest request,
			@RequestBody(required = false) String payload); @GetMapping ResponseEntity<byte[]> retrieveTemporalEntity(HttpServletRequest request); @GetMapping("/{entityId}") ResponseEntity<byte[]> retrieveTemporalEntityById(HttpServletRequest request,
			@PathVariable("entityId") String entityId); @DeleteMapping("/{entityId}") ResponseEntity<byte[]> deleteTemporalEntityById(HttpServletRequest request,
			@PathVariable("entityId") String entityId); @PostMapping("/{entityId}/attrs") ResponseEntity<byte[]> addAttrib2TemopralEntity(HttpServletRequest request,
			@PathVariable("entityId") String entityId, @RequestBody(required = false) String payload); @DeleteMapping("/{entityId}/attrs/{attrId}") ResponseEntity<byte[]> deleteAttrib2TemporalEntity(HttpServletRequest request,
			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId); @PatchMapping("/{entityId}/attrs/{attrId}/{instanceId}") ResponseEntity<byte[]> modifyAttribInstanceTemporalEntity(HttpServletRequest request,
			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
			@PathVariable("instanceId") String instanceId, @RequestBody(required = false) String payload); @DeleteMapping("/{entityId}/attrs/{attrId}/{instanceId}") ResponseEntity<byte[]> deleteAtrribInstanceTemporalEntity(HttpServletRequest request,
			@PathVariable("entityId") String entityId, @PathVariable("attrId") String attrId,
			@PathVariable("instanceId") String instanceId);  }### Answer:
@Test public void createTemporalEntityTest() { try { when(historyService.createTemporalEntityFromBinding(any())).thenReturn(uri); mockMvc.perform(post("/ngsi-ld/v1/temporal/entities/").contentType(AppConstants.NGB_APPLICATION_JSONLD) .accept(AppConstants.NGB_APPLICATION_JSONLD).content(temporalPayload)) .andExpect(status().isCreated()); verify(historyService, times(1)).createTemporalEntityFromBinding(any()); } catch (Exception e) { Assert.fail(e.getMessage()); } }