// Path: BiliLiveLib/src/test/java/charlie/bililivelib/TestSessionHelper.java
// public class TestSessionHelper {
//     public static Session initSession() throws IOException, BiliLiveException {
//         BasicCookieStore store = new BasicCookieStore();
//         Session session = new Session(HttpClientBuilder.create()
//                 .setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36")
//                 .setConnectionManager(Globals.get().getConnectionPool())
//                 .setSSLContext(Globals.get().getBilibiliSSLContext())
//                 .setDefaultCookieStore(store).build(), store);
//         Path cookieFile = Paths.get("cookies.bin");
//         if (Files.exists(cookieFile)) {
//             loadSessionFromFile(session);
//         } else {
//             login(session);
//             Files.createFile(cookieFile);
//         }
// 
//         ObjectOutputStream stream = new ObjectOutputStream(Files.newOutputStream(cookieFile, StandardOpenOption.TRUNCATE_EXISTING));
//         stream.writeObject(store);
//         stream.close();
//         return session;
//     }
// 
//     private static void login(Session session) throws BiliLiveException {
//         String email = testInput("E-Mail:");
//         String password = testInput("Password:");
// 
//         SessionLoginHelper helper = new SessionLoginHelper(email, password,
//                 SessionLoginHelper.DEFAULT_LOGIN_TIMEOUT_MILLIS,
//                 true, BiliLiveLib.DEFAULT_USER_AGENT);
//         JOptionPane.showMessageDialog(null, "Captcha", "Captcha",
//                 JOptionPane.PLAIN_MESSAGE, new ImageIcon(helper.getCaptcha()));
// 
//         String captcha = testInput("Captcha:");
//         helper.loginWithCaptcha(captcha);
// 
//         System.out.println(helper.getStatus());
//         assertTrue(helper.getStatus() == SessionLoginHelper.LoginStatus.SUCCESS);
// 
//         helper.fillSession(session);
//     }
// 
//     private static void loadSessionFromFile(Session session) throws IOException {
//         String xml = new String(Files.readAllBytes(Paths.get("cookies.bin")));
//         session.fromBase64(xml);
//     }
// 
//     static String testInput(String message) {
//         return JOptionPane.showInputDialog(null, message, "Test",
//                 JOptionPane.PLAIN_MESSAGE);
//     }
// 
//     public static void main(String[] args) throws IOException, BiliLiveException {
//         initSession();
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/exceptions/BiliLiveException.java
// public class BiliLiveException extends Exception {
//     public BiliLiveException() {
//         super();
//     }
// 
//     public BiliLiveException(String message) {
//         super(message);
//     }
// 
//     public BiliLiveException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import charlie.bililivelib.TestSessionHelper;
import charlie.bililivelib.exceptions.BiliLiveException;
import lombok.Getter;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import java.io.IOException;
package charlie.bililivelib.capsuletoy;



@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class CapsuleToyProtocolTest {
    private static CapsuleToyProtocol protocol;

    @BeforeClass
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/TestSessionHelper.java
// public class TestSessionHelper {
//     public static Session initSession() throws IOException, BiliLiveException {
//         BasicCookieStore store = new BasicCookieStore();
//         Session session = new Session(HttpClientBuilder.create()
//                 .setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36")
//                 .setConnectionManager(Globals.get().getConnectionPool())
//                 .setSSLContext(Globals.get().getBilibiliSSLContext())
//                 .setDefaultCookieStore(store).build(), store);
//         Path cookieFile = Paths.get("cookies.bin");
//         if (Files.exists(cookieFile)) {
//             loadSessionFromFile(session);
//         } else {
//             login(session);
//             Files.createFile(cookieFile);
//         }
// 
//         ObjectOutputStream stream = new ObjectOutputStream(Files.newOutputStream(cookieFile, StandardOpenOption.TRUNCATE_EXISTING));
//         stream.writeObject(store);
//         stream.close();
//         return session;
//     }
// 
//     private static void login(Session session) throws BiliLiveException {
//         String email = testInput("E-Mail:");
//         String password = testInput("Password:");
// 
//         SessionLoginHelper helper = new SessionLoginHelper(email, password,
//                 SessionLoginHelper.DEFAULT_LOGIN_TIMEOUT_MILLIS,
//                 true, BiliLiveLib.DEFAULT_USER_AGENT);
//         JOptionPane.showMessageDialog(null, "Captcha", "Captcha",
//                 JOptionPane.PLAIN_MESSAGE, new ImageIcon(helper.getCaptcha()));
// 
//         String captcha = testInput("Captcha:");
//         helper.loginWithCaptcha(captcha);
// 
//         System.out.println(helper.getStatus());
//         assertTrue(helper.getStatus() == SessionLoginHelper.LoginStatus.SUCCESS);
// 
//         helper.fillSession(session);
//     }
// 
//     private static void loadSessionFromFile(Session session) throws IOException {
//         String xml = new String(Files.readAllBytes(Paths.get("cookies.bin")));
//         session.fromBase64(xml);
//     }
// 
//     static String testInput(String message) {
//         return JOptionPane.showInputDialog(null, message, "Test",
//                 JOptionPane.PLAIN_MESSAGE);
//     }
// 
//     public static void main(String[] args) throws IOException, BiliLiveException {
//         initSession();
//     }
// }
// 
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/exceptions/BiliLiveException.java
// public class BiliLiveException extends Exception {
//     public BiliLiveException() {
//         super();
//     }
// 
//     public BiliLiveException(String message) {
//         super(message);
//     }
// 
//     public BiliLiveException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: BiliLiveLib/src/test/java/charlie/bililivelib/capsuletoy/CapsuleToyProtocolTest.java
import charlie.bililivelib.TestSessionHelper;
import charlie.bililivelib.exceptions.BiliLiveException;
import lombok.Getter;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import java.io.IOException;

package charlie.bililivelib.capsuletoy;



@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class CapsuleToyProtocolTest {
    private static CapsuleToyProtocol protocol;

    @BeforeClass
    public static void init() throws IOException, BiliLiveException {