Skip to content

Commit

Permalink
Add cucumber tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFran committed Jul 6, 2022
1 parent ebf205d commit 778ad9e
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package tech.jhipster.lite.generator.server.springboot.database.mssql.application;

import org.springframework.stereotype.Service;
import tech.jhipster.lite.generator.project.domain.Project;
import tech.jhipster.lite.generator.server.springboot.database.mssql.domain.MssqlService;
import tech.jhipster.lite.docker.domain.DockerImages;
import tech.jhipster.lite.generator.server.springboot.database.mssql.domain.MsSQLModuleFactory;
import tech.jhipster.lite.module.domain.JHipsterModule;
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;

@Service
public class MssqlApplicationService {
public class MsSQLApplicationService {

private final MssqlService mssqlService;
private final MsSQLModuleFactory factory;

public MssqlApplicationService(MssqlService mssqlService) {
this.mssqlService = mssqlService;
public MsSQLApplicationService(DockerImages dockerImages) {
factory = new MsSQLModuleFactory(dockerImages);
}

public void init(Project project) {
mssqlService.init(project);
public JHipsterModule build(JHipsterModuleProperties properties) {
return factory.buildModule(properties);
}
}
54 changes: 54 additions & 0 deletions src/test/features/mssql.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Feature: mssql module

Scenario: Should add MsSQL elements using legacy url
When I apply legacy modules to default project
| /api/build-tools/maven |
| /api/servers/spring-boot |
| /api/servers/spring-boot/databases/mssql |
Then I should have files in ""
| pom.xml |
And I should have history entry for "mssql"
And I should have files in "documentation"
| mssql.md |
And I should have files in "src/main/docker"
| mssql.yml |
And I should have files in "src/main/java/tech/jhipster/chips/technical/infrastructure/secondary/mssql"
| DatabaseConfiguration.java |
And I should have files in "src/test/java/tech/jhipster/chips/technical/infrastructure/secondary/mssql"
| MsSQLTestContainerExtension.java |
And I should have files in "src/test/resources"
| container-license-acceptance.txt |
And I should have files in "src/main/resources/config"
| application.properties |
And I should have files in "src/test/resources/config"
| application.properties |

Scenario: Should get MsSQL module properties definition
When I get module "mssql" properties definition
Then I should have properties definitions
| Key | Type | Mandatory |
| packageName | STRING | true |
| baseName | STRING | true |
| prettierDefaultIndent | INTEGER | false |

Scenario: Should add MsSQL elements using module url
When I apply "mssql" module to default project with maven file
| packageName | tech.jhipster.chips |
| baseName | jhipster |
Then I should have files in ""
| pom.xml |
And I should have history entry for "mssql"
And I should have files in "documentation"
| mssql.md |
And I should have files in "src/main/docker"
| mssql.yml |
And I should have files in "src/main/java/tech/jhipster/chips/technical/infrastructure/secondary/mssql"
| DatabaseConfiguration.java |
And I should have files in "src/test/java/tech/jhipster/chips/technical/infrastructure/secondary/mssql"
| MsSQLTestContainerExtension.java |
And I should have files in "src/test/resources"
| container-license-acceptance.txt |
And I should have files in "src/main/resources/config"
| application.properties |
And I should have files in "src/test/resources/config"
| application.properties |

0 comments on commit 778ad9e

Please sign in to comment.