@Test void getModuleInvalidParameter() throws AnalyticsModelingCheckedException { DatabaseContextHandler databaseContextHandler = new DatabaseContextHandler(null, new InvalidParameterHandler()); when(restAPI.getModule(SERVER_NAME, USER, null, CATALOG, SCHEMA)).thenCallRealMethod(); when(restAPI.getHandler().getDatabaseContextHandler(SERVER_NAME, USER, "getModule")).thenReturn(databaseContextHandler); AnalyticsModelingOMASAPIResponse response = resource.getPhysicalModule(SERVER_NAME, USER, null, CATALOG, SCHEMA, null); assertTrue(response instanceof ErrorResponse); ErrorResponse errResponse = (ErrorResponse)response; assertEquals( 400, errResponse.getRelatedHTTPCode(), "Bad request http status is expected"); assertEquals( AnalyticsModelingErrorCode.INVALID_REQUEST_PARAMER.getMessageDefinition().getMessageId(), errResponse.getErrorCode(), "Wrong error code."); assertEquals( "OMAS-ANALYTICS-MODELING-015 The request parameter dataSourceGUID has invalid value.", errResponse.getMessage(), "Wrong error message."); assertEquals( "OMAG-COMMON-400-005 The unique identifier (guid) passed on the dataSourceGUID parameter of the getModule operation is null", errResponse.getExceptionCause(), "Wrong error details."); }
@PostMapping(path = "/{dataSourceGUID}/physicalModule") public AnalyticsModelingOMASAPIResponse getPhysicalModule( @PathVariable("serverName") String serverName, @PathVariable("userId") String userId, @PathVariable("dataSourceGUID") String dataSource, @RequestParam(required=false) String catalog, @RequestParam(required=true) String schema, @RequestBody(required=false) Object request ) { return restAPI.getModule(serverName, userId, dataSource, catalog, schema); }
AnalyticsModelingOMASResource { @PostMapping(path = "/{dataSourceGUID}/physicalModule") public AnalyticsModelingOMASAPIResponse getPhysicalModule( @PathVariable("serverName") String serverName, @PathVariable("userId") String userId, @PathVariable("dataSourceGUID") String dataSource, @RequestParam(required=false) String catalog, @RequestParam(required=true) String schema, @RequestBody(required=false) Object request ) { return restAPI.getModule(serverName, userId, dataSource, catalog, schema); } }
AnalyticsModelingOMASResource { @PostMapping(path = "/{dataSourceGUID}/physicalModule") public AnalyticsModelingOMASAPIResponse getPhysicalModule( @PathVariable("serverName") String serverName, @PathVariable("userId") String userId, @PathVariable("dataSourceGUID") String dataSource, @RequestParam(required=false) String catalog, @RequestParam(required=true) String schema, @RequestBody(required=false) Object request ) { return restAPI.getModule(serverName, userId, dataSource, catalog, schema); }  }
AnalyticsModelingOMASResource { @PostMapping(path = "/{dataSourceGUID}/physicalModule") public AnalyticsModelingOMASAPIResponse getPhysicalModule( @PathVariable("serverName") String serverName, @PathVariable("userId") String userId, @PathVariable("dataSourceGUID") String dataSource, @RequestParam(required=false) String catalog, @RequestParam(required=true) String schema, @RequestBody(required=false) Object request ) { return restAPI.getModule(serverName, userId, dataSource, catalog, schema); }  @GetMapping(path = "/databases") AnalyticsModelingOMASAPIResponse getDatabases(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
            @PositiveOrZero(message = "startFrom should be a positive number")
            @RequestParam Integer startFrom,
            @PositiveOrZero(message = "pageSize should be a positive number")
            @RequestParam Integer pageSize
            ); @GetMapping(path = "/{dataSourceGUID}/schemas") AnalyticsModelingOMASAPIResponse getSchemas(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
            @PathVariable("dataSourceGUID") String dataSource,
            @PositiveOrZero(message = "startFrom should be a positive number")
            @RequestParam Integer startFrom,
            @PositiveOrZero(message = "pageSize should be a positive number")
            @RequestParam Integer pageSize
			); @PostMapping(path = "/{dataSourceGUID}/tables") AnalyticsModelingOMASAPIResponse getTables(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
			@PathVariable("dataSourceGUID") String dataSource,
			@RequestParam(required = false) String catalog,
			@RequestParam(required = true) String schema,
			@RequestBody(required=false) Object request
			); @PostMapping(path = "/{dataSourceGUID}/physicalModule") AnalyticsModelingOMASAPIResponse getPhysicalModule(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
			@PathVariable("dataSourceGUID") String dataSource,
			@RequestParam(required=false) String catalog,
			@RequestParam(required=true) String schema,
			@RequestBody(required=false) Object request
			); }
AnalyticsModelingOMASResource { @PostMapping(path = "/{dataSourceGUID}/physicalModule") public AnalyticsModelingOMASAPIResponse getPhysicalModule( @PathVariable("serverName") String serverName, @PathVariable("userId") String userId, @PathVariable("dataSourceGUID") String dataSource, @RequestParam(required=false) String catalog, @RequestParam(required=true) String schema, @RequestBody(required=false) Object request ) { return restAPI.getModule(serverName, userId, dataSource, catalog, schema); }  @GetMapping(path = "/databases") AnalyticsModelingOMASAPIResponse getDatabases(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
            @PositiveOrZero(message = "startFrom should be a positive number")
            @RequestParam Integer startFrom,
            @PositiveOrZero(message = "pageSize should be a positive number")
            @RequestParam Integer pageSize
            ); @GetMapping(path = "/{dataSourceGUID}/schemas") AnalyticsModelingOMASAPIResponse getSchemas(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
            @PathVariable("dataSourceGUID") String dataSource,
            @PositiveOrZero(message = "startFrom should be a positive number")
            @RequestParam Integer startFrom,
            @PositiveOrZero(message = "pageSize should be a positive number")
            @RequestParam Integer pageSize
			); @PostMapping(path = "/{dataSourceGUID}/tables") AnalyticsModelingOMASAPIResponse getTables(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
			@PathVariable("dataSourceGUID") String dataSource,
			@RequestParam(required = false) String catalog,
			@RequestParam(required = true) String schema,
			@RequestBody(required=false) Object request
			); @PostMapping(path = "/{dataSourceGUID}/physicalModule") AnalyticsModelingOMASAPIResponse getPhysicalModule(
			@PathVariable("serverName") String serverName,
            @PathVariable("userId") String userId,
			@PathVariable("dataSourceGUID") String dataSource,
			@RequestParam(required=false) String catalog,
			@RequestParam(required=true) String schema,
			@RequestBody(required=false) Object request
			);  }