Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Spring Cloud version Dalston.RELEASE. Update HSQLDB settings. #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
modelVersion=4.0.0
groupId=org.springframework.samples.service.service
artifactId=microservice-demo
version=1.1.0.RELEASE
version=1.2.0.RELEASE
packaging=jar
springBootVersion=1.4.0.RELEASE
springDataCommonsVersion=1.12.2.RELEASE
hsqldbVersion=2.3.4
springCloudStarterVersion=1.1.2.RELEASE
springCloudStarterEurekaServerVersion=1.1.6.RELEASE
springBootVersion=1.5.2.RELEASE
springDataCommonsVersion=1.13.1.RELEASE
hsqldbVersion=2.3.3
springCloudStarterVersion=1.2.0.RELEASE
springCloudStarterEurekaServerVersion=1.3.0.RELEASE
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?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"
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>
<groupId>org.springframework.samples.service.service</groupId>
<artifactId>microservice-demo</artifactId>
<version>1.1.0.RELEASE</version>
<version>1.2.0.RELEASE</version>
<packaging>jar</packaging>

<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.RELEASE</version>
<version>Dalston.RELEASE</version>
</parent>

<properties>
<java.version>1.8</java.version>
<!-- Stand-alone RESTFul application for testing only -->
<start-class>io.pivotal.microservices.services.Main</start-class>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -44,7 +43,7 @@ public AccountsConfiguration() {
public DataSource dataSource() {
logger.info("dataSource() invoked");

// Create an in-memory H2 relational database containing some demo
// Create an in-memory HSQLDB relational database containing some demo
// accounts.
DataSource dataSource = (new EmbeddedDatabaseBuilder()).addScript("classpath:testdb/schema.sql")
.addScript("classpath:testdb/data.sql").build();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/db-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# schema.sql. Instead check the tables match their JPA mapped classes
spring.jpa.hibernate.ddl-auto: validate
spring.jpa.hibernate.naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.database: H2
spring.jpa.database: HSQL
spring.jpa.show-sql: true
2 changes: 1 addition & 1 deletion src/main/resources/testdb/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
drop table T_ACCOUNT if exists;

create table T_ACCOUNT (ID bigint identity primary key, NUMBER varchar(9),
NAME varchar(50) not null, BALANCE decimal(8,2), unique(NUMBER));
NAME varchar(50) not null, BALANCE numeric(19,2), unique(NUMBER));

ALTER TABLE T_ACCOUNT ALTER COLUMN BALANCE SET DEFAULT 0.0;
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import io.pivotal.microservices.services.accounts.AccountsServer;

Expand All @@ -17,6 +18,7 @@
* @author Paul Chapman
*
*/

@SpringBootApplication
@Import(AccountsConfiguration.class)
class AccountsMain {
Expand All @@ -35,8 +37,9 @@ public static void main(String[] args) {
*
* @author Paul Chapman
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = AccountsMain.class)
@RunWith(SpringRunner.class)
@SpringBootTest(classes = AccountsMain.class)
@WebAppConfiguration
public class AccountsControllerIntegrationTests extends AbstractAccountControllerTests {

}