Skip to content

Commit

Permalink
fix: #4 gitignore 추가 후 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
joohyun1996 committed Apr 12, 2024
1 parent 88da5de commit 1d5b783
Show file tree
Hide file tree
Showing 42 changed files with 124 additions and 164 deletions.
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/compiler.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

Empty file.
Empty file.
Empty file.

This file was deleted.

Empty file.
Empty file.

This file was deleted.

Empty file.
17 changes: 0 additions & 17 deletions .idea/sonarlint/issuestore/index.pb

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
17 changes: 0 additions & 17 deletions .idea/sonarlint/securityhotspotstore/index.pb

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

29 changes: 0 additions & 29 deletions HELP.md

This file was deleted.

6 changes: 0 additions & 6 deletions authentication-api.iml

This file was deleted.

Empty file.
30 changes: 30 additions & 0 deletions src/main/resources/application.yml
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
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());
}
}*/
33 changes: 33 additions & 0 deletions src/test/resources/application.yml
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 removed target/authentication-api-0.0.1-SNAPSHOT.jar
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
10 changes: 0 additions & 10 deletions target/classes/templates/index.html

This file was deleted.

3 changes: 0 additions & 3 deletions target/maven-archiver/pom.properties

This file was deleted.

Empty file.

This file was deleted.

Empty file.

This file was deleted.

Binary file not shown.

0 comments on commit 1d5b783

Please sign in to comment.