diff --git a/generators/app/__snapshots__/generator.spec.ts.snap b/generators/app/__snapshots__/generator.spec.ts.snap
index 2024c36b9d05..cb85adff6c4c 100644
--- a/generators/app/__snapshots__/generator.spec.ts.snap
+++ b/generators/app/__snapshots__/generator.spec.ts.snap
@@ -450,6 +450,7 @@ exports[`generator - app with default config should match snapshot 1`] = `
"fakerSeed": undefined,
"feignClient": undefined,
"frontendAppName": "jhipsterApp",
+ "gatewayRoutes": undefined,
"gatewayServerPort": undefined,
"gatlingTests": false,
"generateAuthenticationApi": true,
@@ -1044,6 +1045,7 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"fakerSeed": undefined,
"feignClient": undefined,
"frontendAppName": "jhipsterApp",
+ "gatewayRoutes": [],
"gatewayServerPort": undefined,
"gatlingTests": false,
"generateAuthenticationApi": true,
@@ -1327,6 +1329,7 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"projectVersion": "0.0.1-SNAPSHOT",
"reactive": true,
"rememberMeKey": undefined,
+ "routes": undefined,
"searchEngine": "no",
"searchEngineAny": false,
"searchEngineCouchbase": false,
@@ -1632,6 +1635,7 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"fakerSeed": undefined,
"feignClient": undefined,
"frontendAppName": "jhipsterApp",
+ "gatewayRoutes": undefined,
"gatewayServerPort": undefined,
"gatlingTests": false,
"generateAuthenticationApi": false,
diff --git a/generators/bootstrap-application-server/generator.ts b/generators/bootstrap-application-server/generator.ts
index 66b61be0e8b2..1d525fbb5c24 100644
--- a/generators/bootstrap-application-server/generator.ts
+++ b/generators/bootstrap-application-server/generator.ts
@@ -105,6 +105,7 @@ export default class BoostrapApplicationServer extends BaseApplicationGenerator
...applicationDockerContainers,
...currentDockerContainers,
}),
+ gatewayRoutes: undefined,
});
},
});
diff --git a/generators/server/jdl/application-definition.ts b/generators/server/jdl/application-definition.ts
index 389bf15de240..b5990d68d407 100644
--- a/generators/server/jdl/application-definition.ts
+++ b/generators/server/jdl/application-definition.ts
@@ -21,12 +21,14 @@ import { JDLApplicationConfig, JHipsterOptionDefinition } from '../../../jdl/typ
import databaseMigrationOption from '../options/database-migration.js';
import messageBrokerOption from '../options/message-broker.js';
import { feignClientDefinition, syncUserWithIdpDefinition } from '../options/index.js';
+import { jdlRoutesOptions } from '../../spring-cloud/generators/gateway/jdl/jdl-routes-option.js';
const jdlOptions: JHipsterOptionDefinition[] = [
databaseMigrationOption,
messageBrokerOption,
feignClientDefinition,
syncUserWithIdpDefinition,
+ jdlRoutesOptions,
];
const applicationConfig: JDLApplicationConfig = {
diff --git a/generators/server/templates/build.gradle.ejs b/generators/server/templates/build.gradle.ejs
index 928002f35b0f..7fc694e7cf18 100644
--- a/generators/server/templates/build.gradle.ejs
+++ b/generators/server/templates/build.gradle.ejs
@@ -237,6 +237,9 @@ if (addSpringMilestoneRepository) { _%>
<%_ if (serviceDiscoveryAny && serviceDiscoveryEureka) { _%>
implementation "org.springframework.cloud:spring-cloud-starter-config"
<%_ } _%>
+<%_ if (applicationTypeGateway && !reactive) { _%>
+ implementation "org.springframework.cloud:spring-cloud-starter-loadbalancer"
+<%_ } _%>
<%_ if (serviceDiscoveryAny && serviceDiscoveryConsul) { _%>
implementation "org.springframework.cloud:spring-cloud-starter-consul-config"
<%_ } _%>
diff --git a/generators/server/templates/pom.xml.ejs b/generators/server/templates/pom.xml.ejs
index db1b5a4b98fb..648ce97e1b9c 100644
--- a/generators/server/templates/pom.xml.ejs
+++ b/generators/server/templates/pom.xml.ejs
@@ -282,6 +282,12 @@
spring-cloud-starter-config
<%_ } _%>
+<%_ if (applicationTypeGateway && !reactive) { _%>
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+<%_ } _%>
<%_ if (serviceDiscoveryAny && serviceDiscoveryConsul) { _%>
org.springframework.cloud
diff --git a/generators/server/templates/src/main/resources/config/application.yml.ejs b/generators/server/templates/src/main/resources/config/application.yml.ejs
index 5ebc7c1867fa..65384a39577b 100644
--- a/generators/server/templates/src/main/resources/config/application.yml.ejs
+++ b/generators/server/templates/src/main/resources/config/application.yml.ejs
@@ -188,6 +188,22 @@ spring:
enabled: false
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>
+ <%_ if (!serviceDiscoveryAny) { _%>
+ discovery:
+ client:
+ simple:
+ instances:
+ <%= lowercaseBaseName %>:
+ - instanceId: <%= lowercaseBaseName %>1
+ host: localhost
+ port: <%= serverPort %>
+ <%_ for (const ms of gatewayRoutes ?? []) { _%>
+ <%= ms.route %>:
+ - instanceId: <%= ms.route %>1
+ host: <%= ms.host %>
+ port: <%= ms.serverPort %>
+ <%_ } _%>
+ <%_ } _%>
gateway:
<%_ if (reactive) { _%>
default-filters:
@@ -212,11 +228,22 @@ spring:
mvc:
routes:
- id: <%= lowercaseBaseName %>_route
- uri: lb://<%= lowercaseBaseName %>:<%= serverPort %>
+ uri: lb://<%= lowercaseBaseName %>
predicates:
- Path=/services/<%= lowercaseBaseName %>/**
filters:
- - RewritePath=/services/<%= lowercaseBaseName %>/?(?.*), /$\{segment}
+ - StripPrefix=2
+ <%_ for (const ms of gatewayRoutes ?? []) { _%>
+ - id: <%= ms.route %>_route
+ uri: lb://<%= ms.route %>
+ predicates:
+ - Path=/services/<%= ms.route %>/**
+ filters:
+ - StripPrefix=2
+ <%_ if (authenticationTypeOauth2) { _%>
+ - TokenRelay
+ <%_ } _%>
+ <%_ } _%>
<%_ } _%>
<%_ } _%>
<%_ if (messageBrokerKafka) { _%>
diff --git a/generators/server/types.d.ts b/generators/server/types.d.ts
index 779e007aa3cd..49102cd01c57 100644
--- a/generators/server/types.d.ts
+++ b/generators/server/types.d.ts
@@ -6,6 +6,7 @@ import { SpringCacheSourceType } from '../spring-cache/types.js';
import { MessageBrokerApplicationType } from './options/message-broker.js';
import type { DeterministicOptionWithDerivedProperties, OptionWithDerivedProperties } from '../base-application/application-options.js';
import { ApplicationPropertiesNeedles } from './support/needles.ts';
+import { GatewayApplication } from '../spring-cloud/generators/gateway/types.ts';
export type SpringEntity = {
/* Generate entity's Entity */
@@ -91,6 +92,7 @@ export type SpringBootApplication = JavaApplication &
BuildToolApplication &
SearchEngine &
DatabaseTypeApplication &
+ GatewayApplication &
MessageBrokerApplicationType & {
jhipsterDependenciesVersion: string;
springBootDependencies: Record;
diff --git a/generators/spring-cloud/generators/gateway/command.ts b/generators/spring-cloud/generators/gateway/command.ts
index 7d3ac0741f15..fe25d7551fab 100644
--- a/generators/spring-cloud/generators/gateway/command.ts
+++ b/generators/spring-cloud/generators/gateway/command.ts
@@ -19,7 +19,11 @@
import type { JHipsterCommandDefinition } from '../../../base/api.js';
const command: JHipsterCommandDefinition = {
- configs: {},
+ configs: {
+ routes: {
+ scope: 'storage',
+ },
+ },
import: [],
};
diff --git a/generators/spring-cloud/generators/gateway/generator.ts b/generators/spring-cloud/generators/gateway/generator.ts
index ad239400ecb6..e393f486230d 100644
--- a/generators/spring-cloud/generators/gateway/generator.ts
+++ b/generators/spring-cloud/generators/gateway/generator.ts
@@ -89,6 +89,21 @@ export default class GatewayGenerator extends BaseApplicationGenerator {
return this.delegateTasksToBlueprint(() => this.loading);
}
+ get preparing() {
+ return this.asPreparingTaskGroup({
+ prepareGateway({ application }) {
+ application.gatewayRoutes = (application.routes ?? []).map(routeDef => {
+ const [route, host = route, serverPort = '8080'] = routeDef.split(':');
+ return { route, serverPort, host };
+ });
+ },
+ });
+ }
+
+ get [BaseApplicationGenerator.PREPARING]() {
+ return this.delegateTasksToBlueprint(() => this.preparing);
+ }
+
get writing() {
return this.asWritingTaskGroup({
async writing({ application }) {
diff --git a/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.spec.ts b/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.spec.ts
new file mode 100644
index 000000000000..1709e34bd669
--- /dev/null
+++ b/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.spec.ts
@@ -0,0 +1,75 @@
+import { before, it, describe, expect } from 'esmocha';
+import { createImporterFromContent, ImportState } from '../../../../../jdl/jdl-importer.js';
+import { convertSingleContentToJDL } from '../../../../../jdl/converters/json-to-jdl-converter.js';
+
+const optionName = 'routes';
+
+describe('generators - spring-cloud:gateway - jdl', () => {
+ it('should not accept route and port', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} ["blog:123"] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ it('should not accept values starting with numbers', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} ["1foo"] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ it('should not accept empty value', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} [""] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ it('should not accept empty host', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} ["foo:"] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ it('should not accept empty port', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} ["foo:foo_host:"] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ it('should not accept non numeric port', () => {
+ expect(() => createImporterFromContent(`application { config { ${optionName} ["foo:foo_host:1a"] } }`)).toThrow(
+ /The routes property name must match:/,
+ );
+ });
+ describe(`parsing ${optionName}`, () => {
+ let state: ImportState;
+
+ before(() => {
+ const importer = createImporterFromContent(
+ `application { config { ${optionName} ["blog:blog_host:123", "store:store_host", "notification"] } }`,
+ );
+ state = importer.import();
+ });
+
+ it('should set expected value', () => {
+ expect(state.exportedApplicationsWithEntities.jhipster.config[optionName]).toEqual([
+ 'blog:blog_host:123',
+ 'store:store_host',
+ 'notification',
+ ]);
+ });
+ });
+ describe(`export ${optionName}`, () => {
+ let jdl: string;
+
+ before(() => {
+ jdl = convertSingleContentToJDL({
+ 'generator-jhipster': { baseName: 'bar', [optionName]: ['blog:blog_host:123', 'store:store_host', 'notification'] },
+ });
+ });
+
+ it('should set expected value', () => {
+ expect(jdl).toEqual(`application {
+ config {
+ baseName bar
+ routes ["blog:blog_host:123", "store:store_host", "notification"]
+ }
+}
+`);
+ });
+ });
+});
diff --git a/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.ts b/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.ts
new file mode 100644
index 000000000000..0e8dae8fe16a
--- /dev/null
+++ b/generators/spring-cloud/generators/gateway/jdl/jdl-routes-option.ts
@@ -0,0 +1,8 @@
+import { JHipsterOptionDefinition } from '../../../../../jdl/types/types.js';
+
+export const jdlRoutesOptions: JHipsterOptionDefinition = {
+ name: 'routes',
+ tokenType: 'quotedList',
+ type: 'quotedList',
+ tokenValuePattern: /^"[A-Za-z][A-Za-z0-9_]*(?::[A-Za-z][A-Za-z0-9_]+(?::[0-9]+)?)?"$/,
+};
diff --git a/generators/spring-cloud/generators/gateway/types.d.ts b/generators/spring-cloud/generators/gateway/types.d.ts
new file mode 100644
index 000000000000..b3480845ba14
--- /dev/null
+++ b/generators/spring-cloud/generators/gateway/types.d.ts
@@ -0,0 +1,4 @@
+export type GatewayApplication = {
+ gatewayRoutes?: Array<{ route: string; host: string; serverPort: string }>;
+ routes?: string[];
+};
diff --git a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts
index 4ff786a8b604..8175eddbc506 100644
--- a/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts
+++ b/jdl/converters/parsed-jdl-to-jdl-object/parsed-jdl-to-jdl-object-converter.spec.ts
@@ -531,6 +531,7 @@ JDLApplication {
},
"languages": ListJDLApplicationConfigurationOption {
"name": "languages",
+ "quoted": false,
"value": Set {},
},
"packageFolder": StringJDLApplicationConfigurationOption {
diff --git a/jdl/models/jdl-application-configuration-factory.spec.ts b/jdl/models/jdl-application-configuration-factory.spec.ts
index 8c35ee1767bb..dab08659f103 100644
--- a/jdl/models/jdl-application-configuration-factory.spec.ts
+++ b/jdl/models/jdl-application-configuration-factory.spec.ts
@@ -128,6 +128,7 @@ JDLApplicationConfiguration {
"options": {
"testFrameworks": ListJDLApplicationConfigurationOption {
"name": "testFrameworks",
+ "quoted": false,
"value": Set {
"gatling",
},
diff --git a/jdl/models/jdl-application-configuration-factory.ts b/jdl/models/jdl-application-configuration-factory.ts
index d0baa4956320..2464f996b832 100644
--- a/jdl/models/jdl-application-configuration-factory.ts
+++ b/jdl/models/jdl-application-configuration-factory.ts
@@ -84,6 +84,8 @@ function createJDLConfigurationOption(type: string, name: string, value: any) {
return new BooleanJDLApplicationConfigurationOption(name, value);
case 'list':
return new ListJDLApplicationConfigurationOption(name, value);
+ case 'quotedList':
+ return new ListJDLApplicationConfigurationOption(name, value, true);
/* istanbul ignore next */
default:
// It should not happen! This is a developer error.
diff --git a/jdl/models/jdl-application-definition.ts b/jdl/models/jdl-application-definition.ts
index b23046b64a8d..2a09b1a7ef65 100644
--- a/jdl/models/jdl-application-definition.ts
+++ b/jdl/models/jdl-application-definition.ts
@@ -1,7 +1,7 @@
import { jhipsterOptionTypes, jhipsterOptionValues, jhipsterQuotedOptionNames } from '../jhipster/application-options.js';
export type JDLApplicationOptionValue = string | number | boolean | undefined | never[] | Record;
-export type JDLApplicationOptionTypeValue = 'string' | 'integer' | 'boolean' | 'list';
+export type JDLApplicationOptionTypeValue = 'string' | 'integer' | 'boolean' | 'list' | 'quotedList';
export type JDLApplicationOptionType = { type: JDLApplicationOptionTypeValue };
export default class JDLApplicationDefinition {
diff --git a/jdl/models/list-jdl-application-configuration-option.ts b/jdl/models/list-jdl-application-configuration-option.ts
index 4a517b43831d..c6d36bb209c1 100644
--- a/jdl/models/list-jdl-application-configuration-option.ts
+++ b/jdl/models/list-jdl-application-configuration-option.ts
@@ -21,8 +21,11 @@ import JDLApplicationConfigurationOption from './jdl-application-configuration-o
import { join } from '../utils/set-utils.js';
export default class ListJDLApplicationConfigurationOption extends JDLApplicationConfigurationOption {
- constructor(name, value) {
+ quoted: boolean;
+
+ constructor(name: string, value: string[], quoted: boolean = false) {
super(name, new Set(value));
+ this.quoted = quoted;
}
getValue(): any[] {
@@ -30,6 +33,6 @@ export default class ListJDLApplicationConfigurationOption extends JDLApplicatio
}
toString() {
- return `${this.name} [${join(this.value, ', ')}]`;
+ return `${this.name} [${join(this.value, ', ', this.quoted)}]`;
}
}
diff --git a/jdl/parsing/jdl-ast-builder-visitor.ts b/jdl/parsing/jdl-ast-builder-visitor.ts
index 5d9437022b0f..294606855c3a 100644
--- a/jdl/parsing/jdl-ast-builder-visitor.ts
+++ b/jdl/parsing/jdl-ast-builder-visitor.ts
@@ -581,6 +581,9 @@ export default class JDLAstBuilderVisitor extends BaseJDLCSTVisitor {
if (context.list) {
return this.visit(context.list);
}
+ if (context.quotedList) {
+ return this.visit(context.quotedList);
+ }
if (context.INTEGER) {
return context.INTEGER[0].image;
}
@@ -631,6 +634,9 @@ export default class JDLAstBuilderVisitor extends BaseJDLCSTVisitor {
if (context.list) {
return this.visit(context.list);
}
+ if (context.quotedList) {
+ return this.visit(context.quotedList);
+ }
if (context.INTEGER) {
return context.INTEGER[0].image;
}
@@ -656,6 +662,13 @@ export default class JDLAstBuilderVisitor extends BaseJDLCSTVisitor {
}
return context.NAME.map(namePart => namePart.image, this);
}
+
+ quotedList(context) {
+ if (!context.STRING) {
+ return [];
+ }
+ return context.STRING.map(namePart => namePart.image.slice(1, -1), this);
+ }
}
function getOptionEntityAndExcludedEntityLists(astResult, option) {
diff --git a/jdl/parsing/jdl-parser.ts b/jdl/parsing/jdl-parser.ts
index 304471cb46dc..1a7d2c203a01 100644
--- a/jdl/parsing/jdl-parser.ts
+++ b/jdl/parsing/jdl-parser.ts
@@ -76,6 +76,7 @@ export default class JDLParser extends CstParser {
this.applicationNamespaceConfigDeclaration();
this.namespaceConfigValue();
this.qualifiedName();
+ this.quotedList();
this.list();
// very important to call this after all the rules have been defined.
@@ -587,6 +588,7 @@ export default class JDLParser extends CstParser {
this.OR([
{ ALT: () => this.CONSUME(LexerTokens.BOOLEAN) },
{ ALT: () => this.SUBRULE(this.qualifiedName) },
+ { ALT: () => this.SUBRULE(this.quotedList) },
{ ALT: () => this.SUBRULE(this.list) },
{ ALT: () => this.CONSUME(LexerTokens.INTEGER) },
{ ALT: () => this.CONSUME(LexerTokens.STRING) },
@@ -618,6 +620,19 @@ export default class JDLParser extends CstParser {
});
}
+ quotedList(): any {
+ this.RULE('quotedList', () => {
+ this.CONSUME(LexerTokens.LSQUARE);
+ this.AT_LEAST_ONE_SEP({
+ SEP: LexerTokens.COMMA,
+ DEF: () => {
+ this.CONSUME(LexerTokens.STRING);
+ },
+ });
+ this.CONSUME(LexerTokens.RSQUARE);
+ });
+ }
+
applicationSubEntities(): any {
this.RULE('applicationSubEntities', () => {
this.CONSUME(LexerTokens.ENTITIES);
diff --git a/jdl/parsing/validator.ts b/jdl/parsing/validator.ts
index 2be64be9da6d..58c25bb15fdb 100644
--- a/jdl/parsing/validator.ts
+++ b/jdl/parsing/validator.ts
@@ -52,7 +52,7 @@ const REMEMBER_ME_KEY_PATTERN = /^\S+$/;
const NUMERIC = /^\d$/;
const BASIC_NPM_PACKAGE_NAME_PATTERN = /^(@[a-z0-9-][a-z0-9-._]*\/)?[a-z0-9-][a-z0-9-._]*$/;
-export type JDLValidatorOptionType = 'BOOLEAN' | 'INTEGER' | 'list' | 'NAME' | 'qualifiedName' | 'STRING';
+export type JDLValidatorOptionType = 'BOOLEAN' | 'INTEGER' | 'list' | 'NAME' | 'qualifiedName' | 'STRING' | 'quotedList';
export type JDLValidatorOption = {
type: JDLValidatorOptionType;
@@ -404,6 +404,16 @@ class JDLSyntaxValidatorVisitor extends BaseJDLCSTVisitorWithDefaults {
}
return true;
+ case 'quotedList':
+ if (actual.name !== 'quotedList') {
+ this.errors.push({
+ message: `An array of names is expected, but found: "${getFirstToken(actual).image}"`,
+ token: getFirstToken(actual),
+ });
+ return false;
+ }
+ return true;
+
case 'INTEGER':
if (actual.tokenType !== LexerTokens.INTEGER) {
this.errors.push({
@@ -446,8 +456,13 @@ class JDLSyntaxValidatorVisitor extends BaseJDLCSTVisitorWithDefaults {
throw Error(`Got an invalid application config property: '${propertyName}'.`);
}
- if (this.checkExpectedValueType(validation.type, value) && validation.pattern && value.children && value.children.NAME) {
- value.children.NAME.forEach(nameTok => this.checkNameSyntax(nameTok, validation.pattern, validation.msg));
+ if (this.checkExpectedValueType(validation.type, value) && validation.pattern && value.children) {
+ if (value.children.NAME) {
+ value.children.NAME.forEach(nameTok => this.checkNameSyntax(nameTok, validation.pattern, validation.msg));
+ }
+ if (value.children.STRING) {
+ value.children.STRING.forEach(nameTok => this.checkNameSyntax(nameTok, validation.pattern, validation.msg));
+ }
}
}
diff --git a/jdl/utils/set-utils.ts b/jdl/utils/set-utils.ts
index f1fa3348bd4a..80d84e8794fc 100644
--- a/jdl/utils/set-utils.ts
+++ b/jdl/utils/set-utils.ts
@@ -28,9 +28,11 @@ export function addAll(set: Set, elements: T[]) {
return set;
}
-export function join(set: Set, separator = ',') {
+export function join(set: Set, separator = ',', quoted = false) {
if (!set) {
throw new Error('A Set must be passed so as to join elements.');
}
- return Array.from(set).join(separator);
+ return Array.from(set)
+ .map(val => (quoted ? `"${val}"` : val))
+ .join(separator);
}
diff --git a/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl b/test-integration/jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl
similarity index 93%
rename from test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl
rename to test-integration/jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl
index 33c17e7ce52a..04c96f7aa186 100644
--- a/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl
+++ b/test-integration/jdl-samples/ms-ng-oauth2-mongodb-caffeine/blog-store.jdl
@@ -2,7 +2,7 @@
* Microservice stack sample to test compilation and base gateway/microservices functionality.
*
* Test focus:
- * - serviceDiscovery: eureka
+ * - serviceDiscovery: no
* - authenticationType: oauth2
* - databaseType: mongodb
* - testFrameworks: cypress, cucumber, gatling
@@ -16,13 +16,14 @@
* - buildTool: maven, gradle
*/
-/* reactive, maven */
+/* imperative, maven */
application {
config {
applicationType gateway
authenticationType oauth2
baseName gateway
buildTool maven
+ cacheProvider caffeine
clientFramework angular
creationTimestamp 1617901618886
databaseType mongodb
@@ -30,27 +31,29 @@ application {
jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ="
messageBroker kafka
packageName com.okta.developer.gateway
- serviceDiscoveryType consul
+ reactive false
+ serviceDiscoveryType no
testFrameworks [cypress, cucumber, gatling]
+ routes ["blog:blog:8081", "store:store:8082", "notification:notification:8083"]
}
entities *
}
-/* imperative, maven */
+/* reactive, maven */
application {
config {
applicationType microservice
authenticationType oauth2
baseName blog
buildTool maven
- cacheProvider caffeine
creationTimestamp 1617901618887
databaseType mongodb
jwtSecretKey "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ="
messageBroker kafka
packageName com.okta.developer.blog
+ reactive true
serverPort 8081
- serviceDiscoveryType consul
+ serviceDiscoveryType no
testFrameworks [cucumber, gatling]
}
entities Blog, Post, Tag
@@ -72,7 +75,7 @@ application {
messageBroker kafka
packageName com.okta.developer.store
serverPort 8082
- serviceDiscoveryType consul
+ serviceDiscoveryType no
testFrameworks [cucumber, gatling]
}
entities Product
@@ -94,7 +97,7 @@ application {
packageName com.okta.developer.notification
reactive true
serverPort 8083
- serviceDiscoveryType consul
+ serviceDiscoveryType no
testFrameworks [cucumber, gatling]
}
entities Notification
@@ -161,7 +164,7 @@ deployment {
appsFolders [gateway, store, blog, notification]
dockerRepositoryName "hipsterslabs"
monitoring no
- serviceDiscoveryType consul
+ serviceDiscoveryType no
}
deployment {
@@ -169,5 +172,5 @@ deployment {
appsFolders [gateway, store, blog, notification]
dockerRepositoryName "hipsterslabs"
monitoring no
- serviceDiscoveryType consul
+ serviceDiscoveryType no
}
diff --git a/test-integration/scripts/99-write-matrix.js b/test-integration/scripts/99-write-matrix.js
index 4bec4e66dee2..4d4d6b36097b 100755
--- a/test-integration/scripts/99-write-matrix.js
+++ b/test-integration/scripts/99-write-matrix.js
@@ -37,8 +37,6 @@ writeFileSync(
.map(({ generatorOptions, ...sample }) => ({
workspaces: generatorOptions?.workspaces ? 'true' : undefined,
'extra-args': `${generatorOptions?.workspaces ? ' --workspaces' : ''}${generatorOptions?.monorepository ? ' --monorepository' : ''}`,
- 'skip-backend-tests': sample['skip-backend-tests'] ? 'true' : 'false',
- 'skip-frontend-tests': sample['skip-frontend-tests'] ? 'true' : 'false',
'setup-application-sample': sample['jhi-app-sample'] || sample['app-sample'] || 'jdl',
'setup-application-environment': generatorOptions?.defaultEnvironment ?? 'prod',
'setup-application-packaging': generatorOptions?.defaultPackaging ?? 'jar',
@@ -55,6 +53,8 @@ writeFileSync(
'jhipster-bom-cicd-version': BUILD_JHIPSTER_BOM ? JHIPSTER_BOM_CICD_VERSION : undefined,
'gradle-cache': generatorOptions?.workspaces || sample.name.includes('gradle') ? true : undefined,
...sample,
+ 'skip-backend-tests': sample['skip-backend-tests'] ? 'true' : 'false',
+ 'skip-frontend-tests': sample['skip-frontend-tests'] ? 'true' : 'false',
}));
} catch (error) {
console.log(`File ${file} not found`, error);
diff --git a/test-integration/workflow-samples/angular.json b/test-integration/workflow-samples/angular.json
index 448d9a667c28..db88570715b8 100644
--- a/test-integration/workflow-samples/angular.json
+++ b/test-integration/workflow-samples/angular.json
@@ -115,10 +115,11 @@
"java-version": "21"
},
{
- "name": "ms-ng-consul-oauth2-mongodb-caffeine",
- "jdl-samples": "ms-ng-consul-oauth2-mongodb-caffeine",
+ "name": "ms-ng-oauth2-mongodb-caffeine",
+ "jdl-samples": "ms-ng-oauth2-mongodb-caffeine",
"generatorOptions": {
"workspaces": true,
+ "experimental": true,
"monorepository": true
}
},