@Test public void testGetPasswordExplicitWhenPresent() { appendLine("username = foo"); appendLine("host = localhost"); appendLine("password = foofoo"); ConcourseClientPreferences prefs = ConcourseClientPreferences .from(prefsPath); Assert.assertEquals("foofoo", new String(prefs.getPasswordExplicit())); }
@Test public void testGetPasswordExplicitWhenAbset() { appendLine("username = foo"); appendLine("host = localhost"); ConcourseClientPreferences prefs = ConcourseClientPreferences .from(prefsPath); Assert.assertEquals(ConcourseClientPreferences.NO_PASSWORD_DEFINED, prefs.getPasswordExplicit()); }
@Test public void testGetPortWhenWrittenAsString() { appendLine("port = \"1717\""); ConcourseClientPreferences prefs = ConcourseClientPreferences .from(prefsPath); Assert.assertEquals(1717, prefs.getPort()); }