Skip to content

Commit

Permalink
9/11: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thuan committed Nov 9, 2023
1 parent f6f3a05 commit da9fcea
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
30 changes: 30 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<io.jsonwebtoken.jjwt.version>0.9.1</io.jsonwebtoken.jjwt.version>
<io.jsonwebtoken.jjwt-jackson.version>0.11.5</io.jsonwebtoken.jjwt-jackson.version>
<software.amazon.awssdk.s3.version>2.20.68</software.amazon.awssdk.s3.version>
<docker.username>thuanvn2002</docker.username>
<docker.image.name>spotifyapi</docker.image.name>
<docker.image.tag>${project.artifactId}</docker.image.tag>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -168,7 +171,34 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<from>
<image>eclipse-temurin:17</image>
<platforms>
<platform>
<architecture>arm64</architecture>
<os>linux</os>
</platform>
<platform>
<architecture>amd64</architecture>
<os>linux</os>
</platform>
</platforms>
</from>
<to>
<image>docker.io/${docker.username}/${docker.image.name}:${docker.image.tag}</image>
<tags>
<tag>latest</tag>
</tags>
</to>
</configuration>
</plugin>
</plugins>

</build>


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql= true

spring.datasource.max-lifetime=1800000
application.security.jwt.secret-key = 404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970
application.security.jwt.expiration = 600000
application.security.jwt.refresh-token.expiration = 14400000
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/spotify/app/AbstractTestcontainers.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ static void beforeAll() {
.withDatabaseName("spotify-dao-unit-test")
.withUsername("kai")
.withPassword("password")
.withReuse(true)
;

@DynamicPropertySource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class AuthenticationIT extends AbstractTestcontainers {
public class AuthenticationIT {

@Autowired
private TestRestTemplate restTemplate;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/spotify/app/journey/UserIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class UserIT extends AbstractTestcontainers {
public class UserIT {

@Autowired
private TestRestTemplate restTemplate;
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/com/spotify/app/user/UserRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.spotify.app.model.User;
import com.spotify.app.repository.RoleRepository;
import com.spotify.app.repository.UserRepository;
import jakarta.transaction.Transactional;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -23,7 +24,7 @@
@DataJpaTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Import({TestConfig.class})
public class UserRepositoryTest extends AbstractTestcontainers {
public class UserRepositoryTest {

@Autowired
private UserRepository underTest ;
Expand Down

0 comments on commit da9fcea

Please sign in to comment.