-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22752 from gsmet/2.6.2-backports-2
2.6.2 backports 2
- Loading branch information
Showing
20 changed files
with
252 additions
and
42 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
core/deployment/src/main/java/io/quarkus/deployment/QuarkusClassVisitor.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,32 @@ | ||
package io.quarkus.deployment; | ||
|
||
import org.objectweb.asm.ClassVisitor; | ||
|
||
/** | ||
* A subclass of {@link ClassVisitor} that allows carrying around data | ||
* that are useful in the context of Quarkus bytecode transformations. | ||
* Class visitors that require access to these data should extend this class. | ||
*/ | ||
public abstract class QuarkusClassVisitor extends ClassVisitor { | ||
public QuarkusClassVisitor(int api) { | ||
super(api); | ||
} | ||
|
||
public QuarkusClassVisitor(int api, ClassVisitor classVisitor) { | ||
super(api, classVisitor); | ||
} | ||
|
||
// --- | ||
|
||
// this could possibly be a Map<String, Object> or something like that, | ||
// but there's no need at the moment | ||
private int originalClassReaderOptions; | ||
|
||
public int getOriginalClassReaderOptions() { | ||
return originalClassReaderOptions; | ||
} | ||
|
||
public void setOriginalClassReaderOptions(int originalClassReaderOptions) { | ||
this.originalClassReaderOptions = originalClassReaderOptions; | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
...est/java/io/quarkus/opentelemetry/deployment/NonAppEndpointsDisabledWithRootPathTest.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.opentelemetry.deployment; | ||
|
||
import static org.hamcrest.Matchers.containsString; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
public class NonAppEndpointsDisabledWithRootPathTest { | ||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClass(TracerRouter.class) | ||
.addClass(TestSpanExporter.class)) | ||
.overrideConfigKey("quarkus.http.root-path", "/app") | ||
.overrideConfigKey("quarkus.http.non-application-root-path", "quarkus"); | ||
|
||
@Inject | ||
TestSpanExporter testSpanExporter; | ||
|
||
@Test | ||
void testHealthEndpointNotTraced() { | ||
RestAssured.when().get("/quarkus/health").then() | ||
.statusCode(200) | ||
.body(containsString("\"status\": \"UP\"")); | ||
|
||
RestAssured.when().get("/quarkus/health/live").then() | ||
.statusCode(200) | ||
.body(containsString("\"status\": \"UP\"")); | ||
|
||
RestAssured.when().get("/quarkus/health/ready").then() | ||
.statusCode(200) | ||
.body(containsString("\"status\": \"UP\"")); | ||
|
||
RestAssured.when().get("/tracer").then() | ||
.statusCode(200) | ||
.body(is("Hello Tracer!")); | ||
|
||
testSpanExporter.assertSpanCount(2); | ||
} | ||
} |
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
Oops, something went wrong.