package sg.ncl.adapter.deterlab.dtos.entities;

import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Before;
import org.junit.Test;

import java.util.Random;

import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * @author Tran Ly Vu
 */
public class DeterLabUserEntityTest {

    private DeterLabUserEntity deterLabUserEntity;

    @Before
    public void setup(){
        deterLabUserEntity=new DeterLabUserEntity();
    }

    @Test
    public void testGetId(){
        final Long expected = new Random().nextLong();
        deterLabUserEntity.setId(expected);

        Long actual=deterLabUserEntity.getId();

        assertThat(actual).isNotNull();
        assertThat(actual).isEqualTo(expected);
    }

    @Test
    public void testGetNclUserId(){
        final String expected = RandomStringUtils.randomAlphabetic(20);
        deterLabUserEntity.setNclUserId(expected);

        String actual=deterLabUserEntity.getNclUserId();

        assertThat(actual).isNotNull();
        assertThat(actual).isEqualTo(expected);
    }

    @Test
    public void testGetDeterUserId(){
        final String expected = RandomStringUtils.randomAlphabetic(20);
        deterLabUserEntity.setDeterUserId(expected);

        String actual=deterLabUserEntity.getDeterUserId();

        assertThat(actual).isNotNull();
        assertThat(actual).isEqualTo(expected);
    }


}

@@ -397,22 +397,20 @@
 ;%0A%0A    @
-Before
+Test
 %0A    pub
@@ -422,13 +422,29 @@
 oid 
-setup
+testGetIdDedaultValue
 ()%7B%0A
@@ -496,23 +496,108 @@
 tity();%0A
+        Long actual=deterLabUserEntity.getId();%0A%0A        assertThat(actual).isNull();%0A
     %7D%0A
-%0A
     @Tes
@@ -614,25 +614,25 @@
 ic void test
-G
+S
 etId()%7B%0A    
@@ -681,16 +681,70 @@
 tLong();
+%0A%0A        deterLabUserEntity=new DeterLabUserEntity();
 %0A       
@@ -772,33 +772,32 @@
 etId(expected);%0A
-%0A
         Long act
@@ -820,32 +820,40 @@
 Entity.getId();%0A
+        
 %0A        assertT
@@ -858,39 +858,223 @@
 tThat(actual).is
-NotNull
+EqualTo(expected);%0A    %7D%0A%0A    @Test%0A    public void testGetNclUserIdDedaultvalue()%7B%0A        deterLabUserEntity=new DeterLabUserEntity();%0A%0A        String actual=deterLabUserEntity.getNclUserId
 ();%0A        asse
@@ -1090,32 +1090,21 @@
 tual).is
-EqualTo(expected
+Null(
 );%0A    %7D
@@ -1214,32 +1214,86 @@
 mAlphabetic(20);
+%0A%0A        deterLabUserEntity=new DeterLabUserEntity();
 %0A        deterLa
@@ -1320,33 +1320,32 @@
 erId(expected);%0A
-%0A
         String a
@@ -1390,48 +1390,8 @@
 );%0A%0A
-        assertThat(actual).isNotNull();%0A
     
@@ -1433,32 +1433,249 @@
 pected);%0A    %7D%0A%0A
+    @Test%0A    public void testGetDeterUserIdDedaultvalue()%7B%0A        deterLabUserEntity=new DeterLabUserEntity();%0A        String actual=deterLabUserEntity.getDeterUserId();%0A%0A        assertThat(actual).isNull();%0A    %7D%0A%0A
     @Test%0A    pu
@@ -1777,16 +1777,70 @@
 tic(20);
+%0A%0A        deterLabUserEntity=new DeterLabUserEntity();
 %0A       
@@ -1885,17 +1885,16 @@
 ected);%0A
-%0A
         
@@ -1949,48 +1949,8 @@
 );%0A%0A
-        assertThat(actual).isNotNull();%0A
     

update test for default value