RestAssured.baseURI, basePath, and port set the common server target once so individual tests use short relative paths (.get('/users')) instead of full URLs, making the suite portable across environments.
Setting RestAssured.baseURI = 'https://api.example.com'; RestAssured.basePath = '/v1'; RestAssured.port = 443; means .get('/users') hits https://api.example.com:443/v1/users. This is typically done in a @BeforeClass/@BeforeSuite so every test inherits it, and you can override per test via given().baseUri(...). Externalizing these values (from a properties file or env variable) lets the SAME tests run against dev/staging/prod by changing config, not code. Resetting with RestAssured.reset() clears static config between suites to avoid leakage.
@BeforeClass sets RestAssured.baseURI from a config file, so switching from staging to prod is a one-line property change and every test retargets automatically.
How do you run the exact same REST Assured suite against staging and production without editing the tests?