@Test
public void initializeWithEnvironmentVariables() throws Exception {

    // Construct a new test client and make sure it doesn't have a default project.
    KeenClient testClient = new TestKeenClientBuilder().build();
    assertNull(testClient.getDefaultProject());
    // Mock an environment with a project.
    Environment mockEnv = mock(Environment.class);
    when(mockEnv.getKeenProjectId()).thenReturn("<project ID>");
    when(mockEnv.getKeenReadKey()).thenReturn("<read key>");
    // Make sure a new test client using the mock environment has the expected default project.
    testClient = new TestKeenClientBuilder(mockEnv).build();
    KeenProject defaultProject = testClient.getDefaultProject();
    assertNotNull(defaultProject);
    assertEquals("<project ID>", defaultProject.getProjectId());
}