@Test
public void testGetObject() throws Exception {

    SimpleCredentialsFactoryBean factoryBean = new SimpleCredentialsFactoryBean();
    factoryBean.setUserID("testuser");
    factoryBean.setPassword("secret");
    SimpleCredentials sc = factoryBean.getObject();
    assertNotNull(sc);
    assertEquals(factoryBean.getObjectType(), sc.getClass());
    assertEquals("testuser", sc.getUserID());
    assertEquals("secret", new String(sc.getPassword()));
}