}
@Test
public void makeObject() throws Exception
{
OAuthState state = this.registerState();
TestOAuth2Adapter connector = (TestOAuth2Adapter) this.factory.makeObject(KEY);
Assert.assertSame(connector.getManager(), this.manager);
Mockito.verify(this.factory).setCustomAdapterProperties(connector, state);
Mockito.verify(this.manager).postAuth(connector, KEY);
Assert.assertTrue(connector.wasStarted());
Assert.assertTrue(connector.wasInitialised());
Assert.assertSame(connector.getMuleContext(), this.muleContext);
Assert.assertEquals(connector.getConsumerKey(), consumerKey);
Assert.assertEquals(connector.getConsumerSecret(), consumerSecret);
Assert.assertEquals(connector.getAccessToken(), state.getAccessToken());
Assert.assertEquals(connector.getAccessTokenUrl(), state.getAccessTokenUrl());
Assert.assertEquals(connector.getAuthorizationUrl(), state.getAuthorizationUrl());
Assert.assertEquals(connector.getRefreshToken(), state.getRefreshToken());
Mockito.verify(this.objectStore, Mockito.never()).remove(KEY);
Mockito.verify(this.objectStore, Mockito.never()).store(Mockito.eq(KEY),
Mockito.any(OAuthState.class));
}