Skip to content
Snippets Groups Projects
Commit 498667c3 authored by Martin Staehr's avatar Martin Staehr
Browse files

#63 add new fields to rocket chat config

parent bfe8020a
No related branches found
No related tags found
No related merge requests found
package unipotsdam.gf.config;
import unipotsdam.gf.core.management.user.User;
public class GFRocketChatConfig {
public static final String ROCKET_CHAT_LINK = "https://rocket.farm.uni-potsdam.de/";
public static final String ROCKET_CHAT_API_LINK = "http://rocketchat.westeurope.cloudapp.azure.com/api/v1/";
public static final String ADMIN_USERNAME = "";
public static final String ADMIN_PASSWORD = "";
public static final String ADMIN_TOKEN = "";
public static final User TEST_USER = new User("username", "password", "email",
"rocketChatUserName", false);
}
......@@ -28,6 +28,11 @@ public class User {
"", "", isStudent);
}
public User(String name, String password, String email, String rocketChatUsername, Boolean isStudent) {
this(name, password, email, "", rocketChatUsername, "",
"", "", isStudent);
}
public User(String name, String password, String email, String token, String rocketChatUsername,
String rocketChatAuthToken, String rocketChatPersonalAccessToken, String rocketChatUserId,
Boolean isStudent) {
......
......@@ -103,7 +103,6 @@ public class CommunicationDummyService implements ICommunication {
.post(GFRocketChatConfig.ROCKET_CHAT_API_LINK + "login")
.body(rocketChatAuth)
.asObject(RocketChatResponse.class);
// TODO: add Error class which holds Errors and posts them
int status = response.getStatus();
if (status == Response.Status.UNAUTHORIZED.getStatusCode() || status == Response.Status.BAD_REQUEST.getStatusCode()) {
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment