Skip to content

Commit

Permalink
Refactoring: rename Nested class
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalgrimaud committed Dec 15, 2021
1 parent abda6e3 commit df718a8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 27 deletions.
9 changes: 7 additions & 2 deletions src/test/java/tech/jhipster/lite/AnnotationArchTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import com.tngtech.archunit.lang.ArchRule;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

@UnitTest
Expand All @@ -25,7 +26,9 @@ void shouldHaveUnitTestAnnotation() {
.and()
.haveSimpleNameEndingWith("Test")
.should()
.beAnnotatedWith(UnitTest.class);
.beAnnotatedWith(UnitTest.class)
.orShould()
.beAnnotatedWith(Nested.class);

rule.check(importedClasses);
}
Expand All @@ -40,7 +43,9 @@ void shouldHaveIntegrationTestAnnotation() {
.and()
.haveSimpleNameEndingWith("IT")
.should()
.beAnnotatedWith(IntegrationTest.class);
.beAnnotatedWith(IntegrationTest.class)
.orShould()
.beAnnotatedWith(Nested.class);

rule.check(importedClasses);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class FileUtilsTest {

@Nested
class Exists {
class ExistsTest {

@Test
void shouldExists() {
Expand All @@ -52,7 +52,7 @@ void shouldNotExistsForBlank() {
}

@Nested
class CreateFolder {
class CreateFolderTest {

@Test
void shouldNotCreateFolderForNull() {
Expand Down Expand Up @@ -96,7 +96,7 @@ void shouldNotCreateFolderWhenItsAFile() throws Exception {
}

@Nested
class GetPath {
class GetPathTest {

@Test
void shouldGetPath() {
Expand Down Expand Up @@ -140,7 +140,7 @@ void shouldNotGetInputStream() {
}

@Nested
class Read {
class ReadTest {

@Test
void shouldRead() throws Exception {
Expand Down Expand Up @@ -169,7 +169,7 @@ void shouldNotReadWhenFileNotExist() {
}

@Nested
class GetLine {
class GetLineTest {

@Test
void shouldGetLine() throws Exception {
Expand Down Expand Up @@ -202,7 +202,7 @@ void shouldNotGetLineWhenFileNotExist() {
}

@Nested
class ContainsInLine {
class ContainsInLineTest {

@Test
void shouldContainsInLine() {
Expand All @@ -227,7 +227,7 @@ void shouldNotContainsInLineWhenFilenameNotExist() {
}

@Nested
class ContainsLines {
class ContainsLinesTest {

@Test
void shouldContainsLinesSingle() {
Expand Down Expand Up @@ -300,7 +300,7 @@ void shouldNotContainsLinesWithEmptyLines() {
}

@Nested
class Replace {
class ReplaceTest {

@Test
void shouldReplaceInFile() throws Exception {
Expand Down Expand Up @@ -330,7 +330,7 @@ void shouldNotReplaceInFileWhenFileNotExist() {
}

@Nested
class FileSystem {
class FileSystemTest {

@Test
@EnabledOnOs(OS.WINDOWS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class WordUtilsTest {

@Nested
class KebabCase {
class KebabCaseTest {

@Test
void shouldKebabCase() {
Expand Down Expand Up @@ -41,7 +41,7 @@ void shouldNotKebabForBlank() {
}

@Nested
class UpperFirst {
class UpperFirstTest {

@Test
void shouldUpperFirst() {
Expand Down Expand Up @@ -70,7 +70,7 @@ void shouldNotUpperFirstWithBlank() {
}

@Nested
class Indent {
class IndentTest {

@Test
void shouldIndent1Time() {
Expand Down Expand Up @@ -99,7 +99,7 @@ void shouldNotIndentWithZero() {
}

@Nested
class IdentWithSpace {
class IdentWithSpaceTest {

@Test
void shouldIndent1TimeWith4spaces() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BuildToolDomainServiceTest {
BuildToolDomainService buildToolDomainService;

@Nested
class Maven {
class MavenTest {

@Test
void shouldAddParent() {
Expand Down Expand Up @@ -100,7 +100,7 @@ void shouldInitWihoutExistingPomXml() {
}

@Nested
class Gradle {
class GradleTest {

@Test
void shouldNotInit() {
Expand All @@ -118,7 +118,7 @@ void shouldNotInitWithExistingGradle() {
}

@Nested
class NoBuildTool {
class NoBuildToolTest {

@Test
void shouldNotAddParent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class ProjectTest {

@Nested
class Build {
class BuildTest {

@Test
void shouldBuildMinimalProject() {
Expand Down Expand Up @@ -87,7 +87,7 @@ void shouldNotBuildWithBlankPath() {
}

@Nested
class GetConfig {
class GetConfigTest {

@Test
void shouldGetConfig() {
Expand All @@ -103,7 +103,7 @@ void shouldGetConfig() {
}

@Nested
class AddConfig {
class AddConfigTest {

@Test
void shouldAddConfigInEmptyConfig() {
Expand Down Expand Up @@ -178,7 +178,7 @@ void shouldNotAddDefaultConfig() {
}

@Nested
class PackageName {
class PackageNameTest {

@Test
void shouldGetPackageName() {
Expand Down Expand Up @@ -214,7 +214,7 @@ void shouldNotGetPackageNamePathForDefault() {
}

@Nested
class GetStringConfig {
class GetStringConfigTest {

@Test
void shouldGetStringConfig() {
Expand Down Expand Up @@ -245,7 +245,7 @@ void shouldNotGetStringConfig() {
}

@Nested
class GetIntegerConfig {
class GetIntegerConfigTest {

@Test
void shouldGetIntegerConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SpringBootPropertiesApplicationServiceIT {
SpringBootPropertiesApplicationService service;

@Nested
class Properties {
class PropertiesIT {

@Test
void shouldNotAddProperties() {
Expand Down Expand Up @@ -72,7 +72,7 @@ void shouldNotAddPropertiesWhenNoApplicationProperties() {
}

@Nested
class FastProperties {
class FastPropertiesIT {

@Test
void shouldNotAddPropertiesFast() {
Expand Down Expand Up @@ -125,7 +125,7 @@ void shouldNotAddPropertiesFastWhenNoApplicationProperties() {
}

@Nested
class TestProperties {
class TestPropertiesIT {

@Test
void shouldNotAddPropertiesTest() {
Expand Down

0 comments on commit df718a8

Please sign in to comment.