Skip to content

Commit

Permalink
Change springboot version 2.19 and spring cloud to greenwich release.…
Browse files Browse the repository at this point in the history
… Adapted tests and fixed on. Made storage more tolerant to database usage.
  • Loading branch information
benni committed Oct 15, 2019
1 parent fb50594 commit ae23f44
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

@SpringBootTest(properties= {"spring.main.allow-bean-definition-overriding=true"})
@RunWith(SpringRunner.class)
@AutoConfigureMockMvc(secure = false)
@AutoConfigureMockMvc//(secure = false)
public class EntityControllerTest {
@Autowired
private MockMvc mockMvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ngb.debugmode=false
kafka.replytimeout=10000
defaultLimit=50
maxLimit=500
spring.flyway.baselineOnMigrate=true

directDbConnection=false
#if directDbConnection is false then properties below are not used {{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

@SpringBootTest(properties = { "spring.main.allow-bean-definition-overriding=true" })
@RunWith(PowerMockRunner.class)
@AutoConfigureMockMvc(secure = false)
@AutoConfigureMockMvc//(secure = false)
@PowerMockRunnerDelegate(SpringRunner.class)
@PowerMockIgnore({ "javax.management.*", "com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "org.w3c.*",
"com.sun.org.apache.xalan.*", "javax.activation.*", "javax.net.ssl.*", "javax.security.*" })
Expand Down
22 changes: 8 additions & 14 deletions OverallParent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
Expand All @@ -29,7 +29,7 @@
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.5.RELEASE</version>
<version>2.1.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -51,16 +51,18 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<!-- <version>2.2.1.RELEASE</version> -->
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
<!-- <version>2.2.1.RELEASE</version> -->
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
Expand Down Expand Up @@ -89,17 +91,9 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<!-- <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin> -->
<!-- <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
<executions> <execution> <goals> <goal>repackage</goal> </goals> </execution>
</executions> </plugin> -->

</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@SpringBootTest(properties = { "spring.main.allow-bean-definition-overriding=true" })
@RunWith(SpringRunner.class)
@AutoConfigureMockMvc(secure = false)
@AutoConfigureMockMvc//(secure = false)
public class RegistryControllerTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

@SpringBootTest(properties = { "spring.main.allow-bean-definition-overriding=true" })
@RunWith(SpringRunner.class)
@AutoConfigureMockMvc(secure = false)
@AutoConfigureMockMvc//(secure = false)
public class RegistrySubscriptionControllerTest {

@Autowired
Expand Down Expand Up @@ -79,7 +79,7 @@ public void subscribeRestTest() {
when(csourceSubsService.subscribe(any())).thenReturn(new URI("urn:ngsi-ld:Subscription:7"));
mockMvc.perform(post("/ngsi-ld/v1/csourceSubscriptions/").contentType(AppConstants.NGB_APPLICATION_JSONLD)
.content(payload)).andExpect(status().isCreated())
.andExpect(redirectedUrl("/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:7")).andDo(print());
.andExpect(redirectedUrl("/ngsi-ld/v1/csourceSubscriptions/urn:ngsi-ld:Subscription:7")).andDo(print());

verify(csourceSubsService, times(1)).subscribe(any());
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ entity.temporal.topic=TEMPORALENTITY
entity.temporal.stopListenerIfDbFails=false
csource.topic=CONTEXT_SOURCE
csource.stopListenerIfDbFails=false

spring.flyway.baselineOnMigrate=true
reader.enabled=true
reader.datasource.url=jdbc:postgresql://localhost:5432/ngb?ApplicationName=ngb_storagemanager_reader
reader.datasource.username=ngb
Expand Down

0 comments on commit ae23f44

Please sign in to comment.