Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
Expand Down Expand Up @@ -119,7 +119,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
</dependencies>
<build>
Expand Down
5 changes: 0 additions & 5 deletions authserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion circuit-breaker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
6 changes: 3 additions & 3 deletions command-side-blog-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
6 changes: 3 additions & 3 deletions command-side-project-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
15 changes: 14 additions & 1 deletion monolithic/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -123,6 +124,18 @@
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.15.1</version>
<scope>test</scope>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@

import java.lang.reflect.Method;

import org.springframework.boot.autoconfigure.web.WebMvcRegistrationsAdapter;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
Expand All @@ -26,9 +29,13 @@
@Configuration
public class RestConfiguration extends RepositoryRestMvcConfiguration {

public RestConfiguration(ApplicationContext context, ObjectFactory<ConversionService> conversionService) {
super(context, conversionService);
}

@Bean
public WebMvcRegistrationsAdapter webMvcRegistrationsHandlerMapping() {
return new WebMvcRegistrationsAdapter() {
public WebMvcRegistrations webMvcRegistrationsHandlerMapping() {
return new WebMvcRegistrations() {
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
return new RequestMappingHandlerMapping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.json.JacksonTester;
Expand All @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

Expand Down Expand Up @@ -60,7 +59,7 @@ public void setup() {
public void createBlogPostWithValidationErrorTest() throws Exception {

CreateBlogPostRequest request = new CreateBlogPostRequest();
given(this.commandGateway.sendAndWait(any(CreateBlogPostCommand.class))).willThrow(new CommandExecutionException("Test", new JSR303ViolationException(new HashSet())));
given(this.commandGateway.sendAndWait(Mockito.any(CreateBlogPostCommand.class))).willThrow(new CommandExecutionException("Test", new JSR303ViolationException(new HashSet())));

this.mvc.perform(post("/api/blogpostcommands")
.content(this.jsonCreate.write(request).getJson())
Expand All @@ -71,7 +70,7 @@ public void createBlogPostWithValidationErrorTest() throws Exception {
public void createBlogPostWithSuccessTest() throws Exception {

CreateBlogPostRequest request = new CreateBlogPostRequest();
given(this.commandGateway.sendAndWait(any(CreateBlogPostCommand.class))).willReturn("Success");
given(this.commandGateway.sendAndWait(Mockito.any(CreateBlogPostCommand.class))).willReturn("Success");

this.mvc.perform(post("/api/blogpostcommands")
.content(this.jsonCreate.write(request).getJson())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.json.JacksonTester;
Expand All @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.any;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

Expand Down Expand Up @@ -60,7 +59,7 @@ public void setup() {
public void createProjectWithValidationErrorTest() throws Exception {

CreateProjectRequest request = new CreateProjectRequest();
given(this.commandGateway.sendAndWait(any(CreateProjectCommand.class))).willThrow(new CommandExecutionException("Test", new JSR303ViolationException(new HashSet())));
given(this.commandGateway.sendAndWait(Mockito.any(CreateProjectCommand.class))).willThrow(new CommandExecutionException("Test", new JSR303ViolationException(new HashSet())));

this.mvc.perform(post("/api/projectcommands")
.content(this.jsonCreate.write(request).getJson())
Expand All @@ -71,7 +70,7 @@ public void createProjectWithValidationErrorTest() throws Exception {
public void createProjectWithSuccessTest() throws Exception {

CreateProjectRequest request = new CreateProjectRequest();
given(this.commandGateway.sendAndWait(any(CreateProjectCommand.class))).willReturn("Success");
given(this.commandGateway.sendAndWait(Mockito.any(CreateProjectCommand.class))).willReturn("Success");

this.mvc.perform(post("/api/projectcommands")
.content(this.jsonCreate.write(request).getJson())
Expand Down
38 changes: 23 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
<project xmlns="https://maven.apache.org/POM/4.0.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -37,9 +38,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<axon.version>3.4.4</axon.version>
<spring-cloud.version>Dalston.RELEASE</spring-cloud.version>
<spring-boot.version>1.5.22.RELEASE</spring-boot.version>
<spring-data-releasetrain.version>Ingalls-SR3</spring-data-releasetrain.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
<spring-boot.version>2.0.9.RELEASE</spring-boot.version>
<docker.image.prefix>idugalic</docker.image.prefix>
<docker.plugin.version>0.4.9</docker.plugin.version>
</properties>
Expand All @@ -53,14 +53,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Override Spring Data release train provided by Spring Boot -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-releasetrain</artifactId>
<version>${spring-data-releasetrain.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
Expand All @@ -73,6 +65,17 @@
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.5.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.1.1.RELEASE</version>
</dependency>


<dependency>
<groupId>commons-lang</groupId>
Expand Down Expand Up @@ -104,12 +107,17 @@
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
<version>2.0.0</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.4</version>
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.30.2-GA</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -156,7 +164,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.22.RELEASE</version>
<version>2.0.9.RELEASE</version>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
Expand Down
6 changes: 3 additions & 3 deletions query-side-blog-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.jolokia</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.idugalic.queryside.blog;

import java.util.Optional;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
Expand All @@ -18,14 +20,14 @@ public static void main(String... args) {
@Bean
public AuditorAware<String> auditorAware() {
return new AuditorAware<String>() {
public String getCurrentAuditor() {
public Optional<String> getCurrentAuditor() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

if (authentication == null || !authentication.isAuthenticated()) {
return null;
return Optional.empty();
}

return authentication.getName();
return Optional.of(authentication.getName());
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void handle(BlogPostCreatedEvent event, @SequenceNumber Long version) {
@EventHandler
public void handle(BlogPostPublishedEvent event, @SequenceNumber Long version) {
LOG.info("BlogPostCreatedEvent: [{}] ", event.getId());
BlogPost post = blogPostRepository.findOne(event.getId());
BlogPost post = blogPostRepository.findById(event.getId()).get();
post.setDraft(false);
post.setPublishAt(event.getPublishAt());
post.setVersion(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public interface ReadOnlyPagingAndSortingRepository extends PagingAndSortingRepo
@RestResource(exported = false)
BlogPost save(BlogPost entity);

@Override
@RestResource(exported = false)
void delete(String aLong);

@Override
@RestResource(exported = false)
void delete(BlogPost entity);
Expand Down
Loading