-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f480f4
commit dbb7adc
Showing
10 changed files
with
102 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package net.teumteum.core.context; | ||
|
||
public interface LoginContext { | ||
|
||
Long getUserId(); | ||
|
||
void setUserId(Long userId); | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/net/teumteum/core/context/LoginContextImpl.java
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.teumteum.core.context; | ||
|
||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.context.annotation.ScopedProxyMode; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.context.annotation.RequestScope; | ||
|
||
@Component | ||
@Profile("prod") | ||
@RequestScope(proxyMode = ScopedProxyMode.INTERFACES) | ||
public class LoginContextImpl implements LoginContext { | ||
|
||
private Long userId; | ||
|
||
@Override | ||
public Long getUserId() { | ||
return userId; | ||
} | ||
|
||
@Override | ||
public void setUserId(Long userId) { | ||
this.userId = userId; | ||
} | ||
|
||
} |
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
34 changes: 0 additions & 34 deletions
34
src/test/java/net/teumteum/integration/SecurityService.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/test/java/net/teumteum/integration/TestLoginContext.java
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.teumteum.integration; | ||
|
||
import net.teumteum.core.context.LoginContext; | ||
import org.springframework.boot.test.context.TestComponent; | ||
|
||
@TestComponent | ||
public class TestLoginContext implements LoginContext { | ||
|
||
private Long userId; | ||
|
||
@Override | ||
public Long getUserId() { | ||
return this.userId; | ||
} | ||
|
||
@Override | ||
public void setUserId(Long userId) { | ||
this.userId = userId; | ||
} | ||
} |
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