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 getterAndSetterTest() {
        final Long firstRandom = new Random().nextLong();
        deterLabUserEntity.setId(firstRandom);

        final String secondRandom = RandomStringUtils.randomAlphabetic(20);
        deterLabUserEntity.setNclUserId(secondRandom);

        final String thirdRandom = RandomStringUtils.randomAlphabetic(20);
        deterLabUserEntity.setDeterUserId(thirdRandom);

        Long actual1=deterLabUserEntity.getId();
        String actual2=deterLabUserEntity.getNclUserId();
        String actual3=deterLabUserEntity.getDeterUserId();

        assertThat(actual1).isNotNull();
        assertThat(actual2).isNotNull();
        assertThat(actual3).isNotNull();

        assertEquals(firstRandom,actual1);
        assertEquals(secondRandom,actual2);
        assertEquals(thirdRandom,actual3);
    }
}

@@ -519,30 +519,19 @@
 oid 
-getterAndSetterTest
+testGetId
 ()
- 
 %7B%0A  
@@ -547,27 +547,24 @@
 al Long 
-firstRandom
+expected
  = new R
@@ -616,27 +616,24 @@
 y.setId(
-firstRandom
+expected
 );%0A%0A    
@@ -640,131 +640,180 @@
     
-final String secondRandom = RandomStringUtils.randomAlphabetic(20
+Long actual=deterLabUserEntity.getId();%0A%0A        assertThat(actual).isNotNull();%0A        assertEquals(expected,actual
 );%0A    
+%7D%0A%0A
     
-deterLabUserEntity.setNclUserId(secondRandom);%0A
+@Test%0A    public void testGetNclUserId()%7B
 %0A   
@@ -830,27 +830,24 @@
  String 
-thirdRandom
+expected
  = Rando
@@ -915,31 +915,26 @@
 .set
-Deter
+Ncl
 UserId(
-thirdRandom
+expected
 );%0A%0A
@@ -933,34 +933,36 @@
 cted);%0A%0A        
-Lo
+Stri
 ng actual1=deter
@@ -954,17 +954,16 @@
 g actual
-1
 =deterLa
@@ -977,30 +977,38 @@
 tity.get
+NclUser
 Id();%0A
+%0A
         
 String a
@@ -1003,56 +1003,132 @@
     
-String actual2=deterLabUserEntity.getNcl
+assertThat(actual).isNotNull();%0A        assertEquals(expected,actual);%0A    %7D%0A%0A    @Test%0A    public void testGetDeter
 UserId()
 ;%0A  
@@ -1123,17 +1123,17 @@
 UserId()
-;
+%7B
 %0A       
@@ -1137,23 +1137,80 @@
     
+final 
 String 
-actual3=
+expected = RandomStringUtils.randomAlphabetic(20);%0A        
 dete
@@ -1224,17 +1224,17 @@
 rEntity.
-g
+s
 etDeterU
@@ -1235,24 +1235,32 @@
 DeterUserId(
+expected
 );%0A%0A        
@@ -1263,82 +1263,60 @@
     
-assertThat(actual1).isNotNull();%0A        assertThat(actual2).isNotNull
+String actual=deterLabUserEntity.getDeterUserId
 ();%0A
+%0A
     
@@ -1336,17 +1336,16 @@
 t(actual
-3
 ).isNotN
@@ -1347,25 +1347,24 @@
 sNotNull();%0A
-%0A
         asse
@@ -1376,114 +1376,23 @@
 als(
-firstRandom,actual1);%0A        assertEquals(secondRandom,actual2);%0A        assertEquals(thirdRandom
+expected
 ,actual
-3
 );%0A 
@@ -1396,10 +1396,12 @@
 ;%0A    %7D%0A
+%0A%0A
 %7D%0A

Split assert statements