package com.accenture.multibank.generator;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.HashSet;
import java.util.Set;

@RunWith(SpringJUnit4ClassRunner.class)
public class AccountNumberGeneratorTest {

	@Autowired
	private AccountNumberGeneratorDao generator;

	@Test
	public void createANumber() {
		int accountNumber = generator.save(new Account_Numbers()).getAccount_number();
		System.out.println(accountNumber);

	}

	@Test
	public void createMultipleNumbers() {
		Set<Integer> intSet = new HashSet<>();
		for (int i = 0; i < 1000; i++) {
			intSet.add(generator.save(new Account_Numbers()).getAccount_number());

		}
		Assert.assertEquals(1000, intSet.size());
	}

}

@@ -35,24 +35,81 @@
 nerator;%0D%0A%0D%0A
+import com.accenture.multibank.entities.AccountNumbers;%0D%0A
 import org.j
@@ -323,60 +323,8 @@
 %0D%0A%0D%0A
-import java.util.HashSet;%0D%0Aimport java.util.Set;%0D%0A%0D%0A
 @Run
@@ -453,25 +453,38 @@
 atorDao 
-g
+accountNumberG
 enerator
 ;%0D%0A%0D%0A%09@T
@@ -471,24 +471,27 @@
 berGenerator
+Dao
 ;%0D%0A%0D%0A%09@Test%0D
@@ -525,19 +525,30 @@
 () %7B%0D%0A%09%09
-int
+AccountNumbers
  account
@@ -557,48 +557,132 @@
 mber
+s
  = 
-generator.save(new A
+new AccountNumbers();%0D%0A%09%09accountNumbers = accountNumberGeneratorDao.save(accountNumbers);%0D%0A%09%09int actual = a
 ccount
-_
 Numbers
-())
 .get
@@ -701,152 +701,204 @@
 er()
-;%0D%0A%09%09System.out.println(accountNumber);%0D%0A%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void createMultipleNumbers() %7B%0D%0A%09%09Set%3CInteger%3E intSet = new HashSet%3C%3E()
+,%0D%0A%09%09%09%09expected = 1;%0D%0A%09%09Assert.assertEquals(expected, actual);%0D%0A%09%7D%0D%0A%0D%0A%09@Test%0D%0A%09public void createMultipleNumbers() %7B%0D%0A%09%09AccountNumbers actual = new AccountNumbers();%0D%0A%09%09int expected = 1000
 ;%0D%0A%09%09for
  (in
@@ -893,17 +893,16 @@
 ;%0D%0A%09%09for
- 
 (int i =
@@ -913,25 +913,29 @@
 i %3C 
-1000
+expected
 ; 
-i
 ++
+i
 ) %7B%0D%0A%09%09%09
 intS
@@ -934,28 +934,39 @@
 %0A%09%09%09
-intSet.add(g
+actual = accountNumberG
 enerator
 .sav
@@ -961,16 +961,19 @@
 enerator
+Dao
 .save(ne
@@ -981,17 +981,16 @@
  Account
-_
 Numbers(
@@ -995,32 +995,9 @@
 s())
-.getAccount_number());%0D%0A
+;
 %0D%0A%09%09
@@ -1025,25 +1025,42 @@
 als(
-1000, intSet.size
+expected, actual.getAccount_number
 ());
@@ -1069,9 +1069,5 @@
 %09%7D%0D%0A
-%0D%0A%7D%0D%0A
+%7D

change test