From f908794e2b15a332a46588e5b7053ec670d7d875 Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Wed, 1 Oct 2014 14:43:42 +0100 Subject: [PATCH] Fixed properties load --- src/test/java/com/omertron/themoviedbapi/TestLogger.java | 1 + .../java/com/omertron/themoviedbapi/TheMovieDbApiTest.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/omertron/themoviedbapi/TestLogger.java b/src/test/java/com/omertron/themoviedbapi/TestLogger.java index 439b89f27..944a7e616 100644 --- a/src/test/java/com/omertron/themoviedbapi/TestLogger.java +++ b/src/test/java/com/omertron/themoviedbapi/TestLogger.java @@ -98,6 +98,7 @@ public class TestLogger { InputStream is = null; try { is = new FileInputStream(f); + props.load(is); } catch (Exception ex) { LOG.warn("Failed to load properties file", ex); } finally { diff --git a/src/test/java/com/omertron/themoviedbapi/TheMovieDbApiTest.java b/src/test/java/com/omertron/themoviedbapi/TheMovieDbApiTest.java index 32e0c5e16..d60078bef 100644 --- a/src/test/java/com/omertron/themoviedbapi/TheMovieDbApiTest.java +++ b/src/test/java/com/omertron/themoviedbapi/TheMovieDbApiTest.java @@ -107,7 +107,6 @@ public class TheMovieDbApiTest { @BeforeClass public static void setUpClass() throws Exception { TestLogger.Configure(); - tmdb = new TheMovieDbApi(API_KEY); Properties props = new Properties(); File f = new File(PROP_FIlENAME); @@ -118,7 +117,6 @@ public class TheMovieDbApiTest { API_KEY = props.getProperty("API_Key"); SESSION_ID_APITESTS = props.getProperty("Account_ID"); ACCOUNT_ID_APITESTS = NumberUtils.toInt(props.getProperty("Session_ID"), 0); - } else { LOG.info("Property file '{}' not found, creating dummy file.", PROP_FIlENAME); @@ -130,6 +128,7 @@ public class TheMovieDbApiTest { fail("Failed to get key information from properties file '" + PROP_FIlENAME + "'"); } + tmdb = new TheMovieDbApi(API_KEY); } @AfterClass