-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a358af9
commit 494d711
Showing
2 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import net.bis5.mattermost.model.Team; | ||
import net.bis5.mattermost.model.TeamType; | ||
import net.bis5.mattermost.model.User; | ||
import net.bis5.mattermost.model.config.consts.ConnectionSecurity; | ||
import org.apache.commons.lang3.RandomStringUtils; | ||
|
||
/** | ||
|
@@ -71,17 +72,25 @@ public TestHelper setup() { | |
config.getServiceSettings().setEnableCommands(true); | ||
config.getServiceSettings().setEnableEmailInvitations(true); | ||
config.getServiceSettings().setEnableUserAccessTokens(true); | ||
// TODO un-comment these lines when Dockerfile setup. | ||
// config.getEmailSettings().setSendEmailNotifications(true); | ||
// config.getEmailSettings().setSmtpServer("localhost"); | ||
// config.getEmailSettings().setSmtpPort("9000"); | ||
// config.getEmailSettings().setFeedbackEmail("[email protected]"); | ||
config.getTeamSettings().setEnableOpenServer(true); | ||
config = checkNoError(client.updateConfig(config)).readEntity(); | ||
client.logout(); | ||
return this; | ||
} | ||
|
||
public TestHelper useSmtp(String inbucketHost, String inbucketPort) { | ||
logout().loginSystemAdmin(); | ||
Config config = client.getConfig().readEntity(); | ||
config.getEmailSettings().setSendEmailNotifications(true); | ||
config.getEmailSettings().setSmtpServer(inbucketHost); | ||
config.getEmailSettings().setSmtpPort(inbucketPort); | ||
config.getEmailSettings().setFeedbackEmail("[email protected]"); | ||
config.getEmailSettings().setConnectionSecurity(ConnectionSecurity.NONE); | ||
config = checkNoError(client.updateConfig(config)).readEntity(); | ||
logout().loginBasic(); | ||
return this; | ||
} | ||
|
||
public TestHelper initBasic() { | ||
teamAdminUser = createUser(); | ||
loginTeamAdmin(); | ||
|