#1127 Create DataSource#getEmail

This commit is contained in:
ljacqu
2017-04-18 21:07:31 +02:00
parent cbec5427f2
commit b99cc3bada
13 changed files with 165 additions and 46 deletions
@@ -18,6 +18,7 @@ import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeThat;
@@ -383,4 +384,20 @@ public abstract class AbstractDataSourceIntegrationTest {
// then
assertThat(dataSource.getAllAuths(), empty());
}
@Test
public void shouldFetchEmail() {
// given
String user1 = "user";
String user2 = "Bogus";
DataSource dataSource = getDataSource();
// when
DataSourceResult<String> email1 = dataSource.getEmail(user1);
DataSourceResult<String> email2 = dataSource.getEmail(user2);
// then
assertThat(email1.getValue(), equalTo("user@example.org"));
assertThat(email2, is(DataSourceResult.unknownPlayer()));
}
}