-
Notifications
You must be signed in to change notification settings - Fork 3
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
88da5de
commit 1d5b783
Showing
42 changed files
with
124 additions
and
164 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
2 changes: 0 additions & 2 deletions
2
.idea/sonarlint/issuestore/4/4/442292b8a7efeabbe4cc176709b833b1792140ec
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
4 changes: 0 additions & 4 deletions
4
.idea/sonarlint/issuestore/9/9/99ff850f1b0eb7d304829d82185c5e52f6b6ee84
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/1/f/1f1763f358c257ea3515417352b82b0165647ad1
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/3/9/39cad08c773d7ff3afa8cab80e1be505f01dcd62
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/4/2/42a0fcc2a3cd24d3b748eb564abf71c4902524fc
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/4/4/442292b8a7efeabbe4cc176709b833b1792140ec
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/5/d/5d837c4ed85ecaaf932c506e80ff5d7b9f3d590d
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/7/e/7e85a541f9d0eed2e9f7a135b9ddde3c8491c114
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/9/9/99ff850f1b0eb7d304829d82185c5e52f6b6ee84
Empty file.
Empty file removed
0
.idea/sonarlint/securityhotspotstore/c/7/c709f6995f23dae0da365bff70068f8288fa89e0
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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,30 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
url: jdbc:mysql://133.186.223.228:3306/t3team?useSSL=false&serverTimezone=Asia/Seoul&characterEncoding=UTF-8 | ||
username: t3team | ||
password: uPJQz6QaL6@6h]BG | ||
security: | ||
key: sakdjA24HSdflasbdglag2yhsdrg342TASGASd58aw4t3AWEIGzsoigbaWEIGHP3tug0ajw4s23a8th24tgaw2854yq3p48ghaa294 | ||
redis: | ||
host: 133.186.223.228 | ||
password: "*N2vya7H@muDTwdNMR!" | ||
port: 6379 | ||
database: 20 | ||
|
||
jpa: | ||
open-in-view: true | ||
hibernate: | ||
ddl-auto: none | ||
naming: | ||
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl | ||
use-new-id-generator-mappings: false | ||
show-sql: true | ||
properties: | ||
hibernate.format_sql: true | ||
dialect: org.hibernate.dialect.MySQL8InnoDBDialect | ||
|
||
|
||
logging: | ||
level: | ||
org.hibernate.SQL: debug |
61 changes: 61 additions & 0 deletions
61
src/test/java/com/t3t/authenticationapi/account/service/DefaultUserDetailsServiceTest.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,61 @@ | ||
package com.t3t.authenticationapi.account.service; | ||
|
||
/*import com.t3t.authenticationapi.account.auth.CustomUserDetails; | ||
import com.t3t.authenticationapi.account.dto.UserEntityDto; | ||
import com.t3t.authenticationapi.account.repository.AccountRepository; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;*/ | ||
|
||
/* | ||
@ExtendWith(MockitoExtension.class) | ||
class DefaultUserDetailsServiceTest { | ||
@Mock | ||
private BCryptPasswordEncoder bCryptPasswordEncoder; | ||
@Mock | ||
private AccountRepository accountRepository; | ||
@InjectMocks | ||
private DefaultUserDetailsService defaultUserDetailsService; | ||
@Test | ||
public void TestLoadUserByUserNameSuccess(){ | ||
String username = "user"; | ||
UserEntityDto userEntityDto = Mockito.mock(UserEntityDto.class); | ||
Mockito.when(userEntityDto.getUserId()).thenReturn(String.valueOf(1l)); | ||
Mockito.when(userEntityDto.getPassword()).thenReturn("password"); | ||
Mockito.when(userEntityDto.getRole()).thenReturn("USER"); | ||
Mockito.when(userEntityDto.getUsername()).thenReturn(username); | ||
Mockito.when(accountRepository.loadUserEntity(Mockito.any())).thenReturn(userEntityDto); | ||
// Mockito.when(bCryptPasswordEncoder.encode(Mockito.any())).thenReturn("pwEncoded"); | ||
CustomUserDetails userDetails = (CustomUserDetails) defaultUserDetailsService.loadUserByUsername(username); | ||
Assertions.assertAll( | ||
() -> Assertions.assertEquals(String.valueOf(1l), userDetails.getUserId()), | ||
() -> Assertions.assertEquals("password", userDetails.getPassword()) | ||
); | ||
} | ||
@Test | ||
public void TestLoadUserByUserNameFailed(){ | ||
String username = "user"; | ||
Mockito.when(accountRepository.loadUserEntity(Mockito.any())).thenReturn(null); | ||
Exception exception = Assertions.assertThrows(UsernameNotFoundException.class, | ||
() -> {defaultUserDetailsService.loadUserByUsername(username); | ||
}); | ||
Assertions.assertEquals("User Not Found", exception.getMessage()); | ||
} | ||
}*/ |
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,33 @@ | ||
spring: | ||
datasource: | ||
driver-class-name: org.h2.Driver | ||
url: jdbc:h2:mem:testdb | ||
username: sa | ||
password: | ||
jpa: | ||
hibernate: | ||
ddl-auto: create-drop | ||
properties: | ||
hibernate: | ||
dialect: org.hibernate.dialect.H2Dialect | ||
format_sql: true | ||
show_sql: true | ||
redis: | ||
host: 133.186.223.228 | ||
password: "*N2vya7H@muDTwdNMR!" | ||
port: 6379 | ||
database: 29 | ||
security: | ||
key: sakdjA24HSdflasbdglag2yhsdrg342TASGASd58aw4t3AWEIGzsoigbaWEIGHP3tug0ajw4s23a8th24tgaw2854yq3p48ghaa294 | ||
application: | ||
name: eureka-client | ||
|
||
eureka: | ||
instance: | ||
prefer-ip-address: true | ||
client: | ||
register-with-eureka: true | ||
fetch-registry: true | ||
service-url: | ||
defaultZone : http://127.0.0.1:8761/eureka | ||
|
Binary file not shown.
Binary file not shown.
Empty file.
Binary file removed
BIN
-790 Bytes
target/classes/com/t3t/authenticationapi/AuthenticationApiApplication.class
Binary file not shown.
Binary file removed
BIN
-631 Bytes
target/classes/com/t3t/authenticationapi/index/IndexController.class
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file removed
0
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
Empty file.
2 changes: 0 additions & 2 deletions
2
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
This file was deleted.
Oops, something went wrong.
Empty file.
2 changes: 0 additions & 2 deletions
2
target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-588 Bytes
target/test-classes/com/t3t/authenticationapi/AuthenticationApiApplicationTests.class
Binary file not shown.