Skip to content

Commit a0a1488

Browse files
Copilotnixel2007
andcommitted
Use explicit assertion that code doesn't throw exceptions in test
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
1 parent 4313cc6 commit a0a1488

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.stream.Collectors;
3737

3838
import static org.assertj.core.api.Assertions.assertThat;
39+
import static org.assertj.core.api.Assertions.assertThatCode;
3940

4041
@SpringBootTest
4142
class VariableSymbolTest {
@@ -160,11 +161,12 @@ void testNoNPEOnMalformedLValue() {
160161
КонецПроцедуры
161162
""";
162163

163-
var ctx = TestUtils.getDocumentContext(code);
164-
var variables = ctx.getSymbolTree().getVariables();
165-
166-
// Should not throw NullPointerException
167-
assertThat(variables).isNotNull();
164+
// Symbol tree construction happens during getDocumentContext
165+
// and should not throw NullPointerException
166+
assertThatCode(() -> {
167+
var ctx = TestUtils.getDocumentContext(code);
168+
ctx.getSymbolTree().getVariables();
169+
}).doesNotThrowAnyException();
168170
}
169171

170172
}

0 commit comments

Comments
 (0)