import client.Client;
import client.ClientException;
import client.IClient;
import config.Config;
import config.IConfig;
import org.junit.Test;
import request.IRequest;
import request.Request;
import response.IResponse;

import static junit.framework.TestCase.assertTrue;

/**
 * Created by rv186025 on 04/03/16.
 */
public class TestClient {
    @Test
    public void testClient() throws ClientException {
        // Conf
        IConfig conf = Config.getDefault();
        conf.setCredentials(System.getProperty("DMP_USERNAME"), System.getProperty("DMP_PASSWORD"));
        conf.setEndpoint(System.getProperty("DMP_ENDPOINT", conf.getEndpoint()));

        // Client
        IClient client = new Client(conf);

        // Request
        IRequest req = new Request("user/current");

        // Execute
        IResponse resp = client.get(req);

        // Validate ID
        assertTrue(resp.getAsJsonObject("user").get("id").getAsString().length() > 0);
    }
}

@@ -494,32 +494,27 @@
 s(System.get
-Property
+env
 (%22DMP_USERNA
@@ -525,32 +525,27 @@
 , System.get
-Property
+env
 (%22DMP_PASSWO
@@ -563,25 +563,26 @@
     
-conf.setE
+String e
 ndpoint
-(
+ = 
 Syst
@@ -591,16 +591,11 @@
 .get
-Property
+env
 (%22DM
@@ -609,16 +609,61 @@
 INT%22
-,
+);%0A        if (endpoint != null) %7B%0A           
  conf.
-g
+s
 etEn
@@ -673,12 +673,28 @@
 int(
-)));
+endpoint);%0A        %7D
 %0A%0A  

Improve test