Commit 64147fd1 authored by akwizgran's avatar akwizgran
Browse files

Merge branch 'integration-test-fix' into 'main'

Expose webserver port in AbstractMailbox

See merge request !165
parents 8bb7f4a3 9c52187c
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import org.briarproject.mailbox.core.CoreEagerSingletons
import org.briarproject.mailbox.core.MailboxLibEagerSingletons
import org.briarproject.mailbox.core.db.TransactionManager
import org.briarproject.mailbox.core.lifecycle.LifecycleManager
import org.briarproject.mailbox.core.server.WebServerManager
import org.briarproject.mailbox.core.setup.QrCodeEncoder
import org.briarproject.mailbox.core.setup.SetupManager
import org.briarproject.mailbox.core.setup.WipeManager
@@ -59,6 +60,9 @@ abstract class AbstractMailbox(protected val customDataDir: File? = null) {
    @Inject
    internal lateinit var setupManager: SetupManager

    @Inject
    internal lateinit var webserverManager: WebServerManager

    @Inject
    internal lateinit var wipeManager: WipeManager

@@ -131,5 +135,11 @@ abstract class AbstractMailbox(protected val customDataDir: File? = null) {
        return qrCodeEncoder.getLink()
    }

    /**
     * The port, the webserver has bound to.
     * Accessing this will block the current thread until the port chosen by the webserver is known.
     */
    val port get() = webserverManager.port

    fun getSystem(): System = system
}