/** * Test method for {@link org.apache.ace.connectionfactory.impl.UrlCredentials#getCredentials()}. */ @Test public void testGetCredentialsOk() throws Exception { UrlCredentials creds = new UrlCredentials(AuthType.NONE, new URL("http://localhost:8080/")); assertArrayEquals(new Object[0], creds.getCredentials()); creds = new UrlCredentials(AuthType.NONE, new URL("http://localhost:8080/"), "foo"); assertArrayEquals(new Object[] { "foo" }, creds.getCredentials()); creds = new UrlCredentials(AuthType.NONE, new URL("http://localhost:8080/"), (Object[]) null ); assertArrayEquals(new Object[0], creds.getCredentials()); creds = new UrlCredentials(AuthType.NONE, new URL("http://localhost:8080/"), (Object) null); assertArrayEquals(new Object[] { null }, creds.getCredentials()); }