// Path: src/main/java/com/deswaef/twitch/util/AuthorizationURLBuilder.java
// public static AuthorizationURLBuilder buildAuthorizationUrl() {
//     return new AuthorizationURLBuilder();
// }
// 
// Path: src/test/java/com/deswaef/twitch/util/ThrowableAssertion.java
// public static ThrowableAssertion assertThrown(ExceptionThrower exceptionThrower) {
//     try {
//         exceptionThrower.throwException();
//     } catch (Throwable caught) {
//         return new ThrowableAssertion(caught);
//     }
//     throw new ExceptionNotThrownAssertionError();
// }


import org.junit.Test;
import static com.deswaef.twitch.util.AuthorizationURLBuilder.buildAuthorizationUrl;
import static com.deswaef.twitch.util.ThrowableAssertion.assertThrown;
import static org.fest.assertions.Assertions.assertThat;
                        .toString()
        ).isInstanceOf(IllegalStateException.class);
    }

    @Test
    public void redirectURIShouldBeSet() {
        assertThrown(
                () -> buildAuthorizationUrl()
                        .baseUrl(BASE_URL)
                        .clientId(CLIENT_ID)
                        .withScope(SCOPE_1)
                        .withScope(SCOPE_2)
                        .toString()
        ).isInstanceOf(IllegalStateException.class);
    }


    @Test
    public void scopeShouldBeSet() {
        assertThrown(
                () -> buildAuthorizationUrl()
                        .baseUrl(BASE_URL)
                        .clientId(CLIENT_ID)
                        .redirectURI(REDIRECT_URI)
                        .toString()
        ).isInstanceOf(IllegalStateException.class)
                .hasMessage("Cannot build authentication url, please set the scopes first");
    }

    @Test
// Path: src/main/java/com/deswaef/twitch/util/AuthorizationURLBuilder.java
// public static AuthorizationURLBuilder buildAuthorizationUrl() {
//     return new AuthorizationURLBuilder();
// }
// 
// Path: src/test/java/com/deswaef/twitch/util/ThrowableAssertion.java
// public static ThrowableAssertion assertThrown(ExceptionThrower exceptionThrower) {
//     try {
//         exceptionThrower.throwException();
//     } catch (Throwable caught) {
//         return new ThrowableAssertion(caught);
//     }
//     throw new ExceptionNotThrownAssertionError();
// }


// Path: src/test/java/com/deswaef/twitch/util/AuthorizationURLBuilderTest.java
import org.junit.Test;
import static com.deswaef.twitch.util.AuthorizationURLBuilder.buildAuthorizationUrl;
import static com.deswaef.twitch.util.ThrowableAssertion.assertThrown;
import static org.fest.assertions.Assertions.assertThat;

                        .toString()
        ).isInstanceOf(IllegalStateException.class);
    }

    @Test
    public void redirectURIShouldBeSet() {
        assertThrown(
                () -> buildAuthorizationUrl()
                        .baseUrl(BASE_URL)
                        .clientId(CLIENT_ID)
                        .withScope(SCOPE_1)
                        .withScope(SCOPE_2)
                        .toString()
        ).isInstanceOf(IllegalStateException.class);
    }


    @Test
    public void scopeShouldBeSet() {
        assertThrown(
                () -> buildAuthorizationUrl()
                        .baseUrl(BASE_URL)
                        .clientId(CLIENT_ID)
                        .redirectURI(REDIRECT_URI)
                        .toString()
        ).isInstanceOf(IllegalStateException.class)
                .hasMessage("Cannot build authentication url, please set the scopes first");
    }

    @Test
    public void generatesCorrectURIWith1Scope() {