Skip to content

Commit

Permalink
Fix constructor of JsonItemReader to call setExecutionContextName()
Browse files Browse the repository at this point in the history
  • Loading branch information
benelog authored and fmbenhassine committed Mar 24, 2020
1 parent 0ecc052 commit b9fa9c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,6 +25,7 @@
import org.springframework.core.io.Resource;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

/**
* {@link ItemStreamReader} implementation that reads Json objects from a
Expand Down Expand Up @@ -70,6 +71,7 @@ public JsonItemReader(Resource resource, JsonObjectReader<T> jsonObjectReader) {
Assert.notNull(jsonObjectReader, "The json object reader must not be null.");
this.resource = resource;
this.jsonObjectReader = jsonObjectReader;
setExecutionContextName(ClassUtils.getShortName(JsonItemReader.class));
}

/**
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2018 the original author or authors.
* Copyright 2018-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -104,6 +104,7 @@ public void testReadItem() throws Exception {
itemReader = new JsonItemReader<>(resource, this.jsonObjectReader);

// when
itemReader.open(new ExecutionContext());
itemReader.read();

// then
Expand Down

0 comments on commit b9fa9c3

Please sign in to comment.