Instances of this class are immutable and thread safe.
+ */
+public final class Tenant {
+
+ @Key("tenantId")
+ private String tenantId;
+
+ @Key("displayName")
+ private String displayName;
+
+ @Key("allowPasswordSignup")
+ private String passwordSignInAllowed;
+
+ @Key("enableEmailLinkSignin")
+ private String emailLinkSignInEnabled;
+
+ /**
+ * Class used to hold the information needs to make a tenant create request.
+ */
+ @AutoValue
+ public abstract static class CreateRequest {
+
+ /**
+ * Returns the display name of this tenant.
+ *
+ * @return a non-empty display name string.
+ */
+ public abstract String getDisplayName();
+
+ /**
+ * Returns whether to allow email/password user authentication.
+ *
+ * @return true if a user can be authenticated using an email and password, and false otherwise.
+ */
+ public abstract boolean isPasswordSignInAllowed();
+
+ /**
+ * Returns whether to enable email link user authentication.
+ *
+ * @return true if a user can be authenticated using an email link, and false otherwise.
+ */
+ public abstract boolean isEmailLinkSignInEnabled();
+
+ /**
+ * Returns a builder for a tenant create request.
+ */
+ public static Builder newBuilder() {
+ return new AutoValue_Tenant_CreateRequest.Builder();
+ }
+
+ /**
+ * Builder class used to construct a create request.
+ */
+ @AutoValue.Builder
+ abstract static class Builder {
+ public abstract Builder setDisplayName(String displayName);
+
+ public abstract Builder setPasswordSignInAllowed(boolean allowPasswordSignIn);
+
+ public abstract Builder setEmailLinkSignInEnabled(boolean enableEmailLinkSignIn);
+
+ public abstract CreateRequest build();
+ }
+ }
+
+ /**
+ * Class used to hold the information needs to make a tenant update request.
+ */
+ @AutoValue
+ public abstract static class UpdateRequest {
+
+ /**
+ * Returns the display name of this tenant.
+ *
+ * @return a non-empty display name string.
+ */
+ public abstract String getDisplayName();
+
+ /**
+ * Returns whether to allow email/password user authentication.
+ *
+ * @return true if a user can be authenticated using an email and password, and false otherwise.
+ */
+ public abstract boolean isPasswordSignInAllowed();
+
+ /**
+ * Returns whether to enable email link user authentication.
+ *
+ * @return true if a user can be authenticated using an email link, and false otherwise.
+ */
+ public abstract boolean isEmailLinkSignInEnabled();
+
+ /**
+ * Returns a builder for a tenant update request.
+ */
+ public static Builder newBuilder() {
+ return new AutoValue_Tenant_UpdateRequest.Builder();
+ }
+
+ /**
+ * Builder class used to construct a update request.
+ */
+ @AutoValue.Builder
+ abstract static class Builder {
+ public abstract Builder setDisplayName(String displayName);
+
+ public abstract Builder setPasswordSignInAllowed(boolean allowPasswordSignIn);
+
+ public abstract Builder setEmailLinkSignInEnabled(boolean enableEmailLinkSignIn);
+
+ public abstract UpdateRequest build();
+ }
+ }
+}
diff --git a/src/test/java/com/google/firebase/database/FirebaseDatabaseTest.java b/src/test/java/com/google/firebase/database/FirebaseDatabaseTest.java
index d8395035e..ba7816173 100644
--- a/src/test/java/com/google/firebase/database/FirebaseDatabaseTest.java
+++ b/src/test/java/com/google/firebase/database/FirebaseDatabaseTest.java
@@ -23,6 +23,7 @@
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
+import com.google.auth.oauth2.GoogleCredentials;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -33,11 +34,12 @@
import com.google.firebase.database.util.EmulatorHelper;
import com.google.firebase.testing.ServiceAccount;
import com.google.firebase.testing.TestUtils;
+import java.io.IOException;
import java.util.List;
import org.junit.Test;
public class FirebaseDatabaseTest {
-
+
private static final FirebaseOptions firebaseOptions =
new FirebaseOptions.Builder()
.setCredentials(TestUtils.getCertCredential(ServiceAccount.EDITOR.asStream()))
@@ -198,7 +200,7 @@ public void testInitAfterAppDelete() {
}
@Test
- public void testDbUrlIsEmulatorUrlWhenSettingOptionsManually() {
+ public void testDbUrlIsEmulatorUrlWhenSettingOptionsManually() throws IOException {
List