### Question:
FederatedRepositorySource implements RepositorySource, ObjectFactory { public RepositoryConnection getConnection() throws RepositorySourceException { FederatedRepository config = this.configuration; if (config == null) { synchronized (this) { if (this.configuration == null) { String name = getName(); if (name == null) { I18n msg = GraphI18n.namePropertyIsRequiredForFederatedRepositorySource; throw new RepositorySourceException(getName(), msg.text("name")); } RepositoryContext repositoryContext = getRepositoryContext(); if (repositoryContext == null) { I18n msg = GraphI18n.federatedRepositorySourceMustBeInitialized; throw new RepositorySourceException(getName(), msg.text("name", name)); } this.configuration = loadRepository(name, repositoryContext); } config = this.configuration; } } Observer observer = this.context != null ? this.context.getObserver() : null; return new FederatedRepositoryConnection(config, observer); } FederatedRepositorySource(); String getName(); synchronized void setName( String name ); int getRetryLimit(); synchronized void setRetryLimit( int limit ); RepositorySourceCapabilities getCapabilities(); synchronized void initialize( RepositoryContext context ); RepositoryConnection getConnection(); void close(); Reference getReference(); Object getObjectInstance( Object obj,
                                     Name name,
                                     Context nameCtx,
                                     Hashtable<?, ?> environment ); @Override int hashCode(); @Override boolean equals( Object obj ); synchronized FederatedWorkspace addWorkspace( String workspaceName,
                                                         Iterable<Projection> projections,
                                                         boolean isDefault ); synchronized boolean removeWorkspace( String workspaceName ); synchronized boolean hasWorkspace( String workspaceName ); static final int DEFAULT_RETRY_LIMIT; }### Answer:
@Test public void shouldCreateConnectionsByAuthenticateUsingFederationRepository() throws Exception { connection = source.getConnection(); assertThat(connection, is(notNullValue())); }