Fixed Session Tests

master
Stuart Boston 11 years ago
parent 5c6f6fd9b1
commit c2d2c7cbe3

1
.gitignore vendored

@ -7,3 +7,4 @@
/target/ /target/
/nbactions.xml /nbactions.xml
testing.properties

@ -83,8 +83,8 @@ public class TheMovieDbApiTest {
// API Key // API Key
private static final String PROP_FIlENAME = "testing.properties"; private static final String PROP_FIlENAME = "testing.properties";
private static String API_KEY; private static String API_KEY;
private static String SESSION_ID_APITESTS;
private static int ACCOUNT_ID_APITESTS; private static int ACCOUNT_ID_APITESTS;
private static String SESSION_ID_APITESTS;
private static TheMovieDbApi tmdb; private static TheMovieDbApi tmdb;
// Test data // Test data
private static final int ID_MOVIE_BLADE_RUNNER = 78; private static final int ID_MOVIE_BLADE_RUNNER = 78;
@ -115,8 +115,8 @@ public class TheMovieDbApiTest {
TestLogger.loadProperties(props, f); TestLogger.loadProperties(props, f);
API_KEY = props.getProperty("API_Key"); API_KEY = props.getProperty("API_Key");
SESSION_ID_APITESTS = props.getProperty("Account_ID"); ACCOUNT_ID_APITESTS = NumberUtils.toInt(props.getProperty("Account_ID"), 0);
ACCOUNT_ID_APITESTS = NumberUtils.toInt(props.getProperty("Session_ID"), 0); SESSION_ID_APITESTS = props.getProperty("Session_ID");
} else { } else {
LOG.info("Property file '{}' not found, creating dummy file.", PROP_FIlENAME); LOG.info("Property file '{}' not found, creating dummy file.", PROP_FIlENAME);
@ -161,11 +161,12 @@ public class TheMovieDbApiTest {
@Test @Test
public void testAccount() throws MovieDbException { public void testAccount() throws MovieDbException {
LOG.info("Using Session ID '{}' for test", SESSION_ID_APITESTS);
Account account = tmdb.getAccount(SESSION_ID_APITESTS); Account account = tmdb.getAccount(SESSION_ID_APITESTS);
// Make sure properties are extracted correctly // Make sure properties are extracted correctly
assertEquals(account.getUserName(), "apitests"); assertEquals("apitests", account.getUserName());
assertEquals(account.getId(), ACCOUNT_ID_APITESTS); assertEquals(ACCOUNT_ID_APITESTS, account.getId());
} }
@Ignore("Session required") @Ignore("Session required")

Loading…
Cancel
Save