This file contains hidden or 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
| public interface BaseService<T extends BaseRequest, R extends BaseResponse> { | |
| R execute(T request); | |
| } |
This file contains hidden or 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
| docker build -f Dockerfile -t config-server:latest . | |
| docker run -e ACTIVE_PROFILE=default -e CONFIG_GIT_REPO_NAME=xxx-configs -e CONFIG_GIT_USERNAME=username -e CONFIG_GIT_PASSWORD=password -p 8089:8089 -it config-server:latest |
This file contains hidden or 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
| docker build -f Dockerfile -t config-server:latest . |
This file contains hidden or 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
| FROM adoptopenjdk:11-jre-hotspot | |
| ADD target/*.jar ./srv | |
| WORKDIR /srv | |
| EXPOSE 8089 | |
| ENV ACTIVE_PROFILE ${ACTIVE_PROFILE} | |
| ENV CONFIG_GIT_REPO_NAME ${CONFIG_GIT_REPO_NAME} | |
| ENV CONFIG_GIT_USERNAME ${CONFIG_GIT_USERNAME} | |
| ENV CONFIG_GIT_PASSWORD ${CONFIG_GIT_PASSWORD} | |
| CMD java -Dspring.profiles.active=$ACTIVE_PROFILE -jar /srv/*.jar |
This file contains hidden or 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
| spring: | |
| profiles: default | |
| cloud: | |
| config: | |
| server: | |
| git: | |
| uri: http://{baseUrl}/config-server/${CONFIG_GIT_REPO_NAME}.git | |
| clone-on-start: true | |
| username: ${CONFIG_GIT_USERNAME} | |
| password: ${CONFIG_GIT_PASSWORD} |
This file contains hidden or 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
| @EnableConfigServer | |
| @SpringBootApplication | |
| public class ConfigServerApplication { | |
| public static void main(String[] args) { | |
| SpringApplication.run(ConfigServerApplication.class, args); | |
| } | |
| } |
This file contains hidden or 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
| @Target(ElementType.METHOD) | |
| @Retention(RetentionPolicy.RUNTIME) | |
| public @interface LogExecutionTime { | |
| } |
This file contains hidden or 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
| https://www.callicoder.com/hibernate-spring-boot-jpa-embeddable-demo/ | |
| https://www.baeldung.com/java-optional-or-else-vs-or-else-get | |
| https://refactoring.guru/smells/feature-envy | |
| https://www.mkyong.com/unittest/junit-4-tutorial-2-expected-exception-test/ | |
| https://www.javacodegeeks.com/2013/02/testing-expected-exceptions-with-junit-rules.html | |
| https://www.geeksforgeeks.org/luhn-algorithm/ | |
| http://baddotrobot.com/blog/2012/03/27/expecting-exception-with-junit-rule/ | |
| https://github.com/r2dbc | |
| https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html | |
| https://github.com/snicoll-demos/spring-boot-migration/tree/master/src/main/java/com/example/speakerservice |
This file contains hidden or 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
| @RunWith(SpringRunner.class) | |
| @SpringBootTest | |
| @AutoConfigureMockMvc | |
| @ActiveProfiles("test") | |
| public abstract class BaseControllerIntegrationTest { | |
| @PersistenceContext | |
| protected EntityManager entityManager; | |
| @Autowired |
This file contains hidden or 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
| import liquibase.integration.spring.SpringLiquibase; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.core.io.Resource; | |
| import org.springframework.core.io.ResourceLoader; | |
| import org.springframework.util.Assert; | |
| import javax.sql.DataSource; |