package at.gv.egovernment.moa.id.auth.modules.auth.dummy.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import at.gv.egiz.eaaf.core.exceptions.EAAFAuthenticationException; import at.gv.egovernment.moa.id.auth.modules.auth.dummy.service.DummyIdentityService; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "/test_dummy_identity_auth.beans.xml" }) public class DummyIdentityServiceTest { @Autowired DummyIdentityService service; @Test public void numberOfLoadedIdentities() { assertEquals("wrong number of identities in store", 3, service.getNumberOfLoadedIdentitySets()); } @Test public void getRandomIdentity() throws EAAFAuthenticationException { Map idl = service.getIdentityRandomly(); assertNotNull("idl", idl); assertEquals("wrong number of attributes", 4, idl.size()); } @Test public void getManyRandomIdentity() throws EAAFAuthenticationException { for(int i=0; i<50; i++) { assertNotNull("idl", service.getIdentityRandomly()); } } }