@Test void testCreateIntegratedEntity() throws Exception { when(mappingJobExecution.getEntityType()).thenReturn(mappingJobExecutionMetadata); when(mappingJobExecution.getIdValue()).thenReturn("mappingJobExecution"); when(mappingJobExecutionMetadata.getId()).thenReturn("mappingJobExecutionMetadata"); when(mappingJobExecutionFactory.create()).thenReturn(mappingJobExecution); when(jobsController.createJobExecutionViewHref( "/api/v2/mappingJobExecutionMetadata/mappingJobExecution", 1000)) .thenReturn("/jobs/viewJob/?jobHref=jobHref&refreshTimeoutMillis=1000"); mockMvc .perform( post(URI + "/createIntegratedEntity") .param("mappingProjectId", "mappingProjectId") .param("targetEntityTypeId", "targetEntityTypeId") .param("label", "label") .param("package", "base") .accept("text/plain")) .andExpect(status().isFound()) .andExpect( header() .string("Location", "/jobs/viewJob/?jobHref=jobHref&refreshTimeoutMillis=1000")); verify(jobExecutor).submit(mappingJobExecution); verify(mappingJobExecution).setMappingProjectId("mappingProjectId"); verify(mappingJobExecution).setLabel("label"); verify(mappingJobExecution).setAddSourceAttribute(null); verify(mappingJobExecution).setTargetEntityTypeId("targetEntityTypeId"); verify(mappingJobExecution).setPackageId("base"); verify(mappingJobExecution).getIdValue(); verify(mappingJobExecution).getEntityType(); Mockito.verifyNoMoreInteractions(mappingJobExecution); }
@PostMapping("/createIntegratedEntity") public String createIntegratedEntity( @RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) { if (label != null && label.trim().isEmpty()) { label = null; } String mappingJobExecutionHref = submitMappingJob(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label) .getBody(); return format( "redirect:{0}", jobsController.createJobExecutionViewHref(mappingJobExecutionHref, 1000)); }
MappingServiceController extends PluginController { @PostMapping("/createIntegratedEntity") public String createIntegratedEntity( @RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) { if (label != null && label.trim().isEmpty()) { label = null; } String mappingJobExecutionHref = submitMappingJob(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label) .getBody(); return format( "redirect:{0}", jobsController.createJobExecutionViewHref(mappingJobExecutionHref, 1000)); } }
MappingServiceController extends PluginController { @PostMapping("/createIntegratedEntity") public String createIntegratedEntity( @RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) { if (label != null && label.trim().isEmpty()) { label = null; } String mappingJobExecutionHref = submitMappingJob(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label) .getBody(); return format( "redirect:{0}", jobsController.createJobExecutionViewHref(mappingJobExecutionHref, 1000)); } MappingServiceController(
      AlgorithmService algorithmService,
      MappingService mappingService,
      DataService dataService,
      OntologyTagService ontologyTagService,
      SemanticSearchService semanticSearchService,
      MenuReaderService menuReaderService,
      MappingJobExecutionFactory mappingJobExecutionFactory,
      JobExecutor jobExecutor,
      JobsController jobsController); }
MappingServiceController extends PluginController { @PostMapping("/createIntegratedEntity") public String createIntegratedEntity( @RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) { if (label != null && label.trim().isEmpty()) { label = null; } String mappingJobExecutionHref = submitMappingJob(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label) .getBody(); return format( "redirect:{0}", jobsController.createJobExecutionViewHref(mappingJobExecutionHref, 1000)); } MappingServiceController(
      AlgorithmService algorithmService,
      MappingService mappingService,
      DataService dataService,
      OntologyTagService ontologyTagService,
      SemanticSearchService semanticSearchService,
      MenuReaderService menuReaderService,
      MappingJobExecutionFactory mappingJobExecutionFactory,
      JobExecutor jobExecutor,
      JobsController jobsController); @GetMapping String viewMappingProjects(Model model); @PostMapping("/addMappingProject") String addMappingProject(
      @RequestParam("mapping-project-name") String name,
      @RequestParam("target-entity") String targetEntity,
      @RequestParam("depth") int depth); @PostMapping("/removeMappingProject") String deleteMappingProject(@RequestParam() String mappingProjectId); @PostMapping("/removeAttributeMapping") String removeAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String attribute); @PostMapping("/addEntityMapping") String addEntityMapping(
      @RequestParam String mappingProjectId, String target, String source, String algorithmSource); @PostMapping("/removeEntityMapping") String removeEntityMapping(
      @RequestParam String mappingProjectId, String target, String source); @PostMapping("/validateAttrMapping") @ResponseBody AttributeMappingValidationReport validateAttributeMapping(
      @Valid @RequestBody MappingServiceRequest mappingServiceRequest); @PostMapping("/saveattributemapping") String saveAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm,
      @RequestParam() AlgorithmState algorithmState); @PostMapping("/firstattributemapping") @ResponseBody FirstAttributeMappingInfo getFirstAttributeMappingInfo(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam(value = "skipAlgorithmStates[]") List<AlgorithmState> skipAlgorithmStates,
      Model model); @GetMapping("/mappingproject/{id}") String viewMappingProject(@PathVariable("id") String identifier, Model model); @PostMapping("/mappingproject/clone") String cloneMappingProject(@RequestParam("mappingProjectId") String mappingProjectId); @PostMapping("/mappingproject/setDepth") String cloneMappingProject(
      @RequestParam("mappingProjectId") String mappingProjectId, @RequestParam("depth") int depth); @PostMapping(value = "/attributeMapping/semanticsearch", consumes = APPLICATION_JSON_VALUE) @ResponseBody List<ExplainedAttributeDto> getSemanticSearchAttributeMapping(
      @RequestBody Map<String, String> requestBody); @PostMapping(value = "/attributemapping/algorithm", consumes = APPLICATION_JSON_VALUE) @ResponseBody String getSuggestedAlgorithm(
      @RequestBody GenerateAlgorithmRequest generateAlgorithmRequest); @GetMapping("/isNewEntity") @ResponseBody boolean isNewEntity(@RequestParam String targetEntityTypeId); @PostMapping("/createIntegratedEntity") String createIntegratedEntity(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) String label,
      @RequestParam(required = false, name = "package") String packageId,
      @RequestParam(required = false) Boolean addSourceAttribute); @PostMapping(value = "/map", produces = TEXT_PLAIN_VALUE) ResponseEntity<String> scheduleMappingJob(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) String label,
      @RequestParam(required = false, name = "package") String rawPackageId,
      @RequestParam(required = false) Boolean addSourceAttribute); @PostMapping(value = "/submit", produces = TEXT_PLAIN_VALUE) ResponseEntity<String> submitMappingJob(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) Boolean addSourceAttribute,
      @RequestParam(required = false, name = "package") String packageId,
      @RequestParam(required = false) String label); @GetMapping("/attributeMapping") String viewAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      Model model); @PostMapping("/attributemappingfeedback") String attributeMappingFeedback(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm,
      Model model); @PostMapping("/advancedmappingeditor") String advancedMappingEditor(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String sourceAttribute,
      @RequestParam String algorithm,
      Model model); @PostMapping("/savecategorymapping") @ResponseBody void saveCategoryMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm); @PostMapping( value = "/mappingattribute/testscript", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE) @ResponseBody Map<String, Object> testScript(@RequestBody MappingServiceRequest mappingServiceRequest); }
MappingServiceController extends PluginController { @PostMapping("/createIntegratedEntity") public String createIntegratedEntity( @RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) { if (label != null && label.trim().isEmpty()) { label = null; } String mappingJobExecutionHref = submitMappingJob(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label) .getBody(); return format( "redirect:{0}", jobsController.createJobExecutionViewHref(mappingJobExecutionHref, 1000)); } MappingServiceController(
      AlgorithmService algorithmService,
      MappingService mappingService,
      DataService dataService,
      OntologyTagService ontologyTagService,
      SemanticSearchService semanticSearchService,
      MenuReaderService menuReaderService,
      MappingJobExecutionFactory mappingJobExecutionFactory,
      JobExecutor jobExecutor,
      JobsController jobsController); @GetMapping String viewMappingProjects(Model model); @PostMapping("/addMappingProject") String addMappingProject(
      @RequestParam("mapping-project-name") String name,
      @RequestParam("target-entity") String targetEntity,
      @RequestParam("depth") int depth); @PostMapping("/removeMappingProject") String deleteMappingProject(@RequestParam() String mappingProjectId); @PostMapping("/removeAttributeMapping") String removeAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String attribute); @PostMapping("/addEntityMapping") String addEntityMapping(
      @RequestParam String mappingProjectId, String target, String source, String algorithmSource); @PostMapping("/removeEntityMapping") String removeEntityMapping(
      @RequestParam String mappingProjectId, String target, String source); @PostMapping("/validateAttrMapping") @ResponseBody AttributeMappingValidationReport validateAttributeMapping(
      @Valid @RequestBody MappingServiceRequest mappingServiceRequest); @PostMapping("/saveattributemapping") String saveAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm,
      @RequestParam() AlgorithmState algorithmState); @PostMapping("/firstattributemapping") @ResponseBody FirstAttributeMappingInfo getFirstAttributeMappingInfo(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam(value = "skipAlgorithmStates[]") List<AlgorithmState> skipAlgorithmStates,
      Model model); @GetMapping("/mappingproject/{id}") String viewMappingProject(@PathVariable("id") String identifier, Model model); @PostMapping("/mappingproject/clone") String cloneMappingProject(@RequestParam("mappingProjectId") String mappingProjectId); @PostMapping("/mappingproject/setDepth") String cloneMappingProject(
      @RequestParam("mappingProjectId") String mappingProjectId, @RequestParam("depth") int depth); @PostMapping(value = "/attributeMapping/semanticsearch", consumes = APPLICATION_JSON_VALUE) @ResponseBody List<ExplainedAttributeDto> getSemanticSearchAttributeMapping(
      @RequestBody Map<String, String> requestBody); @PostMapping(value = "/attributemapping/algorithm", consumes = APPLICATION_JSON_VALUE) @ResponseBody String getSuggestedAlgorithm(
      @RequestBody GenerateAlgorithmRequest generateAlgorithmRequest); @GetMapping("/isNewEntity") @ResponseBody boolean isNewEntity(@RequestParam String targetEntityTypeId); @PostMapping("/createIntegratedEntity") String createIntegratedEntity(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) String label,
      @RequestParam(required = false, name = "package") String packageId,
      @RequestParam(required = false) Boolean addSourceAttribute); @PostMapping(value = "/map", produces = TEXT_PLAIN_VALUE) ResponseEntity<String> scheduleMappingJob(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) String label,
      @RequestParam(required = false, name = "package") String rawPackageId,
      @RequestParam(required = false) Boolean addSourceAttribute); @PostMapping(value = "/submit", produces = TEXT_PLAIN_VALUE) ResponseEntity<String> submitMappingJob(
      @RequestParam String mappingProjectId,
      @RequestParam String targetEntityTypeId,
      @RequestParam(required = false) Boolean addSourceAttribute,
      @RequestParam(required = false, name = "package") String packageId,
      @RequestParam(required = false) String label); @GetMapping("/attributeMapping") String viewAttributeMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      Model model); @PostMapping("/attributemappingfeedback") String attributeMappingFeedback(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm,
      Model model); @PostMapping("/advancedmappingeditor") String advancedMappingEditor(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String sourceAttribute,
      @RequestParam String algorithm,
      Model model); @PostMapping("/savecategorymapping") @ResponseBody void saveCategoryMapping(
      @RequestParam() String mappingProjectId,
      @RequestParam() String target,
      @RequestParam() String source,
      @RequestParam() String targetAttribute,
      @RequestParam() String algorithm); @PostMapping( value = "/mappingattribute/testscript", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE) @ResponseBody Map<String, Object> testScript(@RequestBody MappingServiceRequest mappingServiceRequest); static final String ID; static final String URI; }