Skip to content

Commit 503dcee

Browse files
committed
fix nullpointer
1 parent 1e72771 commit 503dcee

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

jdk_8_maven/em/embedded/graphql/spring-petclinic-graphql/src/main/java/em/embedded/org/springframework/samples/petclinic/EmbeddedEvoMasterController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public String startSut() {
9090
throw new RuntimeException(e);
9191
}
9292

93-
SqlScriptRunnerCached.runScriptFromResourceFile(sqlConnection,"/db/postgresql/initDB.sql");
93+
9494

9595
dbSpecification = Arrays.asList(new DbSpecification(){{
9696
dbType = DatabaseType.POSTGRES;
@@ -100,7 +100,7 @@ public String startSut() {
100100
employSmartDbClean = false;
101101
}});
102102

103-
103+
SqlScriptRunnerCached.runScriptFromResourceFile(sqlConnection,"/db/postgresql/initDB.sql");
104104

105105
return "http://localhost:" + getSutPort();
106106
}

jdk_8_maven/em/external/graphql/spring-petclinic-graphql/src/main/java/em/external/org/springframework/samples/petclinic/ExternalEvoMasterController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,19 @@ public void preStart() {
151151
public void postStart() {
152152
closeDataBaseConnection();
153153

154-
SqlScriptRunnerCached.runScriptFromResourceFile(sqlConnection,"/initDB.sql");
155-
156-
157154
try {
158155
Class.forName(getDatabaseDriverName());
159156
sqlConnection = DriverManager.getConnection(dbUrl(), "postgres", "");
157+
160158
dbSpecification = Arrays.asList(new DbSpecification(){{
161159
dbType = DatabaseType.POSTGRES;
162160
connection = sqlConnection;
163161
schemaNames = Arrays.asList("public");
164162
// initSqlOnResourcePath = "/db/postgresql/populateDB.sql";
165163
employSmartDbClean = false;
166164
}});
165+
166+
SqlScriptRunnerCached.runScriptFromResourceFile(sqlConnection,"/initDB.sql");
167167
} catch (Exception e) {
168168
throw new RuntimeException(e);
169169
}

0 commit comments

Comments
 (0)