Skip to content

Commit

Permalink
Fix checkstyle (in tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-xdev committed Jun 12, 2024
1 parent bf95365 commit b7afcde
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,186 +46,174 @@ public void defaults(final RecipeSpec recipeSpec)
@Test
void testSimpleSingle()
{
this.rewriteRun
(
java
(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
this.rewriteRun(
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
}

@Test
void testSimpleMultiple()
{
this.rewriteRun
(
java
(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
),
java
(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class B
{
public B()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class B
{
public B()
{
}
}
"""
)
);
this.rewriteRun(
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
),
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class B
{
public B()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class B
{
public B()
{
}
}
"""
)
);
}

@Test
void testAlreadyAdded()
{
this.rewriteRun
(
java
(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
this.rewriteRun(
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
}

@Test
void testSimpleNoAnnotation()
{
this.rewriteRun
(
java
(
"""
class A
{
public A()
{
}
}
"""
)
);
this.rewriteRun(
java(
"""
class A
{
public A()
{
}
}
"""
)
);
}

@Test
void testSimpleNoAnnotationAndAnnotation()
{
this.rewriteRun
(
java
(
"""
class B
{
public B()
{
}
}
"""
),
java
(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
this.rewriteRun(
java(
"""
class B
{
public B()
{
}
}
"""
),
java(
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
class A
{
public A()
{
}
}
""",
"""
import org.springframework.boot.autoconfigure.SpringBootApplication;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
@EnableEclipseStoreRepositories
@SpringBootApplication
class A
{
public A()
{
}
}
"""
)
);
}
}
Loading

0 comments on commit b7afcde

Please sign in to comment.