-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHE-1298; remove war name from url schema (#1572)
- Loading branch information
1 parent
58654df
commit 64ad23e
Showing
12 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...embly/webapps/ROOT/WEB-INF/rewrite.config → ...ar/src/main/webapp/WEB-INF/rewrite.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
|
||
RewriteRule ^/api/(.*)$ /wsmaster/api/$1 [L] | ||
RewriteRule ^/$ /dashboard [R] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,22 @@ | |
*******************************************************************************/ | ||
package org.eclipse.che.api.user.server; | ||
|
||
import org.eclipse.che.api.core.BadRequestException; | ||
import org.eclipse.che.api.core.ConflictException; | ||
import org.eclipse.che.api.user.server.dao.PreferenceDao; | ||
import org.eclipse.che.api.user.server.dao.Profile; | ||
import org.eclipse.che.api.user.server.dao.User; | ||
import org.eclipse.che.api.user.server.dao.UserDao; | ||
import org.eclipse.che.api.user.server.dao.UserProfileDao; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.testng.MockitoTestNGListener; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Listeners; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.mockito.Matchers.any; | ||
import static org.mockito.Matchers.anyMapOf; | ||
import static org.mockito.Matchers.anyString; | ||
import static org.mockito.Matchers.eq; | ||
import static org.mockito.Mockito.never; | ||
import static org.mockito.Mockito.verify; | ||
|
||
/** | ||
|
@@ -45,12 +44,17 @@ public class UserManagerTest { | |
@Mock | ||
PreferenceDao preferenceDao; | ||
|
||
@InjectMocks | ||
UserManager manager; | ||
|
||
@BeforeMethod | ||
public void setUp() { | ||
manager = new UserManager(userDao, profileDao, preferenceDao, new String[0]); | ||
} | ||
|
||
@Test | ||
public void shouldCreateProfileAndPreferencesOnUserCreation() throws Exception { | ||
final User user = new User().withEmail("[email protected]").withName("testName"); | ||
|
||
manager.create(user, false); | ||
|
||
verify(profileDao).create(any(Profile.class)); | ||
|
@@ -60,8 +64,16 @@ public void shouldCreateProfileAndPreferencesOnUserCreation() throws Exception { | |
@Test | ||
public void shouldGeneratedPasswordWhenCreatingUserAndItIsMissing() throws Exception { | ||
final User user = new User().withEmail("[email protected]").withName("testName"); | ||
|
||
manager.create(user, false); | ||
|
||
verify(userDao).create(eq(user.withPassword("<none>"))); | ||
} | ||
|
||
@Test(expectedExceptions = ConflictException.class) | ||
public void shouldThrowConflictExceptionOnCreationIfUserNameIsReserved() throws Exception { | ||
final User user = new User().withEmail("[email protected]").withName("reserved"); | ||
|
||
new UserManager(userDao, profileDao, preferenceDao, new String[] {"reserved"}).create(user, false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters