    @Test
    public void authorizationWithAllowedDomains() throws Exception {

        GooglePluginSettings googlePluginSettings = new GooglePluginSettings();
        googlePluginSettings.setAllowedDomains("foo.com, bar.com");

        assertFalse(new GoogleProvider().authorize(googlePluginSettings, new User("", null, null)));
        assertFalse(new GoogleProvider().authorize(googlePluginSettings, new User("bob@foo.com@example.com", null, null)));

        assertTrue(new GoogleProvider().authorize(googlePluginSettings, new User("bob@foo.com", null, null)));
        assertTrue(new GoogleProvider().authorize(googlePluginSettings, new User("bob@bar.com", null, null)));
    }