Skip to content

Commit

Permalink
Fix test formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz committed Mar 11, 2024
1 parent 66421d1 commit 25f5855
Showing 1 changed file with 8 additions and 9 deletions.
Expand Up @@ -111,8 +111,7 @@ void afterAll() {
}

private TestClassBase createTestClassInstance(Class<? extends TestClassBase> testClass)
throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
Constructor<? extends TestClassBase> declaredConstructor = testClass.getDeclaredConstructor();
declaredConstructor.setAccessible(true);
return declaredConstructor.newInstance();
Expand All @@ -127,41 +126,41 @@ void testClassWithAnnotations() {

@ParameterizedTest
@ValueSource(classes = {ClassWithoutAnnotations.class, TransitiveClassWithoutAnnotations.class, InterfaceImplementor.class})
void testInheritedCaptureTransaction(Class<? extends TestClassBase> testClass) throws Exception{
void testInheritedCaptureTransaction(Class<? extends TestClassBase> testClass) throws Exception {
TestClassBase instance = createTestClassInstance(testClass);
instance.captureTransaction();
checkTransaction(testClass.getSimpleName()+"#captureTransaction");
checkTransaction(testClass.getSimpleName() + "#captureTransaction");
}


@ParameterizedTest
@ValueSource(classes = {ClassWithoutAnnotations.class, TransitiveClassWithoutAnnotations.class, InterfaceImplementor.class})
void testInheritedCaptureSpan(Class<? extends TestClassBase> testClass) throws Exception{
void testInheritedCaptureSpan(Class<? extends TestClassBase> testClass) throws Exception {
TestClassBase instance = createTestClassInstance(testClass);
Transaction transaction = ElasticApm.startTransaction();
try (Scope scope = transaction.activate()) {
instance.captureSpan();
}
transaction.end();
checkSpan(testClass.getSimpleName()+"#captureSpan");
checkSpan(testClass.getSimpleName() + "#captureSpan");
}

@ParameterizedTest
@ValueSource(classes = {ClassWithoutAnnotations.class, TransitiveClassWithoutAnnotations.class, InterfaceImplementor.class})
void testInheritedTracedWithoutActiveTransaction(Class<? extends TestClassBase> testClass) throws Exception {
createTestClassInstance(testClass).traced();
checkTransaction(testClass.getSimpleName()+"#traced");
checkTransaction(testClass.getSimpleName() + "#traced");
}

@ParameterizedTest
@ValueSource(classes = {ClassWithoutAnnotations.class, TransitiveClassWithoutAnnotations.class, InterfaceImplementor.class})
void testInheritedTracedWithActiveTransaction(Class<? extends TestClassBase> testClass) throws Exception{
void testInheritedTracedWithActiveTransaction(Class<? extends TestClassBase> testClass) throws Exception {
Transaction transaction = ElasticApm.startTransaction();
try (Scope scope = transaction.activate()) {
createTestClassInstance(testClass).traced();
}
transaction.end();
checkSpan(testClass.getSimpleName()+"#traced");
checkSpan(testClass.getSimpleName() + "#traced");
}

private void checkTransaction(String name) {
Expand Down

0 comments on commit 25f5855

Please sign in to comment.