Skip to content

Commit d243da5

Browse files
committed
Avoid using AutoCloseableSupplier on old jinjava version
1 parent b2b4b3d commit d243da5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/java/com/hubspot/jinjava/el/ext/JinjavaBeanELResolverTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.google.common.collect.ImmutableSet;
99
import com.hubspot.jinjava.JinjavaConfig;
1010
import com.hubspot.jinjava.el.JinjavaELContext;
11-
import com.hubspot.jinjava.interpret.AutoCloseableSupplier;
1211
import com.hubspot.jinjava.interpret.JinjavaInterpreter;
1312
import javax.el.ELContext;
1413
import javax.el.MethodNotFoundException;
@@ -177,13 +176,12 @@ public void itThrowsExceptionWhenPropertyIsRestrictedFromConfig() {
177176

178177
@Test
179178
public void itDoesNotAllowAccessingPropertiesOfInterpreter() {
180-
try (
181-
AutoCloseableSupplier.AutoCloseableImpl<JinjavaInterpreter> c = JinjavaInterpreter
182-
.closeablePushCurrent(interpreter)
183-
.get()
184-
) {
179+
JinjavaInterpreter.pushCurrent(interpreter);
180+
try {
185181
assertThat(jinjavaBeanELResolver.getValue(elContext, interpreter, "config"))
186182
.isNull();
183+
} finally {
184+
JinjavaInterpreter.popCurrent();
187185
}
188186
}
189187
}

0 commit comments

Comments
 (0)