handle empty line at end of file
This commit is contained in:
@@ -36,6 +36,8 @@ class PersisterService {
|
||||
def slurper = new JsonSlurper()
|
||||
try {
|
||||
location.eachLine {
|
||||
if (it.trim().length() == 0)
|
||||
return
|
||||
def parsed = slurper.parseText it
|
||||
def event = fromJson parsed
|
||||
if (event != null)
|
||||
|
@@ -151,7 +151,7 @@ class PersisterServiceLoadingTest {
|
||||
json2 = JsonOutput.toJson(json2)
|
||||
|
||||
persisted.append "$json1\n"
|
||||
persisted.append json2
|
||||
persisted.append "$json2\n"
|
||||
|
||||
PersisterService ps = new PersisterService(persisted, eventBus, 100, null)
|
||||
ps.start()
|
||||
|
Reference in New Issue
Block a user