use of eu.bcvsolutions.idm.core.model.entity.IdmConfiguration in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationServiceUnitTest method testGetValues.
@Test
public void testGetValues() {
IdmConfiguration configurationItem = new IdmConfiguration(null, String.format("%s,%s,%s", VALUE_ONE, VALUE_TWO, VALUE_THREE));
when(repository.findOneByName(any(String.class))).thenReturn(configurationItem);
//
List<String> results = service.getValues("key");
//
Assert.assertNotNull(results);
Assert.assertEquals(3, results.size());
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_ONE)));
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_TWO)));
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_THREE)));
}
use of eu.bcvsolutions.idm.core.model.entity.IdmConfiguration in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationServiceUnitTest method testGetValuesWithEmpty.
@Test
public void testGetValuesWithEmpty() {
IdmConfiguration configurationItem = new IdmConfiguration(null, " , , ,,, ,");
when(repository.findOneByName(any(String.class))).thenReturn(configurationItem);
//
List<String> results = service.getValues("key");
//
Assert.assertNotNull(results);
Assert.assertEquals(0, results.size());
}
use of eu.bcvsolutions.idm.core.model.entity.IdmConfiguration in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationServiceUnitTest method testGetValuesWithBlankSpaces.
@Test
public void testGetValuesWithBlankSpaces() {
IdmConfiguration configurationItem = new IdmConfiguration(null, String.format(" %s ,%s, %s,,, ,", VALUE_ONE, VALUE_TWO, VALUE_THREE));
when(repository.findOneByName(any(String.class))).thenReturn(configurationItem);
//
List<String> results = service.getValues("key");
//
Assert.assertNotNull(results);
Assert.assertEquals(3, results.size());
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_ONE)));
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_TWO)));
Assert.assertTrue(results.stream().anyMatch(e -> e.equals(VALUE_THREE)));
}
Aggregations