■ ■ ■ ■ ■ ■
jadx-core/src/test/java/jadx/tests/api/utils/assertj/JadxClassNodeAssertions.java
| skipped 7 lines |
8 | 8 | | import jadx.api.ICodeInfo; |
9 | 9 | | import jadx.api.metadata.ICodeAnnotation; |
10 | 10 | | import jadx.core.dex.nodes.ClassNode; |
11 | | - | import jadx.core.dex.nodes.ICodeNode; |
12 | 11 | | import jadx.tests.api.IntegrationTest; |
13 | 12 | | |
14 | 13 | | import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat; |
| skipped 43 lines |
58 | 57 | | return this; |
59 | 58 | | } |
60 | 59 | | |
61 | | - | public void checkCodeAnnotationFor(String refStr, ICodeNode node) { |
| 60 | + | public JadxClassNodeAssertions checkCodeAnnotationFor(String refStr, ICodeAnnotation node) { |
62 | 61 | | checkCodeAnnotationFor(refStr, 0, node); |
| 62 | + | return this; |
63 | 63 | | } |
64 | 64 | | |
65 | | - | public void checkCodeAnnotationFor(String refStr, int refOffset, ICodeNode node) { |
| 65 | + | public JadxClassNodeAssertions checkCodeAnnotationFor(String refStr, int refOffset, ICodeAnnotation node) { |
66 | 66 | | ICodeInfo code = actual.getCode(); |
67 | 67 | | int codePos = code.getCodeStr().indexOf(refStr); |
68 | 68 | | assertThat(codePos).describedAs("String '%s' not found", refStr).isNotEqualTo(-1); |
| skipped 1 lines |
70 | 70 | | for (Map.Entry<Integer, ICodeAnnotation> entry : code.getCodeMetadata().getAsMap().entrySet()) { |
71 | 71 | | if (entry.getKey() == refPos) { |
72 | 72 | | Assertions.assertThat(entry.getValue()).isEqualTo(node); |
73 | | - | return; |
| 73 | + | return this; |
74 | 74 | | } |
75 | 75 | | } |
76 | 76 | | fail("Annotation for reference string: '%s' at position %d not found", refStr, refPos); |
| 77 | + | return this; |
77 | 78 | | } |
78 | 79 | | } |
79 | 80 | | |