Skip to content

Commit

Permalink
Merge pull request #2131 from marioneyraud/front-ehcache-xml-button
Browse files Browse the repository at this point in the history
Front : add Ehcache with XML config button
  • Loading branch information
pascalgrimaud authored Jun 16, 2022
2 parents 0f03004 + ddfbe22 commit b6faf90
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 161 deletions.
1 change: 1 addition & 0 deletions src/main/webapp/app/common/domain/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Service {
DEV_TOOLS = 'DEV_TOOLS',
DOCKERFILE = 'DOCKERFILE',
DOWNLOAD = 'DOWNLOAD',
EHCACHE_WITH_XML_CONFIG = 'EHCACHE_WITH_XML_CONFIG',
EUREKA_CLIENT = 'EUREKA_CLIENT',
FLYWAY = 'FLYWAY',
FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS = 'FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS',
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/app/common/secondary/RestServiceId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const SERVICES: Record<string, Service> = {
dockerfile: Service.DOCKERFILE,
download: Service.DOWNLOAD,
'eureka-client': Service.EUREKA_CLIENT,
'ehcache-with-xml-config': Service.EHCACHE_WITH_XML_CONFIG,
flyway: Service.FLYWAY,
'flyway-user-and-authority-changelogs': Service.FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS,
'frontend-maven-plugin': Service.FRONTEND_MAVEN_PLUGIN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type ServiceProjection =
| 'dev-tools'
| 'dockerfile'
| 'download'
| 'ehcache-with-xml-config'
| 'eureka-client'
| 'initialization'
| 'flyway'
Expand Down Expand Up @@ -65,6 +66,7 @@ const SERVICES_PROJECTION: Record<Service, ServiceProjection> = {
[Service.DEV_TOOLS]: 'dev-tools',
[Service.DOCKERFILE]: 'dockerfile',
[Service.DOWNLOAD]: 'download',
[Service.EHCACHE_WITH_XML_CONFIG]: 'ehcache-with-xml-config',
[Service.EUREKA_CLIENT]: 'eureka-client',
[Service.FLYWAY]: 'flyway',
[Service.FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS]: 'flyway-with-users-and-authority-changelogs',
Expand Down Expand Up @@ -123,6 +125,7 @@ const SERVICES: Record<ServiceProjection, Service> = {
'dev-tools': Service.DEV_TOOLS,
dockerfile: Service.DOCKERFILE,
download: Service.DOWNLOAD,
'ehcache-with-xml-config': Service.EHCACHE_WITH_XML_CONFIG,
'eureka-client': Service.EUREKA_CLIENT,
flyway: Service.FLYWAY,
'flyway-with-users-and-authority-changelogs': Service.FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,15 @@ export default defineComponent({
}
};

const addEhcacheWithXml = async (): Promise<void> => {
if (props.project.folder !== '') {
await springBootService
.addEhcacheWithXML(toProject(props.project as ProjectToUpdate))
.then(() => alertBus.success('Ehcache with XML successfully added'))
.catch(error => alertBus.error(`Adding Ehcache with XML to project failed ${error}`));
}
};

return {
selectorPrefix,
addSpringBoot,
Expand Down Expand Up @@ -377,6 +386,7 @@ export default defineComponent({
addKafka,
addKafkaDummyProducerConsumer,
addKafkaAkhq,
addEhcacheWithXml,
};
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@
@click.prevent="addKafkaAkhq"
/>
</div>
<div>
<GeneratorButtonVue
:label="'Ehcache with XML config'"
:service="'ehcache-with-xml-config'"
:selector-prefix="selectorPrefix"
@click.prevent="addEhcacheWithXml"
/>
</div>
<div>
<GeneratorButtonVue
:label="'Cucumber'"
Expand Down
1 change: 1 addition & 0 deletions src/test/javascript/cypress/integration/Generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe('Generator', () => {
'Dummy Producer and Consumer for Kafka'
);
cy.get(springBootGeneratorSelector('add-spring-boot-kafka-akhq-button')).contains('AKHQ for Kafka');
cy.get(springBootGeneratorSelector('add-ehcache-with-xml-config-button')).contains('Ehcache with XML config');
cy.get(springBootGeneratorSelector('add-spring-boot-cucumber-button')).contains('Cucumber');

cy.get(springBootGeneratorSelector('add-spring-boot-dummy-feature-button')).contains('Dummy feature');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('RestServiceId', () => {
expect(toService('dev-tools')).toEqual<Service>(Service.DEV_TOOLS);
expect(toService('dockerfile')).toEqual<Service>(Service.DOCKERFILE);
expect(toService('download')).toEqual<Service>(Service.DOWNLOAD);
expect(toService('ehcache-with-xml-config')).toEqual<Service>(Service.EHCACHE_WITH_XML_CONFIG);
expect(toService('eureka-client')).toEqual<Service>(Service.EUREKA_CLIENT);
expect(toService('flyway')).toEqual<Service>(Service.FLYWAY);
expect(toService('flyway-user-and-authority-changelogs')).toEqual<Service>(Service.FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('ServiceProjection', () => {
expect(toServiceProjection(Service.CONSUL)).toEqual<ServiceProjection>('consul');
expect(toServiceProjection(Service.DEV_TOOLS)).toEqual<ServiceProjection>('dev-tools');
expect(toServiceProjection(Service.DOWNLOAD)).toEqual<ServiceProjection>('download');
expect(toServiceProjection(Service.EHCACHE_WITH_XML_CONFIG)).toEqual<ServiceProjection>('ehcache-with-xml-config');
expect(toServiceProjection(Service.EUREKA_CLIENT)).toEqual<ServiceProjection>('eureka-client');
expect(toServiceProjection(Service.FLYWAY)).toEqual<ServiceProjection>('flyway');
expect(toServiceProjection(Service.FLYWAY_WITH_USERS_AND_AUTHORITY_CHANGELOGS)).toEqual<ServiceProjection>(
Expand Down Expand Up @@ -77,6 +78,7 @@ describe('ServiceProjection', () => {
expect(fromServiceProjection('dev-tools')).toEqual<Service>(Service.DEV_TOOLS);
expect(fromServiceProjection('dockerfile')).toEqual<Service>(Service.DOCKERFILE);
expect(fromServiceProjection('download')).toEqual<Service>(Service.DOWNLOAD);
expect(fromServiceProjection('ehcache-with-xml-config')).toEqual<Service>(Service.EHCACHE_WITH_XML_CONFIG);
expect(fromServiceProjection('eureka-client')).toEqual<Service>(Service.EUREKA_CLIENT);
expect(fromServiceProjection('flyway')).toEqual<Service>(Service.FLYWAY);
expect(fromServiceProjection('flyway-with-users-and-authority-changelogs')).toEqual<Service>(
Expand Down
Loading

0 comments on commit b6faf90

Please sign in to comment.