-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLUGINAPI-42 Deprecate javax.servlet usage in org.sonar.api.security …
…package
- Loading branch information
1 parent
f5e6e85
commit 8c10020
Showing
6 changed files
with
98 additions
and
11 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
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 |
---|---|---|
|
@@ -21,8 +21,7 @@ | |
|
||
import com.google.common.base.Preconditions; | ||
import org.junit.Test; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import org.sonar.api.server.http.HttpRequest; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.mockito.Mockito.mock; | ||
|
@@ -35,14 +34,14 @@ public void doGetUserDetails() { | |
@Override | ||
public UserDetails doGetUserDetails(Context context) { | ||
Preconditions.checkNotNull(context.getUsername()); | ||
Preconditions.checkNotNull(context.getRequest()); | ||
Preconditions.checkNotNull(context.getHttpRequest()); | ||
UserDetails user = new UserDetails(); | ||
user.setName(context.getUsername()); | ||
user.setEmail("[email protected]"); | ||
return user; | ||
} | ||
}; | ||
UserDetails user = provider.doGetUserDetails(new ExternalUsersProvider.Context("foo", mock(HttpServletRequest.class))); | ||
UserDetails user = provider.doGetUserDetails(new ExternalUsersProvider.Context("foo", mock(HttpRequest.class))); | ||
|
||
assertThat(user.getName()).isEqualTo("foo"); | ||
assertThat(user.getEmail()).isEqualTo("[email protected]"); | ||
|
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