package studycave.studycaverestservice;

import io.restassured.RestAssured;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class PropertiesLoader {

    @Value("${usos.baseURI}")
    private String usosBaseURI;

    @Value("${usos.basePath}")
    private String usosBasePath;

    @Value("${usos.port}")
    private int usosPort;

    @Value("${application.key}")
    private String key;

    @Value("${application.secret}")
    private String secret;

    @Value("${server.address}")
    private String serverAddress;

    @Value("${server.port}")
    private String serverPort;

    public void initUsosInstance() {
        RestAssured.baseURI = usosBaseURI;
        RestAssured.basePath = usosBasePath;
        RestAssured.port = usosPort;
    }

    public String getUsosApiURL() {
        return usosBaseURI + usosBasePath;
    }

    public String getKey() {
        return key;
    }

    public String getSecret() {
        return secret;
    }

    public String getServerAddress() {
        return serverAddress;
    }

    public String getServerPort() {
        return serverPort;
    }
}
