@Test
public void testProxies() {

    String oldSettingsXmlPath = System.getProperty( CUSTOM_SETTINGS_PROPERTY );
    try {
        if (oldSettingsXmlPath != null) {
            System.clearProperty( CUSTOM_SETTINGS_PROPERTY );
        }
        MavenSettings.reinitSettingsFromString(EMPTY_SETTINGS);
        final MavenRequest mavenRequest = createMavenRequest(null);
        final MavenEmbedder embedder = new MavenEmbedderWithProxyMock( mavenRequest );
        final MavenExecutionRequest request = embedder.getMavenExecutionRequest();
        assertNotNull( request );
        final List<Proxy> proxies = request.getProxies();
        assertEquals( 1, proxies.size() );
        assertEquals( "MyProxy", proxies.get(0).getId() );
    } catch ( MavenEmbedderException mee ) {
        fail( mee.getMessage() );
    } finally {
        if (oldSettingsXmlPath != null) {
            System.setProperty( CUSTOM_SETTINGS_PROPERTY, oldSettingsXmlPath );
        }
        MavenSettings.reinitSettings();
    }
}