@@ -1547,6 +1547,28 @@ public void generateQuarkusConcreteClassDoesNotAddResponseStatusAnnotation() thr
15471547 "import org.jboss.resteasy.reactive.ResponseStatus" );
15481548 }
15491549
1550+ /**
1551+ * Parameterized test covering all @Authenticated annotation scenarios for Quarkus + OAuth2.
1552+ * Each row: (spec path, interfaceOnly, expected count of @io.quarkus.security.Authenticated).
1553+ */
1554+ @ DataProvider (name = "quarkusOAuth2AuthenticatedCases" )
1555+ public Object [][] quarkusOAuth2AuthenticatedCases () {
1556+ return new Object [][] {
1557+ // single OAuth2 flow, no scopes → @Authenticated
1558+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-no-scopes.yaml" , true , 1 },
1559+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-no-scopes.yaml" , false , 1 },
1560+ // single OAuth2 flow, non-empty scopes → no @Authenticated
1561+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-with-scopes.yaml" , true , 0 },
1562+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-with-scopes.yaml" , false , 0 },
1563+ // multiple OAuth2 flows, all no scopes → @Authenticated exactly once (no per-flow duplication)
1564+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-multi-flow-no-scopes.yaml" , true , 1 },
1565+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-multi-flow-no-scopes.yaml" , false , 1 },
1566+ // OR: one scheme no-scope + one scheme scoped → one op gets @Authenticated, scoped-only op gets none
1567+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-or-empty-and-scoped.yaml" , true , 1 },
1568+ {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-or-empty-and-scoped.yaml" , false , 1 },
1569+ };
1570+ }
1571+
15501572 @ Test (dataProvider = "quarkusOAuth2AuthenticatedCases" )
15511573 public void quarkusEmitsAuthenticatedAnnotationForOAuth2 (String specPath , boolean interfaceOnly , int expectedCount ) throws Exception {
15521574 final File output = Files .createTempDirectory ("test" ).toFile ().getCanonicalFile ();
@@ -1575,34 +1597,9 @@ public void quarkusEmitsAuthenticatedAnnotationForOAuth2(String specPath, boolea
15751597 }
15761598
15771599 /**
1578- * Parameterized test covering all @Authenticated annotation scenarios for Quarkus + OAuth2.
1579- * Each row: (spec path, interfaceOnly, expected occurrence count of @io.quarkus.security.Authenticated).
1580- *
1581- * <ul>
1582- * <li>Empty scopes → @Authenticated emitted (count 1)</li>
1583- * <li>Non-empty scopes → @Authenticated absent (count 0)</li>
1584- * <li>Multiple flows, all empty scopes → @Authenticated emitted exactly once (no duplication)</li>
1585- * <li>OR schemes where at least one has empty scopes → @Authenticated once; scoped-only op gets none</li>
1586- * </ul>
1600+ * Parameterized test covering all @Authenticated annotation scenarios for Quarkus + httpBasic.
1601+ * Each row: (interfaceOnly).
15871602 */
1588- @ DataProvider (name = "quarkusOAuth2AuthenticatedCases" )
1589- public Object [][] quarkusOAuth2AuthenticatedCases () {
1590- return new Object [][] {
1591- // single OAuth2 flow, no scopes → @Authenticated
1592- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-no-scopes.yaml" , true , 1 },
1593- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-no-scopes.yaml" , false , 1 },
1594- // single OAuth2 flow, non-empty scopes → no @Authenticated
1595- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-with-scopes.yaml" , true , 0 },
1596- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-with-scopes.yaml" , false , 0 },
1597- // multiple OAuth2 flows, all no scopes → @Authenticated exactly once (no per-flow duplication)
1598- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-multi-flow-no-scopes.yaml" , true , 1 },
1599- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-multi-flow-no-scopes.yaml" , false , 1 },
1600- // OR: one scheme no-scope + one scheme scoped → one op gets @Authenticated, scoped-only op gets none
1601- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-or-empty-and-scoped.yaml" , true , 1 },
1602- {"src/test/resources/3_0/jaxrs-spec/quarkus-oauth2-or-empty-and-scoped.yaml" , false , 1 },
1603- };
1604- }
1605-
16061603 @ DataProvider (name = "quarkusHttpBasicCases" )
16071604 public Object [][] quarkusHttpBasicCases () {
16081605 return new Object [][] {
@@ -1634,6 +1631,10 @@ public void quarkusEmitsAuthenticatedAnnotationForHttpBasic(boolean interfaceOnl
16341631 Assert .assertEquals (TestUtils .countOccurrences (content , "@io\\ .quarkus\\ .security\\ .Authenticated" ), 1 );
16351632 }
16361633
1634+ /**
1635+ * Parameterized test covering all @Authenticated annotation scenarios for Quarkus + http bearer.
1636+ * Each row: (interfaceOnly).
1637+ */
16371638 @ DataProvider (name = "quarkusHttpBearerCases" )
16381639 public Object [][] quarkusHttpBearerCases () {
16391640 return new Object [][] {
@@ -1665,6 +1666,10 @@ public void quarkusEmitsAuthenticatedAnnotationForHttpBearer(boolean interfaceOn
16651666 Assert .assertEquals (TestUtils .countOccurrences (content , "@io\\ .quarkus\\ .security\\ .Authenticated" ), 1 );
16661667 }
16671668
1669+ /**
1670+ * Parameterized test covering all @Authenticated annotation scenarios for Quarkus + api key.
1671+ * Each row: (interfaceOnly).
1672+ */
16681673 @ DataProvider (name = "quarkusApiKeyCases" )
16691674 public Object [][] quarkusApiKeyCases () {
16701675 return new Object [][] {
0 commit comments