Skip to content

Commit

Permalink
remove GuiceInjectionExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
ztai-add committed Aug 13, 2024
1 parent 2aad806 commit b5417d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions scripts/testng-junit/src/testng2junit5.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ def migrate_imports(content):
# refer to migrate_guice_annotation
if '@Guice' in content_new and '@BeforeAll' not in content_new:
imports.append('import org.junit.jupiter.api.BeforeAll;')
imports.append('import org.junit.jupiter.api.extension.ExtendWith;')
imports.append('import com.addepar.infra.library.testing.extention.GuiceInjectionExtension;')

content_new = re.sub('org.junit.jupiter.api.Test;', '\n'.join(imports), content_new)

Expand Down Expand Up @@ -417,7 +415,6 @@ def migrate_guice_annotation(content):
or 'public abstract class' in line):
left_spaces = ' ' * (len(line) - len(line.lstrip()))
new_content.append(left_spaces + '@TestInstance(Lifecycle.PER_CLASS)')
new_content.append(left_spaces + '@ExtendWith(GuiceInjectionExtension.class)')
new_content.append(line)

if '{' in line:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
expected_1 = """
@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(GuiceInjectionExtension.class)
public class SomeTest {
private final Injector injector = Guice.createInjector(new SomeModule());
Expand Down Expand Up @@ -46,7 +45,6 @@
expected_2 = """
@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(GuiceInjectionExtension.class)
public class SomeTest {
private final Injector injector = Guice.createInjector();
Expand Down Expand Up @@ -75,7 +73,6 @@
expected_3 = """
@TestInstance(Lifecycle.PER_CLASS)
@ExtendWith(GuiceInjectionExtension.class)
public class SomeTest {
private final Injector injector = Guice.createInjector(new TestModuleA(), new Test.ModuleB());
Expand Down

0 comments on commit b5417d9

Please sign in to comment.