Skip to content

Commit

Permalink
refactor by renaming feature slug and cucumber feature and classes to…
Browse files Browse the repository at this point in the history
… prefix FrontEndJavaBuildTool
  • Loading branch information
renanfranca committed May 18, 2024
1 parent 012b73d commit 31f7558
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package tech.jhipster.lite.generator.server.javatool.frontendmaven.application;

import org.springframework.stereotype.Service;
import tech.jhipster.lite.generator.server.javatool.frontendmaven.domain.FrontendServerModuleFactory;
import tech.jhipster.lite.generator.server.javatool.frontendmaven.domain.FrontendJavaBuildToolModuleFactory;
import tech.jhipster.lite.module.domain.JHipsterModule;
import tech.jhipster.lite.module.domain.npm.NpmVersions;
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;

@Service
public class FrontendServerApplicationService {
public class FrontendJavaBuildToolApplicationService {

private final FrontendServerModuleFactory factory;
private final FrontendJavaBuildToolModuleFactory factory;

public FrontendServerApplicationService(NpmVersions npmVersions) {
factory = new FrontendServerModuleFactory(npmVersions);
public FrontendJavaBuildToolApplicationService(NpmVersions npmVersions) {
factory = new FrontendJavaBuildToolModuleFactory(npmVersions);
}

public JHipsterModule buildFrontendMavenModule(JHipsterModuleProperties properties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;
import tech.jhipster.lite.shared.error.domain.Assert;

public class FrontendServerModuleFactory {
public class FrontendJavaBuildToolModuleFactory {

private static final String PACKAGE_INFO = "package-info.java";

Expand All @@ -24,7 +24,7 @@ public class FrontendServerModuleFactory {

private final NpmVersions npmVersions;

public FrontendServerModuleFactory(NpmVersions npmVersions) {
public FrontendJavaBuildToolModuleFactory(NpmVersions npmVersions) {
this.npmVersions = npmVersions;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,47 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tech.jhipster.lite.generator.server.javatool.frontendmaven.application.FrontendServerApplicationService;
import tech.jhipster.lite.generator.server.javatool.frontendmaven.application.FrontendJavaBuildToolApplicationService;
import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization;
import tech.jhipster.lite.module.domain.resource.JHipsterModulePropertiesDefinition;
import tech.jhipster.lite.module.domain.resource.JHipsterModuleResource;

@Configuration
class FrontendServerModuleConfiguration {
class FrontendJavaBuildToolModuleConfiguration {

@Bean
JHipsterModuleResource frontendMavenModule(FrontendServerApplicationService frontendServer) {
JHipsterModuleResource frontendMavenModule(FrontendJavaBuildToolApplicationService frontendJavaBuildTool) {
return JHipsterModuleResource.builder()
.slug(FRONTEND_MAVEN_PLUGIN)
.propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build())
.apiDoc("Frontend Maven Plugin", "Add Frontend Maven Plugin")
.organization(
JHipsterModuleOrganization.builder()
.feature(FRONTEND_SERVER_PLUGIN)
.feature(FRONTEND_JAVA_BUILD_TOOL_PLUGIN)
.addDependency(SPRING_SERVER)
.addDependency(CLIENT_CORE)
.addDependency(MAVEN_JAVA)
.build()
)
.tags("server", "tools")
.factory(frontendServer::buildFrontendMavenModule);
.factory(frontendJavaBuildTool::buildFrontendMavenModule);
}

@Bean
JHipsterModuleResource frontendGradleModule(FrontendServerApplicationService frontendServer) {
JHipsterModuleResource frontendGradleModule(FrontendJavaBuildToolApplicationService frontendJavaBuildTool) {
return JHipsterModuleResource.builder()
.slug(NODE_GRADLE_PLUGIN)
.propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build())
.apiDoc("Frontend Gradle Plugin", "Add node-gradle plugin for building frontend with Gradle")
.organization(
JHipsterModuleOrganization.builder()
.feature(FRONTEND_SERVER_PLUGIN)
.feature(FRONTEND_JAVA_BUILD_TOOL_PLUGIN)
.addDependency(SPRING_SERVER)
.addDependency(CLIENT_CORE)
.addDependency(GRADLE_JAVA)
.build()
)
.tags("server", "tools")
.factory(frontendServer::buildFrontendGradleModule);
.factory(frontendJavaBuildTool::buildFrontendGradleModule);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public enum JHLiteFeatureSlug implements JHipsterFeatureSlugFactory {
DATABASE_MIGRATION("database-migration"),
DOCKERFILE("dockerfile"),
FRONT_BROWSER_TEST("front-browser-test"),
FRONTEND_SERVER_PLUGIN("frontend-server-plugin"),
FRONTEND_JAVA_BUILD_TOOL_PLUGIN("frontend-java-build-tool-plugin"),
GITHUB_ACTIONS("github-actions"),
GITLAB_CI("gitlab-ci"),
DEPENDENCIES_UPDATES("dependencies-updates"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

@UnitTest
@ExtendWith(MockitoExtension.class)
class FrontendServerModuleFactoryTest {
class FrontendJavaBuildToolModuleFactoryTest {

@Mock
private NpmVersions npmVersions;

@InjectMocks
private FrontendServerModuleFactory factory;
private FrontendJavaBuildToolModuleFactory factory;

@Test
void shouldBuildFrontendMavenModule() {
Expand Down

0 comments on commit 31f7558

Please sign in to comment.