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.
Qute type-safe validation - include all interface methods in hierarchy
- resolves quarkusio#19564
- Loading branch information
Showing
3 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
...ent/src/test/java/io/quarkus/qute/deployment/typesafe/InterfaceValidationFailureTest.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,46 @@ | ||
package io.quarkus.qute.deployment.typesafe; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.qute.TemplateException; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class InterfaceValidationFailureTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(InterfaceValidationSuccessTest.Metrics.class, InterfaceValidationSuccessTest.Count.class, | ||
InterfaceValidationSuccessTest.Wrapper.class) | ||
.addAsResource(new StringAsset( | ||
"{@io.quarkus.qute.deployment.typesafe.InterfaceValidationSuccessTest$Metrics metrics}" | ||
+ "{metrics.responses.values}"), | ||
"templates/metrics.html")) | ||
.assertException(t -> { | ||
Throwable e = t; | ||
TemplateException te = null; | ||
while (e != null) { | ||
if (e instanceof TemplateException) { | ||
te = (TemplateException) e; | ||
break; | ||
} | ||
e = e.getCause(); | ||
} | ||
assertNotNull(te); | ||
assertTrue(te.getMessage().contains("Found template problems (1)"), te.getMessage()); | ||
assertTrue(te.getMessage().contains("{metrics.responses.values}"), te.getMessage()); | ||
}); | ||
|
||
@Test | ||
public void test() { | ||
fail(); | ||
} | ||
} |
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