Skip to content

Commit

Permalink
Migrating judge-d to spring boot 2.1.1.RELEASE and increased version …
Browse files Browse the repository at this point in the history
…of liquibase
  • Loading branch information
Felipe444 committed Feb 4, 2019
1 parent f3b0630 commit da250a3
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 31 deletions.
19 changes: 15 additions & 4 deletions judge-d-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<name>Judge-D-Agent</name>

<properties>
<springBootVersion>1.5.9.RELEASE</springBootVersion>
<springBootVersion>2.1.1.RELEASE</springBootVersion>
<swaggerVersion>2.7.0</swaggerVersion>
<pactGenVersion>1.3.3</pactGenVersion>
</properties>
Expand Down Expand Up @@ -51,13 +51,18 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
<version>1.4.4.RELEASE</version>
<artifactId>spring-cloud-openfeign-core</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>1.3.3.RELEASE</version>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
Expand All @@ -68,6 +73,11 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.7</version>
</dependency>

<!--TEST-->
<dependency>
Expand Down Expand Up @@ -106,6 +116,7 @@
<groupId>com.hltech</groupId>
<artifactId>pact-gen</artifactId>
<version>${pactGenVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder;
import org.springframework.cloud.netflix.feign.support.SpringDecoder;
import org.springframework.cloud.netflix.feign.support.SpringEncoder;
import org.springframework.cloud.netflix.feign.support.SpringMvcContract;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
import org.springframework.cloud.openfeign.support.SpringDecoder;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.cloud.openfeign.support.SpringMvcContract;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.hltech.contracts.judged.agent.config;

import com.google.common.collect.Sets;
import com.hltech.contracts.judged.agent.JudgeDPublisher;
import lombok.extern.slf4j.Slf4j;

import java.util.HashSet;
import java.util.Set;

@Slf4j
Expand All @@ -23,7 +23,7 @@ public void publish(String environment, Set<JudgeDPublisher.ServiceForm> service

judgeDPublisher.publish(environment, serviceForms);

previouslySentEnvironment = Sets.newHashSet(serviceForms);
previouslySentEnvironment = new HashSet<>(serviceForms);
} else {
log.debug("Services not changed since last update. Skipping update.");
}
Expand Down
19 changes: 10 additions & 9 deletions judge-d-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<name>Judge-D-server</name>

<properties>
<springBootVersion>1.5.9.RELEASE</springBootVersion>
<springBootVersion>2.1.1.RELEASE</springBootVersion>
<swaggerVersion>2.7.0</swaggerVersion>
</properties>

Expand Down Expand Up @@ -51,10 +51,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand All @@ -70,13 +66,13 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
<version>1.4.4.RELEASE</version>
<artifactId>spring-cloud-netflix-hystrix</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
<version>1.3.3.RELEASE</version>
<version>2.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
Expand All @@ -86,7 +82,7 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.4.1</version>
<version>3.6.2</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -133,6 +129,11 @@
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.3.RELEASE</version>
</dependency>

<!--TEST-->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import java.util.Set;

import static java.util.Optional.ofNullable;

@Repository
public class JPAEnvironmentRepository implements EnvironmentRepository {

Expand All @@ -29,6 +27,6 @@ public Set<String> getNames() {

@Override
public EnvironmentAggregate get(String name) {
return ofNullable(springDataEnvironmentRepository.findOne(name)).orElse(EnvironmentAggregate.empty(name));
return springDataEnvironmentRepository.findById(name).orElse(EnvironmentAggregate.empty(name));
}
}
13 changes: 6 additions & 7 deletions judge-d-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ pactbroker.url=${PACT_BROKER_URL}


#management
management.port=8091
management.security.enabled=false
management.server.port=8091
management.health.defaults.enabled=false
endpoints.enabled=false
endpoints.health.time-to-live=60000
endpoints.health.enabled=true
endpoints.metrics.enabled=true
management.endpoints.enabled-by-default=false
management.endpoint.health.cache.time-to-live=60000
management.endpoint.health.enabled=true
management.endpoint.metrics.enabled=true


# jackson config
Expand All @@ -35,4 +34,4 @@ spring.datasource.url=${DB_CONNECTION_STRING}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=none
liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
spring.liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ValidationControllerIT extends Specification {
def "should return 404 when validate service contracts against env given contracts have not been registered"() {
when: 'rest validatePacts url is hit'
def response = mockMvc.perform(
get(new URI('/validation-report/service/other-service:1.0?environment=SIT&environment=UAT'))
get(new URI('/environment-compatibility-report/other-service:1.0?environment=SIT&environment=UAT'))
.accept("application/json")
).andReturn().getResponse()
then: 'controller returns validation response in json'
Expand Down

0 comments on commit da250a3

Please sign in to comment.