HiveTableMigrationAPI { @RequestMapping(value = "/tables/{srcEnv}/{srcDB}", method = {RequestMethod.GET}) @ResponseBody public RestWrapperOptions getTablesList(@PathVariable("srcEnv") String srcEnv, @PathVariable("srcDB") String srcDB) { RestWrapperOptions restWrapperOptions = null; LOGGER.info(srcEnv + "srcEnvi"); LOGGER.info(srcDB + "srcDB"); try { Class.forName(driverName); connection = DriverManager.getConnection("jdbc:hive2: ResultSet rs = connection.createStatement().executeQuery("SHOW TABLES"); List<String> databases = new ArrayList<String>(); while (rs.next()) { String dbName = rs.getString(1); databases.add(dbName.toUpperCase()); } List<RestWrapperOptions.Option> options = new ArrayList<RestWrapperOptions.Option>(); for (String database : databases) { RestWrapperOptions.Option option = new RestWrapperOptions.Option(database, database); options.add(option); } restWrapperOptions = new RestWrapperOptions(options, RestWrapperOptions.OK); } catch (Exception e) { LOGGER.error("error occured " + e); restWrapperOptions = new RestWrapperOptions(e.getMessage(), RestWrapper.ERROR); } return restWrapperOptions; }  @RequestMapping(value = "/databases/{srcEnv:.+}", method = {RequestMethod.GET}) @ResponseBody RestWrapperOptions getDBList(@PathVariable("srcEnv") String sourceEnv); @RequestMapping(value = "/destdatabases/{destEnv:.+}", method = {RequestMethod.GET}) @ResponseBody RestWrapperOptions getdestDBList(@PathVariable("destEnv") String destEnv); @RequestMapping(value = "/tables/{srcEnv}/{srcDB}", method = {RequestMethod.GET}) @ResponseBody RestWrapperOptions getTablesList(@PathVariable("srcEnv") String srcEnv, @PathVariable("srcDB") String srcDB); @RequestMapping(value = "/createjobs/{checked}", method = RequestMethod.POST) @ResponseBody RestWrapper createJob(@RequestParam Map<String, String> map, Principal principal, @PathVariable("checked") String[] checkedTables); @RequestMapping(value = {"/cluster/{description}"}, method = RequestMethod.GET) @ResponseBody RestWrapper list(@PathVariable("description") String description, Principal principal); @RequestMapping(value = {"/insertcluster", "insertcluster"}, method = RequestMethod.PUT) @ResponseBody RestWrapper insertCluster(@ModelAttribute("clusterInfo")
                                     @Valid ClusterInfo cluster, BindingResult bindingResult, Principal principal); @RequestMapping(value = {"/updatecluster", "updatecluster"}, method = RequestMethod.POST) @ResponseBody RestWrapper updateCluster(@RequestParam Map<String, String> map, Principal principal);  }
@Test @Ignore public void getTablesList() { HiveTableMigrationAPI hiveTableMigrationAPI = new HiveTableMigrationAPI(); Map<String,String> map = new TreeMap<String, String>(); map.put("srcDB_default","default"); RestWrapperOptions restWrapperOptions = null; LOGGER.info(restWrapperOptions.getOptions().toString()); }