Package com.denimgroup.threadfix.properties

Examples of com.denimgroup.threadfix.properties.PropertiesManager


*/
public class HttpRestUtilsTests {

    @Test
    public void testSetUrl() {
        PropertiesManager utils = new PropertiesManager();
        utils.setUrl(TestPropertiesManager.URL);
        try {
            Configuration properties = new PropertiesConfiguration("threadfix.properties");
            assertEquals(TestPropertiesManager.URL, properties.getString("url"));
        } catch (ConfigurationException e) {
            Assert.fail();
View Full Code Here


        }
    }

    @Test
    public void testSetKey() {
        PropertiesManager utils = new PropertiesManager();
        utils.setKey(TestPropertiesManager.API_KEY);
        try {
            Configuration properties = new PropertiesConfiguration("threadfix.properties");
            assertEquals(TestPropertiesManager.API_KEY, properties.getString("key"));
        } catch (ConfigurationException e) {
            Assert.fail();
View Full Code Here

    public static Object getJSONObject(String responseContents) {
        return new Gson().fromJson(responseContents, Object.class);
    }

    public static PropertiesManager getPropertiesManager() {
        PropertiesManager manager = new PropertiesManager();
        manager.setMemoryKey(URL);
        manager.setKey(API_KEY);
        return manager;
    }
View Full Code Here

    }

    // the UI validation should ensure that the /rest part of the returned url is valid.
    public static RestResponse<Object> test(String url, String key) {

        PropertiesManager tempManager = new PropertiesManager();
        tempManager.setKey(key);
        tempManager.setUrl(url);

        HttpRestUtils utils = new HttpRestUtils(tempManager);
        return utils.httpGet(Constants.MARKERS_URL_SEGMENT + "0");
    }
View Full Code Here

    private static final SanitizedLogger LOGGER = new SanitizedLogger(PluginClient.class);

    final HttpRestUtils httpRestUtils;

    public PluginClient(String url, String key) {
        PropertiesManager propertiesManager = new PropertiesManager();
        propertiesManager.setMemoryKey(key);
        propertiesManager.setUrl(url);
        httpRestUtils = new HttpRestUtils(propertiesManager);
    }
View Full Code Here

  /**
   * Default constructor that will read configuration from a local .properties file
   */
  public ThreadFixRestClientImpl() {
        propertiesManager = new PropertiesManager();
        httpRestUtils = new HttpRestUtils(propertiesManager);
  }
View Full Code Here

   *
   * @param url URL for the ThreadFix server
   * @param apiKey API key to use when accessing the ThreadFix server
   */
  public ThreadFixRestClientImpl(String url, String apiKey) {
        propertiesManager = new PropertiesManager();
        propertiesManager.setMemoryKey(apiKey);
        propertiesManager.setMemoryUrl(url);
        httpRestUtils = new HttpRestUtils(propertiesManager);
  }
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.properties.PropertiesManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.