-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #987 from pascalgrimaud/refactoring-github-actions
Refactoring GitHub Actions
- Loading branch information
Showing
18 changed files
with
131 additions
and
125 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...hipster/lite/generator/ci/github/actions/application/GitHubActionsApplicationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package tech.jhipster.lite.generator.ci.github.actions.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.ci.github.actions.domain.GitHubActionsService; | ||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
@Service | ||
public class GitHubActionsApplicationService { | ||
|
||
private final GitHubActionsService gitHubActionsService; | ||
|
||
public GitHubActionsApplicationService(GitHubActionsService gitHubActionsService) { | ||
this.gitHubActionsService = gitHubActionsService; | ||
} | ||
|
||
public void addGitHubActionsForMaven(Project project) { | ||
gitHubActionsService.addGitHubActionsForMaven(project); | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...ns/domain/GithubActionsDomainService.java → ...ns/domain/GitHubActionsDomainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...bactions/domain/GithubActionsService.java → .../actions/domain/GitHubActionsService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package tech.jhipster.lite.generator.githubactions.domain; | ||
package tech.jhipster.lite.generator.ci.github.actions.domain; | ||
|
||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
public interface GithubActionsService { | ||
public interface GitHubActionsService { | ||
void addGitHubActionsForMaven(Project project); | ||
} |
22 changes: 22 additions & 0 deletions
22
...ite/generator/ci/github/actions/infrastructure/config/GitHubActionsBeanConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package tech.jhipster.lite.generator.ci.github.actions.infrastructure.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.ci.github.actions.domain.GitHubActionsDomainService; | ||
import tech.jhipster.lite.generator.ci.github.actions.domain.GitHubActionsService; | ||
import tech.jhipster.lite.generator.project.domain.ProjectRepository; | ||
|
||
@Configuration | ||
public class GitHubActionsBeanConfiguration { | ||
|
||
private final ProjectRepository projectRepository; | ||
|
||
public GitHubActionsBeanConfiguration(ProjectRepository projectRepository) { | ||
this.projectRepository = projectRepository; | ||
} | ||
|
||
@Bean | ||
public GitHubActionsService gitHubActionsService() { | ||
return new GitHubActionsDomainService(projectRepository); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/java/tech/jhipster/lite/generator/ci/github/actions/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@tech.jhipster.lite.BusinessContext | ||
package tech.jhipster.lite.generator.ci.github.actions; |
19 changes: 0 additions & 19 deletions
19
...ch/jhipster/lite/generator/githubactions/application/GithubActionsApplicationService.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...er/lite/generator/githubactions/infrastructure/config/GithubActionsBeanConfiguration.java
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
src/main/java/tech/jhipster/lite/generator/githubactions/package-info.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
...pster/lite/generator/ci/github/actions/application/GitHubActionsApplicationServiceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package tech.jhipster.lite.generator.ci.github.actions.application; | ||
|
||
import static tech.jhipster.lite.TestUtils.tmpProject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import tech.jhipster.lite.IntegrationTest; | ||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
@IntegrationTest | ||
class GitHubActionsApplicationServiceIT { | ||
|
||
@Autowired | ||
GitHubActionsApplicationService gitHubActionsApplicationService; | ||
|
||
@Test | ||
void shouldAddGitHubActionsForMaven() { | ||
Project project = tmpProject(); | ||
|
||
gitHubActionsApplicationService.addGitHubActionsForMaven(project); | ||
|
||
GitHubActionsAssertFiles.assertFilesYml(project); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...application/GithubActionsAssertFiles.java → ...application/GitHubActionsAssertFiles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package tech.jhipster.lite.generator.githubactions.application; | ||
package tech.jhipster.lite.generator.ci.github.actions.application; | ||
|
||
import static tech.jhipster.lite.TestUtils.assertFileExist; | ||
|
||
import tech.jhipster.lite.generator.project.domain.Project; | ||
|
||
public class GithubActionsAssertFiles { | ||
public class GitHubActionsAssertFiles { | ||
|
||
public static void assertFilesYml(Project project) { | ||
assertFileExist(project, ".github/workflows/github-actions.yml"); | ||
assertFileExist(project, ".github/actions/setup/action.yml"); | ||
} | ||
|
||
public static void assertFilesGithubActions(Project project) { | ||
public static void assertFilesGitHubActions(Project project) { | ||
assertFilesYml(project); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...e/generator/ci/github/actions/infrastructure/config/GitHubActionsBeanConfigurationIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package tech.jhipster.lite.generator.ci.github.actions.infrastructure.config; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.ApplicationContext; | ||
import tech.jhipster.lite.IntegrationTest; | ||
import tech.jhipster.lite.generator.ci.github.actions.domain.GitHubActionsDomainService; | ||
|
||
@IntegrationTest | ||
class GitHubActionsBeanConfigurationIT { | ||
|
||
@Autowired | ||
ApplicationContext applicationContext; | ||
|
||
@Test | ||
void shouldGetBean() { | ||
assertThat(applicationContext.getBean("gitHubActionsService")).isNotNull().isInstanceOf(GitHubActionsDomainService.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
.../jhipster/lite/generator/githubactions/application/GithubActionsApplicationServiceIT.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
.../lite/generator/githubactions/infrastructure/config/GithubActionsBeanConfigurationIT.java
This file was deleted.
Oops, something went wrong.