Skip to content

Commit

Permalink
Convert internal-lambda test from groovy to java (#9611)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca authored Oct 9, 2023
1 parent e24f0be commit 98976e9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.internal.lambda;

import static org.assertj.core.api.Assertions.assertThat;

import io.opentelemetry.javaagent.bootstrap.VirtualFieldInstalledMarker;
import org.junit.jupiter.api.Test;

class LambdaInstrumentationTest {

@Test
void testTransformRunnableLambda() {
Runnable runnable = TestLambda.makeRunnable();

// RunnableInstrumentation adds a VirtualField to all implementors of Runnable. If lambda class
// is transformed then it must have context store marker interface.
assertThat(runnable).isInstanceOf(VirtualFieldInstalledMarker.class);
assertThat(VirtualFieldInstalledMarker.class.isAssignableFrom(Runnable.class)).isFalse();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.internal.lambda;

public class TestLambda {

static Runnable makeRunnable() {
Expand Down

0 comments on commit 98976e9

Please sign in to comment.