import kotlin.Unit;
import org.junit.Assert;
import org.junit.Test;
import slatekit.common.Random;
import slatekit.common.Result;
import slatekit.common.Success;
import slatekit.common.envs.Env;
import slatekit.common.envs.EnvMode;
import slatekit.common.envs.Envs;
import slatekit.common.info.Host;
import slatekit.common.results.ResultCode;

import java.util.ArrayList;
import java.util.List;


public class JavaInteropTests {

    @Test
    public void can_call_kotlin() {

        Host host = new Host("mac1", "127.0.0.1", "", "osx", "10", "");
        host.copy(host.name, host.ip, host.origin, host.arch, host.version, host.ext1);

        Assert.assertTrue(ResultCode.BAD_REQUEST == 400);
    }


    @Test
    public void can_use_result() {

        Result<Integer, Exception> resS1 = new Success<Integer>(3, ResultCode.SUCCESS, "");
        //Result<Integer, Exception> resS2 = success2(3, ResultCode.SUCCESS, "");
    }


    @Test
    public void can_test_env(){
        List<Env> all = new ArrayList<Env>();
        all.add( new Env("loc", EnvMode.parse("Dev"), "","Dev environment (local)"));
        all.add( new Env("dv1", EnvMode.parse("Dev"), "","Dev 1 environment (shared)"));
        all.add( new Env("dv2", EnvMode.parse("Dev"), "","Dev 2 environment (shared)"));
        all.add( new Env("qa1", EnvMode.parse("Qat"), "","QA environment  (current release)"));
        all.add( new Env("qa2", EnvMode.parse("Qat"), "","QA environment  (last release)"));
        all.add( new Env("stg", EnvMode.parse("Uat"), "","STG environment (demo)"));
        all.add( new Env("pro", EnvMode.parse("Pro"), "","LIVE environment"));

        Envs envs = new Envs(all).select("dv1");

        System.out.println("ALL");
        System.out.println(envs.isDev());
        System.out.println(envs.getName());
        System.out.println(envs.getEnv());
        System.out.println(envs.getKey());

        System.out.println("CURRENT");
        System.out.println(envs.getCurrent().name);
        System.out.println(envs.getCurrent().mode.getName());
        System.out.println(envs.getCurrent().getKey());
        System.out.println(envs.getCurrent().region);
        System.out.println(envs.getCurrent().desc);
    }
}

@@ -96,71 +96,8 @@
 om;%0A
-import slatekit.common.Result;%0Aimport slatekit.common.Success;%0A
 impo
@@ -125,16 +125,16 @@
 vs.Env;%0A
+
 import s
@@ -233,51 +233,8 @@
 ost;
-%0Aimport slatekit.common.results.ResultCode;
 %0A%0Aim
@@ -321,507 +321,12 @@
  %7B%0A%0A
+
     
-@Test%0A    public void can_call_kotlin() %7B%0A%0A        Host host = new Host(%22mac1%22, %22127.0.0.1%22, %22%22, %22osx%22, %2210%22, %22%22);%0A        host.copy(host.name, host.ip, host.origin, host.arch, host.version, host.ext1);%0A%0A        Assert.assertTrue(ResultCode.BAD_REQUEST == 400);%0A    %7D%0A%0A%0A    @Test%0A    public void can_use_result() %7B%0A%0A        Result%3CInteger, Exception%3E resS1 = new Success%3CInteger%3E(3, ResultCode.SUCCESS, %22%22);%0A        //Result%3CInteger, Exception%3E resS2 = success2(3, ResultCode.SUCCESS, %22%22);%0A    %7D
 %0A%0A%0A 

FIX : Result usage