forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check name conflicts of functions in Funqy
Signed-off-by: Matej Vasek <[email protected]>
- Loading branch information
1 parent
24cbc44
commit da92ba4
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...nqy/funqy-knative-events/deployment/src/test/java/io/quarkus/funqy/test/NameConflict.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.funqy.test; | ||
|
||
import io.quarkus.funqy.Funq; | ||
|
||
public class NameConflict { | ||
|
||
@Funq | ||
public String function(String s) { | ||
return s.toUpperCase(); | ||
} | ||
|
||
@Funq | ||
public int function(int i) { | ||
return i * 2; | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...funqy-knative-events/deployment/src/test/java/io/quarkus/funqy/test/NameConflictTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.funqy.test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import java.io.*; | ||
import java.util.logging.Level; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class NameConflictTest { | ||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withApplicationRoot(jar -> jar.addClass(NameConflict.class)) | ||
.setLogRecordPredicate(logRecord -> logRecord.getLevel().intValue() >= Level.WARNING.intValue() && | ||
logRecord.getLoggerName().startsWith("io.quarkus.funqy")) | ||
.assertLogRecords(logRecords -> { | ||
boolean match = logRecords | ||
.stream() | ||
.anyMatch(logRecord -> logRecord.getMessage().contains("Name conflict")); | ||
if (!match) { | ||
fail("Log does not contain message about name conflict."); | ||
} | ||
}); | ||
|
||
@Test | ||
void test() { | ||
assertTrue(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters