Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/spring-projects/sts4 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Dec 6, 2024
2 parents f6098c3 + f767e69 commit 7dd3592
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,39 @@ public void testConditionalOnPropertyCompletionWithPrefixAndAttributeWithNameAtt
assertEquals("prop3", completions.get(0).getTextEdit().getLeft().getNewText());
}

@Test
@Disabled
public void testConditionalOnPropertyCompletionWithEmptyPrefixAndEmptyNameAttribute() throws Exception {
List<CompletionItem> completions = getCompletions("@ConditionalOnProperty(prefix = , name = <*>)");
assertEquals(3, completions.size());

assertEquals("data.prop2", completions.get(0).getLabel());
assertEquals("else.prop3", completions.get(1).getLabel());
assertEquals("spring.boot.prop1", completions.get(2).getLabel());
}

@Test
@Disabled
public void testConditionalOnPropertyCompletionWithEmptyPrefixAndEmptyNameAttributeInQuotes() throws Exception {
List<CompletionItem> completions = getCompletions("@ConditionalOnProperty(prefix = , name = \"<*>\")");
assertEquals(3, completions.size());

assertEquals("data.prop2", completions.get(0).getLabel());
assertEquals("else.prop3", completions.get(1).getLabel());
assertEquals("spring.boot.prop1", completions.get(2).getLabel());
}

@Test
public void testConditionalOnPropertyCompletionForPrefixWithAdditionalEmptyNameAttribute() throws Exception {
List<CompletionItem> completions = getCompletions("@ConditionalOnProperty(prefix = <*>, name = )");
assertEquals(4, completions.size());

assertEquals("data", completions.get(0).getLabel());
assertEquals("else", completions.get(1).getLabel());
assertEquals("spring", completions.get(2).getLabel());
assertEquals("spring.boot", completions.get(3).getLabel());
}

private void assertCompletions(String completionLine, int noOfExpectedCompletions, int selectedProposal, String expectedCompletedLine) throws Exception {
String editorContent = """
package org.test;
Expand Down

0 comments on commit 7dd3592

Please sign in to comment.