// Path: src/main/java/org/ominidi/Application.java
// @SpringBootApplication
// public class Application {
//     public static void main(String[] args) throws Exception {
//         SpringApplication.run(Application.class, args);
//     }
// }
// 
// Path: src/main/java/org/ominidi/facebook/configuration/FacebookConfig.java
// @Getter
// @Setter
// @Configuration
// @ConfigurationProperties(prefix = "facebook")
// public class FacebookConfig {
//     private String graphAccessTokenUri;
//     private Map<String, String> page = new HashMap<>();
//     private Map<String, String> application = new HashMap<>();
// }
// 
// Path: src/main/java/org/ominidi/facebook/client/ClientFactory.java
// @Configuration
// @Import(FacebookConfig.class)
// public class ClientFactory {
// 
//     @Autowired
//     private FacebookConfig facebookConfig;
// 
//     public FacebookClient getClient() {
//         String appId = facebookConfig.getApplication().get("app_id");
//         String appSecret = facebookConfig.getApplication().get("app_secret");
// 
//         FacebookClient.AccessToken token = new DefaultFacebookClient(Version.VERSION_2_8).obtainAppAccessToken(appId, appSecret);
//         return new DefaultFacebookClient(token.getAccessToken(), appSecret, Version.VERSION_2_8);
//     }
// }
// 
// Path: src/main/java/org/ominidi/facebook/exception/ConnectionException.java
// public class ConnectionException extends Exception {
//     public ConnectionException(String message) {
//         super(message);
//     }
// 
//     public ConnectionException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public ConnectionException(Throwable cause) {
//         super(cause);
//     }
// }


import com.restfb.*;
import com.restfb.json.JsonObject;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ominidi.Application;
import org.ominidi.facebook.configuration.FacebookConfig;
import org.ominidi.facebook.client.ClientFactory;
import org.ominidi.facebook.exception.ConnectionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;

package org.ominidi.facebook.repository;



@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@ActiveProfiles(value = "test")
public class PageFeedIntegrationTest {

    @Autowired
    private FacebookConfig facebookConfig;

    @Autowired
    private ClientFactory clientFactory;

    @Test
    public void shouldReturnAConnectionWithAFeedJsonObject() throws ConnectionException {
        PageFeed repository = new PageFeed(clientFactory, facebookConfig);

// Path: src/main/java/org/ominidi/Application.java
// @SpringBootApplication
// public class Application {
//     public static void main(String[] args) throws Exception {
//         SpringApplication.run(Application.class, args);
//     }
// }
// 
// Path: src/main/java/org/ominidi/facebook/configuration/FacebookConfig.java
// @Getter
// @Setter
// @Configuration
// @ConfigurationProperties(prefix = "facebook")
// public class FacebookConfig {
//     private String graphAccessTokenUri;
//     private Map<String, String> page = new HashMap<>();
//     private Map<String, String> application = new HashMap<>();
// }
// 
// Path: src/main/java/org/ominidi/facebook/client/ClientFactory.java
// @Configuration
// @Import(FacebookConfig.class)
// public class ClientFactory {
// 
//     @Autowired
//     private FacebookConfig facebookConfig;
// 
//     public FacebookClient getClient() {
//         String appId = facebookConfig.getApplication().get("app_id");
//         String appSecret = facebookConfig.getApplication().get("app_secret");
// 
//         FacebookClient.AccessToken token = new DefaultFacebookClient(Version.VERSION_2_8).obtainAppAccessToken(appId, appSecret);
//         return new DefaultFacebookClient(token.getAccessToken(), appSecret, Version.VERSION_2_8);
//     }
// }
// 
// Path: src/main/java/org/ominidi/facebook/exception/ConnectionException.java
// public class ConnectionException extends Exception {
//     public ConnectionException(String message) {
//         super(message);
//     }
// 
//     public ConnectionException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public ConnectionException(Throwable cause) {
//         super(cause);
//     }
// }


// Path: src/test/java/org/ominidi/facebook/repository/PageFeedIntegrationTest.java
import com.restfb.*;
import com.restfb.json.JsonObject;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ominidi.Application;
import org.ominidi.facebook.configuration.FacebookConfig;
import org.ominidi.facebook.client.ClientFactory;
import org.ominidi.facebook.exception.ConnectionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import static org.junit.Assert.*;

package org.ominidi.facebook.repository;



@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@ActiveProfiles(value = "test")
public class PageFeedIntegrationTest {

    @Autowired
    private FacebookConfig facebookConfig;

    @Autowired
    private ClientFactory clientFactory;

    @Test
    public void shouldReturnAConnectionWithAFeedJsonObject() throws ConnectionException {
        PageFeed repository = new PageFeed(clientFactory, facebookConfig);

        Connection<JsonObject> connection = repository.getConnection();
