├── .editorconfig ├── .eslintrc.json ├── .gitattributes ├── .github └── workflows │ └── applications.yml ├── .gitignore ├── LICENSE ├── README.md ├── generators ├── app │ ├── index.js │ └── templates │ │ ├── _AccountService.java │ │ ├── _AccountServiceIntTest.java │ │ ├── _AuditGrpcService.java │ │ ├── _AuditGrpcServiceIntTest.java │ │ ├── _AuthenticationInterceptor.java │ │ ├── _AuthenticationInterceptorIntTest.java │ │ ├── _ConfigurationPropertiesReportService.java │ │ ├── _ConfigurationPropertiesReportServiceIntTest.java │ │ ├── _EnvironmentService.java │ │ ├── _EnvironmentServiceIntTest.java │ │ ├── _HealthService.java │ │ ├── _HealthServiceIntTest.java │ │ ├── _InfoService.java │ │ ├── _InfoServiceIntTest.java │ │ ├── _JWTService.java │ │ ├── _JWTServiceIntTest.java │ │ ├── _LoggersService.java │ │ ├── _LoggersServiceIntTest.java │ │ ├── _MetricService.java │ │ ├── _MetricServiceIntTest.java │ │ ├── _ProtobufMappers.java │ │ ├── _UserGrpcService.java │ │ ├── _UserGrpcServiceIntTest.java │ │ ├── _UserProtoMapper.java │ │ ├── _account.proto │ │ ├── _audit.proto │ │ ├── _configprops.proto │ │ ├── _date.proto │ │ ├── _decimal.proto │ │ ├── _environment.proto │ │ ├── _grpc.gradle │ │ ├── _health.proto │ │ ├── _info.proto │ │ ├── _jwt.proto │ │ ├── _loggers.proto │ │ ├── _metric.proto │ │ ├── _pagination.proto │ │ ├── _queryfilters.proto │ │ └── _user.proto └── entity │ ├── index.js │ └── templates │ ├── _entity.proto │ ├── _entityGrpcService.java │ ├── _entityGrpcServiceIntTest.java │ └── _entityProtoMapper.java ├── package-lock.json ├── package.json ├── test-integration ├── configstore │ ├── insight-generator-jhipster.json │ └── insight-yo.json ├── generate-sample.sh ├── samples │ ├── .gitignore │ ├── .jhipster │ │ ├── BankAccount.json │ │ ├── CassBankAccount.json │ │ ├── CassTestEntity.json │ │ ├── CassTestMapstructEntity.json │ │ ├── CassTestServiceClassEntity.json │ │ ├── CassTestServiceImplEntity.json │ │ ├── Division.json │ │ ├── DocumentBankAccount.json │ │ ├── EntityWithDTO.json │ │ ├── EntityWithPagination.json │ │ ├── EntityWithPaginationAndDTO.json │ │ ├── EntityWithServiceClass.json │ │ ├── EntityWithServiceClassAndDTO.json │ │ ├── EntityWithServiceClassAndPagination.json │ │ ├── EntityWithServiceClassPaginationAndDTO.json │ │ ├── EntityWithServiceImpl.json │ │ ├── EntityWithServiceImplAndDTO.json │ │ ├── EntityWithServiceImplAndPagination.json │ │ ├── EntityWithServiceImplPaginationAndDTO.json │ │ ├── FieldTestEntity.json │ │ ├── FieldTestInfiniteScrollEntity.json │ │ ├── FieldTestMapstructEntity.json │ │ ├── FieldTestPaginationEntity.json │ │ ├── FieldTestServiceClassEntity.json │ │ ├── FieldTestServiceImplEntity.json │ │ ├── Label.json │ │ ├── MapsIdChildEntityWithDTO.json │ │ ├── MapsIdChildEntityWithoutDTO.json │ │ ├── MapsIdParentEntityWithDTO.json │ │ ├── MapsIdParentEntityWithoutDTO.json │ │ ├── MapsIdUserProfileWithDTO.json │ │ ├── MicroserviceBankAccount.json │ │ ├── MicroserviceLabel.json │ │ ├── MicroserviceOperation.json │ │ ├── Operation.json │ │ ├── Place.json │ │ ├── SuperMegaLargeTestEntity.json │ │ ├── TestCustomTableName.json │ │ ├── TestEntity.json │ │ ├── TestInfiniteScroll.json │ │ ├── TestManyRelPaginDTO.json │ │ ├── TestManyToMany.json │ │ ├── TestManyToOne.json │ │ ├── TestMapstruct.json │ │ ├── TestOneToOne.json │ │ ├── TestPagination.json │ │ ├── TestServiceClass.json │ │ ├── TestServiceImpl.json │ │ └── TestTwoRelationshipsSameEntity.json │ ├── README.md │ ├── app-sample-dev │ │ └── .yo-rc.json │ ├── jdl-default │ │ └── app.jdl │ ├── ms-micro-consul │ │ └── .yo-rc.json │ ├── ms-micro-eureka-jwt │ │ └── .yo-rc.json │ ├── ms-micro-eureka │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-consul │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-eureka-jwt │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-eureka-oauth2 │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-eureka-uaa │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-eureka │ │ └── .yo-rc.json │ ├── ms-ngx-gateway-uaa │ │ └── .yo-rc.json │ ├── ms-react-gateway-consul-jwt │ │ └── .yo-rc.json │ ├── ms-react-gateway-consul-oauth2 │ │ └── .yo-rc.json │ ├── ngx-couchbase │ │ └── .yo-rc.json │ ├── ngx-default │ │ └── .yo-rc.json │ ├── ngx-gradle-fr │ │ └── .yo-rc.json │ ├── ngx-gradle-mariadb-oauth2-infinispan │ │ └── .yo-rc.json │ ├── ngx-gradle-mongodb-kafka-cucumber │ │ └── .yo-rc.json │ ├── ngx-gradle-psql-es-noi18n-mapsid │ │ └── .yo-rc.json │ ├── ngx-gradle-yarn-h2disk-ws-nocache │ │ └── .yo-rc.json │ ├── ngx-h2mem-ws-nol2 │ │ └── .yo-rc.json │ ├── ngx-mariadb-oauth2-infinispan │ │ └── .yo-rc.json │ ├── ngx-mariadb-oauth2-sass-infinispan │ │ └── .yo-rc.json │ ├── ngx-mongodb-kafka-cucumber │ │ └── .yo-rc.json │ ├── ngx-psql-es-noi18n-mapsid │ │ └── .yo-rc.json │ ├── ngx-session-cassandra-fr │ │ └── .yo-rc.json │ ├── react-default │ │ └── .yo-rc.json │ ├── react-gradle-cassandra-session-redis │ │ └── .yo-rc.json │ ├── react-gradle-couchbase-caffeine │ │ └── .yo-rc.json │ ├── react-gradle-h2mem-memcached │ │ └── .yo-rc.json │ ├── react-gradle-psql-es-noi18n-mapsid │ │ └── .yo-rc.json │ ├── react-maven-cassandra-session-redis │ │ └── .yo-rc.json │ ├── react-maven-couchbase-caffeine │ │ └── .yo-rc.json │ ├── react-maven-h2mem-memcached │ │ └── .yo-rc.json │ ├── react-maven-psql-es-noi18n-mapsid │ │ └── .yo-rc.json │ ├── react-noi18n-es-ws-gradle-session │ │ └── .yo-rc.json │ ├── uaa │ │ └── .yo-rc.json │ └── webflux-mongodb │ │ └── .yo-rc.json └── scripts │ ├── 00-init-env.sh │ ├── 01-display-configuration.sh │ ├── 02-display-tools.sh │ ├── 03-system.sh │ ├── 04-git-config.sh │ ├── 10-install-jhipster-grpc.sh │ ├── 11-generate-entities.sh │ ├── 12-generate-project.sh │ ├── 13-replace-version-generated-project.sh │ ├── 14-jhipster-info.sh │ ├── 20-docker-compose.sh │ ├── 20-no-memory-limit-elasticsearch.sh │ ├── 21-tests-backend.sh │ ├── 22-tests-frontend.sh │ ├── 23-package.sh │ ├── 24-tests-e2e.sh │ └── 25-sonar-analyze.sh └── test ├── templates └── default │ └── .yo-rc.json └── test-app.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | 15 | [package.json] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "es6": true 5 | }, 6 | "extends": ["eslint:recommended"], 7 | "rules": { 8 | "indent": [2, 4], 9 | "linebreak-style": 0, 10 | "eol-last": 2, 11 | "quotes": [2, "single"], 12 | "semi": [2, "always"], 13 | "eqeqeq": [2, "smart"], 14 | "no-use-before-define": [2, "nofunc"], 15 | "no-unused-vars": [2, {"vars": "local", "args": "none"}], 16 | "no-multi-str": 2, 17 | "no-irregular-whitespace": 2 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | .idea 4 | *.iml 5 | atlassian-ide-plugin.xml 6 | /.project 7 | test/temp/ 8 | npm-debug.log 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # generator-jhipster-grpc 2 | [![NPM version][npm-image]][npm-url] [![Build Status][github-actions-image]][github-actions-url] [![Dependency Status][daviddm-image]][daviddm-url] 3 | > JHipster module, Adds support for gRPC and generates gRPC CRUD services 4 | 5 | # Introduction 6 | 7 | This is a [JHipster](http://jhipster.github.io/) module, that is meant to be used in a JHipster application. 8 | 9 | WARN : Under developpement. See list of limitations and TODOs 10 | 11 | # Prerequisites 12 | 13 | As this is a [JHipster](http://jhipster.github.io/) module, we expect you have JHipster and its related tools already installed: 14 | 15 | - [Installing JHipster](https://jhipster.github.io/installation.html) 16 | 17 | # Installation 18 | 19 | To install this module: 20 | 21 | ```bash 22 | npm install -g generator-jhipster-grpc 23 | ``` 24 | 25 | Compatibility : 26 | - JHipster 4.1 and inferior (Note : never tested with <4.1.0) : module version 0.7.0 27 | - JHipster 4.2 and 4.3 : module version 0.8.0, 0.9.0 28 | - JHipster 4.4 : module version 0.10.0 29 | - JHipster 4.5 to 4.8 : module version 0.11.0 30 | - JHipster 4.9 : module version 0.12.0, 0.13.0 31 | - JHipster 4.10 : module version 0.14.1 32 | - JHipster 4.11 to 4.14 : module version 0.15.2 33 | - JHipster 5.0 to 5.7 : module version 0.16.0 34 | - JHipster 5.8: module version 0.17.0 35 | - JHipster 6.0: module version 0.18.0 36 | - JHipster 6.1 and 6.2: module version 0.19.1 37 | - JHipster 6.3: module version 0.20.0 38 | - JHipster 6.4 and 6.5: module version 0.21.2 0.22.0 39 | - JHipster master : module branch next-jhipster (nightly build status : [![Build Status][github-actions-image-nightly]][github-actions-url]) 40 | 41 | # Usage 42 | 43 | At the root of your project directory: 44 | ```bash 45 | yo jhipster-grpc 46 | ``` 47 | This will configure [reactive-grpc](https://github.com/salesforce/reactive-grpc) and [grpc-spring-boot-starter](https://github.com/LogNet/grpc-spring-boot-starter) 48 | so that the proto files present in `src/main/proto` are compiled. 49 | If you want to add CRUD gRPC services for an entity, just (re)generate it and confirm when the question is asked. 50 | The endpoints use Reactor implementation of reactive-streams (Flux) with back-pressure. 51 | 52 | Notes : 53 | * for the moment entities must have a service layer (serviceClass or serviceImpl) 54 | * just like with DTOs, entities that are referenced by another entity in a relationship (many-to-many owned side, many-to-one or one-to-ine owned side) currently must be grpc activated and thus have a service layer. The service layer constraint should be relaxed in a future release since it's only the gRPC mapper which is required. 55 | 56 | TODOs: 57 | - [x] ~~Generate existing entities~~ 58 | - [x] ~~Support Gradle~~ 59 | - [x] ~~Entities without DTOs~~ 60 | - [ ] Entities without service 61 | - [x] ~~Entities with pagination~~ 62 | - [x] ~~Support Cassandra~~ 63 | - [x] ~~Support Mongo~~ 64 | - [x] ~~Support relationships~~ 65 | - [x] ~~JWT security~~ 66 | - [x] ~~OAuth2 security~~ 67 | - [x] ~~Basic auth security~~ (used for session auth option) 68 | - [x] ~~Entity javadoc~~ 69 | - [x] ~~Field javadoc~~ 70 | - [x] ~~Add ElasticSearch endpoints~~ 71 | - [x] ~~Management endpoints~~ 72 | - [x] ~~Account~~ 73 | - [x] ~~Loggers~~ 74 | - [x] ~~Audits~~ 75 | - [x] ~~Users~~ 76 | - [x] ~~Profile info~~ 77 | - [x] ~~Spring Boot Actuators~~ 78 | - [ ] Support streaming from the DB (Stream<> in repository) 79 | - [x] ~~Support streaming back-pressure (reactive streams with rxJava2 or Reactor)~~ 80 | - [ ] Client-side configuration (micro-services) 81 | - [ ] Client-side load-balancing with service discovery (micro-services) 82 | - [ ] Generator tests 83 | - [ ] Sample/demo project 84 | - [x] ~~Generated code tests~~ 85 | - [x] ~~Travis CI~~ 86 | 87 | Mappings: 88 | 89 | | JHipster | Protobuf | 90 | |:--------:|:-------------:| 91 | | Integer | int32 | 92 | | Long | int64 | 93 | | String | string | 94 | | Float | float | 95 | | Double | double | 96 | | Boolean | bool | 97 | | Blob (byte[]) | bytes | 98 | | ByteBuffer | bytes | 99 | | Instant | google.protobuf.Timestamp | 100 | | ZonedDateTime | google.protobuf.Timestamp | 101 | | LocalDate | util.Date | 102 | | BigDecimal | util.Decimal | 103 | | enum | enum | 104 | 105 | util.Date and util.Decimal are custom definitions. 106 | Non-required protobuf scalar types and enums are wrapped in OneOf types to provide nullability. 107 | 108 | # License 109 | 110 | Apache-2.0 © [Christophe Bornet] 111 | 112 | 113 | [npm-image]: https://img.shields.io/npm/v/generator-jhipster-grpc.svg 114 | [npm-url]: https://npmjs.org/package/generator-jhipster-grpc 115 | [github-actions-image]: https://github.com/cbornet/generator-jhipster-grpc/workflows/Applications/badge.svg 116 | [github-actions-image-nightly]: https://github.com/cbornet/generator-jhipster-grpc/workflows/Applications/badge.svg?branch=next-jhipster 117 | [github-actions-url]: https://github.com/cbornet/generator-jhipster-grpc/actions 118 | 119 | [daviddm-image]: https://david-dm.org/cbornet/generator-jhipster-grpc.svg?theme=shields.io 120 | [daviddm-url]: https://david-dm.org/cbornet/generator-jhipster-module 121 | -------------------------------------------------------------------------------- /generators/app/templates/_AuditGrpcService.java: -------------------------------------------------------------------------------- 1 | <%_ 2 | let idProtoWrappedType; 3 | if (databaseType === 'sql') { 4 | idProtoWrappedType = 'Int64Value'; 5 | } else { 6 | idProtoWrappedType = 'StringValue'; 7 | } 8 | _%> 9 | package <%= packageName %>.grpc; 10 | 11 | import <%= packageName %>.service.AuditEventService; 12 | 13 | import com.fasterxml.jackson.core.JsonProcessingException; 14 | import com.google.protobuf.<%= idProtoWrappedType %>; 15 | import io.grpc.Status; 16 | import org.slf4j.Logger; 17 | import org.slf4j.LoggerFactory; 18 | import reactor.core.publisher.Flux; 19 | import reactor.core.publisher.Mono; 20 | 21 | import java.time.Instant; 22 | import java.time.ZoneId; 23 | 24 | public class AuditGrpcService extends ReactorAuditServiceGrpc.AuditServiceImplBase { 25 | 26 | private final Logger log = LoggerFactory.getLogger(AuditGrpcService.class); 27 | 28 | private final AuditEventService auditEventService; 29 | 30 | public AuditGrpcService(AuditEventService auditEventService) { 31 | this.auditEventService = auditEventService; 32 | } 33 | 34 | @Override 35 | public Flux getAuditEvents(Mono request) { 36 | return request 37 | .flatMapIterable( auditRequest -> { 38 | if (auditRequest.hasFromDate() || auditRequest.hasToDate()) { 39 | Instant fromDate = auditRequest.hasFromDate() ? 40 | ProtobufMappers 41 | .dateProtoToLocalDate(auditRequest.getFromDate()) 42 | .atStartOfDay(ZoneId.systemDefault()) 43 | .toInstant() 44 | : null; 45 | Instant toDate = auditRequest.hasToDate() ? 46 | ProtobufMappers 47 | .dateProtoToLocalDate(auditRequest.getToDate()) 48 | .atStartOfDay(ZoneId.systemDefault()) 49 | .plusDays(1) 50 | .toInstant() 51 | : null; 52 | return auditEventService.findByDates(fromDate, toDate, ProtobufMappers.pageRequestProtoToPageRequest(auditRequest.getPaginationParams())); 53 | } else { 54 | return auditEventService.findAll(ProtobufMappers.pageRequestProtoToPageRequest(auditRequest.getPaginationParams())); 55 | } 56 | }) 57 | .map(auditEvent -> { 58 | try { 59 | return ProtobufMappers.auditEventToAuditEventProto(auditEvent); 60 | } catch (JsonProcessingException e) { 61 | log.error("Couldn't parse audit event", e); 62 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 63 | } 64 | }); 65 | } 66 | 67 | @Override 68 | public Mono getAuditEvent(Mono<<%= idProtoWrappedType %>> request) { 69 | return request 70 | .map(<%= idProtoWrappedType %>::getValue) 71 | .map(id -> auditEventService.find(id).orElseThrow(Status.NOT_FOUND::asRuntimeException)) 72 | .map(auditEvent -> { 73 | try { 74 | return ProtobufMappers.auditEventToAuditEventProto(auditEvent); 75 | } catch (JsonProcessingException e) { 76 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 77 | } 78 | }); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /generators/app/templates/_AuditGrpcServiceIntTest.java: -------------------------------------------------------------------------------- 1 | <%_ 2 | let idProtoWrappedType; 3 | if (databaseType === 'sql') { 4 | idProtoWrappedType = 'Int64Value'; 5 | } else { 6 | idProtoWrappedType = 'StringValue'; 7 | } 8 | _%> 9 | package <%= packageName %>.grpc; 10 | 11 | import <%= packageName %>.<%=mainClass%>; 12 | import <%= packageName %>.domain.PersistentAuditEvent; 13 | import <%= packageName %>.repository.PersistenceAuditEventRepository; 14 | import <%= packageName %>.service.AuditEventService; 15 | 16 | import com.google.protobuf.<%=idProtoWrappedType%>; 17 | import io.grpc.Server; 18 | import io.grpc.Status; 19 | import io.grpc.StatusException; 20 | import io.grpc.StatusRuntimeException; 21 | import io.grpc.inprocess.InProcessChannelBuilder; 22 | import io.grpc.inprocess.InProcessServerBuilder; 23 | import org.junit.jupiter.api.AfterEach; 24 | import org.junit.jupiter.api.BeforeEach; 25 | import org.junit.jupiter.api.Test; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | import org.springframework.boot.test.context.SpringBootTest; 28 | import org.springframework.transaction.annotation.Transactional; 29 | 30 | import java.io.IOException; 31 | import java.time.Instant; 32 | import java.util.concurrent.TimeUnit; 33 | 34 | import static org.assertj.core.api.Assertions.assertThat; 35 | import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; 36 | 37 | @SpringBootTest(classes = <%= mainClass %>.class)<% if (databaseType == 'sql') { %> 38 | @Transactional<% } %> 39 | public class AuditGrpcServiceIntTest { 40 | 41 | private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; 42 | private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; 43 | private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z"); 44 | 45 | @Autowired 46 | private PersistenceAuditEventRepository auditEventRepository; 47 | 48 | @Autowired 49 | private AuditEventService auditEventService; 50 | 51 | private PersistentAuditEvent auditEvent; 52 | 53 | private Server mockServer; 54 | 55 | private AuditServiceGrpc.AuditServiceBlockingStub stub; 56 | 57 | @BeforeEach 58 | public void setUp() throws IOException { 59 | AuditGrpcService service = new AuditGrpcService(auditEventService); 60 | String uniqueServerName = "Mock server for " + AuditGrpcService.class; 61 | mockServer = InProcessServerBuilder 62 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 63 | InProcessChannelBuilder channelBuilder = 64 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 65 | stub = AuditServiceGrpc.newBlockingStub(channelBuilder.build()); 66 | } 67 | 68 | @AfterEach 69 | public void tearDown() throws Exception { 70 | mockServer.shutdownNow(); 71 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 72 | } 73 | 74 | @BeforeEach 75 | public void initTest() { 76 | auditEventRepository.deleteAll(); 77 | auditEvent = new PersistentAuditEvent(); 78 | auditEvent.setAuditEventType(SAMPLE_TYPE); 79 | auditEvent.setPrincipal(SAMPLE_PRINCIPAL); 80 | auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); 81 | } 82 | 83 | @Test 84 | public void getAllAudits() throws Exception { 85 | // Initialize the database 86 | auditEventRepository.save(auditEvent); 87 | 88 | assertThat(stub.getAuditEvents(AuditRequest.newBuilder().build())).extracting("principal").contains(SAMPLE_PRINCIPAL); 89 | } 90 | 91 | @Test 92 | public void getAudit() throws Exception { 93 | // Initialize the database 94 | auditEventRepository.save(auditEvent); 95 | 96 | // Get the audit 97 | AuditEvent event = stub.getAuditEvent(<%=idProtoWrappedType%>.newBuilder().setValue(auditEvent.getId()).build()); 98 | assertThat(event.getPrincipal()).isEqualTo(SAMPLE_PRINCIPAL); 99 | } 100 | 101 | @Test 102 | public void getAuditsByDate() throws Exception { 103 | // Initialize the database 104 | auditEventRepository.save(auditEvent); 105 | 106 | AuditRequest request = AuditRequest.newBuilder() 107 | .setFromDate(Date.newBuilder().setYear(2015).setMonth(8).setDay(1)) 108 | .setToDate(Date.newBuilder().setYear(2015).setMonth(8).setDay(20)) 109 | .build(); 110 | assertThat(stub.getAuditEvents(request)).extracting("principal").contains(SAMPLE_PRINCIPAL); 111 | } 112 | 113 | @Test 114 | public void getNonExistingAuditsByDate() throws Exception { 115 | // Initialize the database 116 | auditEventRepository.save(auditEvent); 117 | 118 | // Query audits but expect no results 119 | AuditRequest request = AuditRequest.newBuilder() 120 | .setFromDate(Date.newBuilder().setYear(2015).setMonth(9).setDay(1)) 121 | .setToDate(Date.newBuilder().setYear(2015).setMonth(9).setDay(20)) 122 | .build(); 123 | assertThat(stub.getAuditEvents(request)).isEmpty(); 124 | } 125 | 126 | @Test 127 | public void getNonExistingAudit() throws Exception { 128 | // Get the audit 129 | try { 130 | stub.getAuditEvent(<%=idProtoWrappedType%>.newBuilder().setValue(<% if (databaseType == 'sql') { %>Long.MAX_VALUE<% } else { %>"invalid id"<% } %>).build()); 131 | failBecauseExceptionWasNotThrown(StatusException.class); 132 | } catch (StatusRuntimeException e) { 133 | assertThat(e.getStatus().getCode()).isEqualTo(Status.Code.NOT_FOUND); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /generators/app/templates/_ConfigurationPropertiesReportService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.google.protobuf.Empty; 6 | import io.grpc.Status; 7 | import org.lognet.springboot.grpc.GRpcService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint; 10 | import reactor.core.publisher.Mono; 11 | 12 | import java.util.Map; 13 | import java.util.Optional; 14 | import java.util.stream.Collectors; 15 | 16 | @GRpcService(interceptors = {AuthenticationInterceptor.class}) 17 | public class ConfigurationPropertiesReportService extends ReactorConfigurationPropertiesReportServiceGrpc.ConfigurationPropertiesReportServiceImplBase { 18 | 19 | private final ConfigurationPropertiesReportEndpoint endpoint; 20 | 21 | private final ObjectMapper mapper; 22 | 23 | public ConfigurationPropertiesReportService(ConfigurationPropertiesReportEndpoint endpoint, ObjectMapper mapper) { 24 | this.endpoint = endpoint; 25 | this.mapper = mapper; 26 | } 27 | 28 | @Override 29 | public Mono getConfigurationProperties(Mono request) { 30 | return request.map(e -> mapApplicationConfigurationProperties(endpoint.configurationProperties())); 31 | } 32 | 33 | private ApplicationConfigurationProperties mapApplicationConfigurationProperties(ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties props) { 34 | return ApplicationConfigurationProperties.newBuilder() 35 | .putAllContexts(props.getContexts().entrySet().stream() 36 | .collect(Collectors.toMap( 37 | Map.Entry::getKey, 38 | e -> mapContextConfigurationProperties(e.getValue())) 39 | ) 40 | ) 41 | .build(); 42 | } 43 | 44 | private ContextConfigurationProperties mapContextConfigurationProperties(ConfigurationPropertiesReportEndpoint.ContextConfigurationProperties props) { 45 | ContextConfigurationProperties.Builder builder = ContextConfigurationProperties.newBuilder(); 46 | Optional.ofNullable(props.getParentId()).ifPresent(builder::setParentId); 47 | props.getBeans().forEach((k, v) -> builder.putBeans(k, mapConfigurationPropertiesBean(v))); 48 | return builder.build(); 49 | } 50 | 51 | private ConfigurationPropertiesBean mapConfigurationPropertiesBean(ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor descriptor) { 52 | ConfigurationPropertiesBean.Builder builder = ConfigurationPropertiesBean.newBuilder(); 53 | Optional.ofNullable(descriptor.getPrefix()).ifPresent(builder::setPrefix); 54 | descriptor.getProperties().forEach((k, v) -> { 55 | try { 56 | builder.putProperties(k, mapper.writeValueAsString(v)); 57 | } catch (JsonProcessingException e) { 58 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 59 | } 60 | }); 61 | return builder.build(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /generators/app/templates/_ConfigurationPropertiesReportServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.fasterxml.jackson.databind.ObjectMapper; 12 | import com.google.protobuf.Empty; 13 | import io.grpc.Server; 14 | import io.grpc.inprocess.InProcessChannelBuilder; 15 | import io.grpc.inprocess.InProcessServerBuilder; 16 | import org.junit.jupiter.api.AfterEach; 17 | import org.junit.jupiter.api.BeforeEach; 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.beans.factory.annotation.Value; 21 | import org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint; 22 | import org.springframework.boot.test.context.SpringBootTest; 23 | import org.springframework.context.ApplicationContext; 24 | 25 | import java.io.IOException; 26 | import java.util.concurrent.TimeUnit; 27 | 28 | import static org.assertj.core.api.Assertions.assertThat; 29 | 30 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 31 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 32 | <%_ } else { _%> 33 | @SpringBootTest(classes = <%= mainClass %>.class) 34 | <%_ } _%> 35 | public class ConfigurationPropertiesReportServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 36 | 37 | @Autowired 38 | private ConfigurationPropertiesReportEndpoint configurationPropertiesReportEndpoint; 39 | 40 | @Autowired 41 | private ApplicationContext applicationContext; 42 | 43 | @Autowired 44 | private ObjectMapper mapper; 45 | 46 | @Value("${spring.mail.host}") 47 | private String mailHost; 48 | 49 | private Server mockServer; 50 | 51 | private ConfigurationPropertiesReportServiceGrpc.ConfigurationPropertiesReportServiceBlockingStub stub; 52 | 53 | @BeforeEach 54 | public void setUp() throws IOException { 55 | ConfigurationPropertiesReportService service = new ConfigurationPropertiesReportService(configurationPropertiesReportEndpoint, mapper); 56 | String uniqueServerName = "Mock server for " + ConfigurationPropertiesReportService.class; 57 | mockServer = InProcessServerBuilder 58 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 59 | InProcessChannelBuilder channelBuilder = 60 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 61 | stub = ConfigurationPropertiesReportServiceGrpc.newBlockingStub(channelBuilder.build()); 62 | } 63 | 64 | @AfterEach 65 | public void tearDown() throws Exception { 66 | mockServer.shutdownNow(); 67 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 68 | } 69 | 70 | @Test 71 | public void getConfigurationProperties() { 72 | ConfigurationPropertiesBean beans = stub.getConfigurationProperties(Empty.newBuilder().build()) 73 | .getContextsOrThrow(applicationContext.getId()) 74 | .getBeansOrThrow("spring.mail-org.springframework.boot.autoconfigure.mail.MailProperties"); 75 | assertThat(beans.getPrefix()).isEqualTo("spring.mail"); 76 | assertThat(beans.getPropertiesMap()).containsKey("host"); 77 | assertThat(beans.getPropertiesMap().get("host")).isEqualTo(String.format("\"%s\"", mailHost)); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /generators/app/templates/_EnvironmentService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.google.protobuf.Empty; 6 | import io.grpc.Status; 7 | import org.lognet.springboot.grpc.GRpcService; 8 | import org.springframework.boot.actuate.env.EnvironmentEndpoint; 9 | import reactor.core.publisher.Mono; 10 | 11 | import java.util.Optional; 12 | import java.util.stream.Collectors; 13 | 14 | @GRpcService(interceptors = {AuthenticationInterceptor.class}) 15 | public class EnvironmentService extends ReactorEnvironmentServiceGrpc.EnvironmentServiceImplBase { 16 | 17 | private final EnvironmentEndpoint endpoint; 18 | 19 | private final ObjectMapper mapper; 20 | 21 | public EnvironmentService(EnvironmentEndpoint endpoint, ObjectMapper mapper) { 22 | this.endpoint = endpoint; 23 | this.mapper = mapper; 24 | } 25 | 26 | @Override 27 | public Mono getEnv(Mono request) { 28 | return request.map(empty -> mapEnvironment(endpoint.environment(null))); 29 | } 30 | 31 | 32 | private Environment mapEnvironment(EnvironmentEndpoint.EnvironmentDescriptor environment) { 33 | return Environment.newBuilder() 34 | .addAllActiveProfiles(environment.getActiveProfiles()) 35 | .addAllPropertySources(environment.getPropertySources().stream() 36 | .map(this::mapPropertySource) 37 | .collect(Collectors.toList()) 38 | ) 39 | .build(); 40 | } 41 | 42 | 43 | private PropertySource mapPropertySource(EnvironmentEndpoint.PropertySourceDescriptor propertySource) { 44 | PropertySource.Builder builder = PropertySource.newBuilder() 45 | .setName(propertySource.getName()); 46 | propertySource.getProperties().forEach((k, v) -> builder.putProperties(k, mapPropertyValue(v))); 47 | return builder.build(); 48 | } 49 | 50 | private PropertyValue mapPropertyValue(EnvironmentEndpoint.PropertyValueDescriptor propertyValue) { 51 | try { 52 | return PropertyValue.newBuilder() 53 | .setOrigin(Optional.ofNullable(propertyValue.getOrigin()).orElse("")) 54 | .setValue(mapper.writeValueAsString(propertyValue.getValue())).build(); 55 | } catch (JsonProcessingException e) { 56 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /generators/app/templates/_EnvironmentServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.fasterxml.jackson.databind.ObjectMapper; 12 | import com.google.protobuf.Empty; 13 | import io.grpc.Server; 14 | import io.grpc.inprocess.InProcessChannelBuilder; 15 | import io.grpc.inprocess.InProcessServerBuilder; 16 | import org.junit.jupiter.api.AfterEach; 17 | import org.junit.jupiter.api.BeforeEach; 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.boot.actuate.env.EnvironmentEndpoint; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | 23 | import java.io.IOException; 24 | import java.util.Map; 25 | import java.util.Optional; 26 | import java.util.concurrent.TimeUnit; 27 | 28 | import static org.assertj.core.api.Assertions.assertThat; 29 | 30 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 31 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 32 | <%_ } else { _%> 33 | @SpringBootTest(classes = <%= mainClass %>.class) 34 | <%_ } _%> 35 | public class EnvironmentServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 36 | 37 | @Autowired 38 | private EnvironmentEndpoint endpoint; 39 | 40 | @Autowired 41 | private ObjectMapper mapper; 42 | 43 | private Server mockServer; 44 | 45 | private EnvironmentServiceGrpc.EnvironmentServiceBlockingStub stub; 46 | 47 | @BeforeEach 48 | public void setUp() throws IOException { 49 | EnvironmentService service = new EnvironmentService(endpoint, mapper); 50 | String uniqueServerName = "Mock server for " + EnvironmentService.class; 51 | mockServer = InProcessServerBuilder 52 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 53 | InProcessChannelBuilder channelBuilder = 54 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 55 | stub = EnvironmentServiceGrpc.newBlockingStub(channelBuilder.build()); 56 | } 57 | 58 | @AfterEach 59 | public void tearDown() throws Exception { 60 | mockServer.shutdownNow(); 61 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 62 | } 63 | 64 | @Test 65 | public void testEnvironment() { 66 | Environment environment = stub.getEnv(Empty.newBuilder().build()); 67 | Optional> propertyValueMap = environment.getPropertySourcesList().stream() 68 | .filter(p -> "Inlined Test Properties".equals(p.getName())) 69 | .map(PropertySource::getPropertiesMap) 70 | .findFirst(); 71 | assertThat(propertyValueMap).isPresent(); 72 | assertThat(propertyValueMap.get()).hasEntrySatisfying( 73 | "org.springframework.boot.test.context.SpringBootTestContextBootstrapper", 74 | pv -> assertThat(pv.getValue()).isEqualTo("\"true\"")); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /generators/app/templates/_HealthService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.google.protobuf.Empty; 4 | import org.lognet.springboot.grpc.GRpcService; 5 | import org.springframework.boot.actuate.health.CompositeHealthIndicator; 6 | import org.springframework.boot.actuate.health.HealthAggregator; 7 | import org.springframework.util.Assert; 8 | import reactor.core.publisher.Mono; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | @GRpcService 14 | public class HealthService extends ReactorHealthServiceGrpc.HealthServiceImplBase { 15 | 16 | private final Map healthIndicators; 17 | 18 | private final org.springframework.boot.actuate.health.HealthIndicator healthIndicator; 19 | 20 | public HealthService(HealthAggregator healthAggregator, Map healthIndicators) { 21 | Assert.notNull(healthAggregator, "HealthAggregator must not be null"); 22 | Assert.notNull(healthIndicators, "HealthIndicators must not be null"); 23 | CompositeHealthIndicator healthIndicator = new CompositeHealthIndicator(healthAggregator); 24 | healthIndicators.forEach((key, value) -> healthIndicator.addHealthIndicator(getKey(key), value)); 25 | this.healthIndicators = healthIndicators; 26 | this.healthIndicator = healthIndicator; 27 | } 28 | 29 | @Override 30 | public Mono getHealth(Mono request) { 31 | Map healthIndicatorProtos = new HashMap<>(); 32 | this.healthIndicators.forEach((key, indicator) -> healthIndicatorProtos.put(key, healthIndicatorToHealthIndicatorProto(indicator))); 33 | 34 | return request.map( e -> 35 | Health.newBuilder() 36 | .setStatus(Status.valueOf(this.healthIndicator.health().getStatus().toString())) 37 | .putAllHealthIndicators(healthIndicatorProtos) 38 | .build() 39 | ); 40 | } 41 | 42 | public HealthIndicator healthIndicatorToHealthIndicatorProto(org.springframework.boot.actuate.health.HealthIndicator healthIndicator) { 43 | final Map details = new HashMap<>(); 44 | healthIndicator.health().getDetails().forEach( (detailKey, detailValue) -> 45 | details.put(detailKey, detailValue.toString()) 46 | ); 47 | return HealthIndicator.newBuilder() 48 | .setStatus(Status.valueOf(healthIndicator.health().getStatus().toString())) 49 | .putAllDetails(details) 50 | .build(); 51 | } 52 | 53 | private String getKey(String name) { 54 | int index = name.toLowerCase().indexOf("healthindicator"); 55 | if (index > 0) { 56 | return name.substring(0, index); 57 | } 58 | return name; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /generators/app/templates/_HealthServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.google.protobuf.Empty; 12 | import io.grpc.Server; 13 | import io.grpc.inprocess.InProcessChannelBuilder; 14 | import io.grpc.inprocess.InProcessServerBuilder; 15 | import org.junit.jupiter.api.AfterEach; 16 | import org.junit.jupiter.api.BeforeEach; 17 | import org.junit.jupiter.api.Test; 18 | import org.springframework.beans.factory.annotation.Autowired; 19 | import org.springframework.boot.actuate.health.HealthAggregator; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | import java.io.IOException; 23 | import java.util.Map; 24 | import java.util.concurrent.TimeUnit; 25 | 26 | import static org.assertj.core.api.Assertions.assertThat; 27 | 28 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 29 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 30 | <%_ } else { _%> 31 | @SpringBootTest(classes = <%= mainClass %>.class) 32 | <%_ } _%> 33 | public class HealthServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 34 | 35 | @Autowired 36 | HealthAggregator healthAggregator; 37 | 38 | @Autowired 39 | Map healthIndicators; 40 | 41 | private Server mockServer; 42 | 43 | private HealthServiceGrpc.HealthServiceBlockingStub stub; 44 | 45 | @BeforeEach 46 | public void setUp() throws IOException { 47 | HealthService service = new HealthService(healthAggregator, healthIndicators); 48 | String uniqueServerName = "Mock server for " + HealthService.class; 49 | mockServer = InProcessServerBuilder 50 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 51 | InProcessChannelBuilder channelBuilder = 52 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 53 | stub = HealthServiceGrpc.newBlockingStub(channelBuilder.build()); 54 | } 55 | 56 | @AfterEach 57 | public void tearDown() throws Exception { 58 | mockServer.shutdownNow(); 59 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 60 | } 61 | 62 | @Test 63 | public void testHealth() { 64 | Health health = stub.getHealth(Empty.newBuilder().build()); 65 | assertThat(health.getStatus()).isNotEqualTo(Status.UNKNOWN); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /generators/app/templates/_InfoService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import com.google.protobuf.Empty; 6 | import io.grpc.Status; 7 | import org.lognet.springboot.grpc.GRpcService; 8 | import org.springframework.boot.actuate.info.InfoEndpoint; 9 | import reactor.core.publisher.Mono; 10 | 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | @GRpcService 15 | public class InfoService extends ReactorInfoServiceGrpc.InfoServiceImplBase { 16 | 17 | private final InfoEndpoint infoEndpoint; 18 | 19 | private final ObjectMapper mapper; 20 | 21 | public InfoService(InfoEndpoint infoEndpoint, ObjectMapper mapper) { 22 | this.infoEndpoint = infoEndpoint; 23 | this.mapper = mapper; 24 | } 25 | 26 | @Override 27 | public Mono getInfo(Mono request) { 28 | Map details = new HashMap<>(); 29 | infoEndpoint.info().forEach((k,v) -> { 30 | try { 31 | details.put(k, mapper.writeValueAsString(v)); 32 | } catch (JsonProcessingException e) { 33 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 34 | } 35 | }); 36 | return request.map(e -> Info.newBuilder().putAllDetails(details).build()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /generators/app/templates/_InfoServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.fasterxml.jackson.databind.ObjectMapper; 12 | import com.google.protobuf.Empty; 13 | import io.grpc.Server; 14 | import io.grpc.inprocess.InProcessChannelBuilder; 15 | import io.grpc.inprocess.InProcessServerBuilder; 16 | import org.junit.jupiter.api.AfterEach; 17 | import org.junit.jupiter.api.BeforeEach; 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.boot.actuate.info.InfoEndpoint; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.TestPropertySource; 23 | 24 | import java.io.IOException; 25 | import java.util.Map; 26 | import java.util.concurrent.TimeUnit; 27 | 28 | import static org.assertj.core.api.Assertions.assertThat; 29 | 30 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 31 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 32 | <%_ } else { _%> 33 | @SpringBootTest(classes = <%= mainClass %>.class) 34 | <%_ } _%> 35 | public class InfoServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 36 | 37 | @Autowired 38 | private InfoEndpoint infoEndpoint; 39 | 40 | @Autowired 41 | private ObjectMapper mapper; 42 | 43 | private Server mockServer; 44 | 45 | private InfoServiceGrpc.InfoServiceBlockingStub stub; 46 | 47 | @BeforeEach 48 | public void setUp() throws IOException { 49 | InfoService service = new InfoService(infoEndpoint, mapper); 50 | String uniqueServerName = "Mock server for " + InfoService.class; 51 | mockServer = InProcessServerBuilder 52 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 53 | InProcessChannelBuilder channelBuilder = 54 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 55 | stub = InfoServiceGrpc.newBlockingStub(channelBuilder.build()); 56 | } 57 | 58 | @AfterEach 59 | public void tearDown() throws Exception { 60 | mockServer.shutdownNow(); 61 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 62 | } 63 | 64 | @Test 65 | public void getInfo() { 66 | Info info = stub.getInfo(Empty.newBuilder().build()); 67 | Map map = info.getDetailsMap(); 68 | assertThat(map).containsKey("activeProfiles"); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /generators/app/templates/_JWTService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import <%= packageName %>.security.jwt.TokenProvider; 4 | 5 | import io.grpc.Status; 6 | import org.lognet.springboot.grpc.GRpcService; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 10 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 11 | import org.springframework.security.core.Authentication; 12 | import org.springframework.security.core.AuthenticationException; 13 | import org.springframework.security.core.context.SecurityContextHolder; 14 | import reactor.core.publisher.Mono; 15 | 16 | @GRpcService 17 | public class JWTService extends ReactorJWTServiceGrpc.JWTServiceImplBase { 18 | 19 | private final Logger log = LoggerFactory.getLogger(JWTService.class); 20 | 21 | private final TokenProvider tokenProvider; 22 | 23 | private final AuthenticationManagerBuilder authenticationManagerBuilder; 24 | 25 | public JWTService(TokenProvider tokenProvider, AuthenticationManagerBuilder authenticationManagerBuilder) { 26 | this.tokenProvider = tokenProvider; 27 | this.authenticationManagerBuilder = authenticationManagerBuilder; 28 | } 29 | 30 | @Override 31 | public Mono authenticate(Mono request) { 32 | return request 33 | .map( login -> { 34 | UsernamePasswordAuthenticationToken authenticationToken = 35 | new UsernamePasswordAuthenticationToken(login.getUsername(), login.getPassword()); 36 | try { 37 | Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); 38 | SecurityContextHolder.getContext().setAuthentication(authentication); 39 | return tokenProvider.createToken(authentication, login.getRememberMe()); 40 | } catch (AuthenticationException ae) { 41 | log.trace("Authentication exception", ae); 42 | throw Status.UNAUTHENTICATED.asRuntimeException(); 43 | } 44 | }) 45 | .map(jwt -> JWTToken.newBuilder().setIdToken(jwt).build()); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /generators/app/templates/_JWTServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | import <%= packageName %>.domain.User; 8 | import <%= packageName %>.repository.UserRepository; 9 | import <%= packageName %>.security.jwt.TokenProvider; 10 | 11 | import io.grpc.Server; 12 | import io.grpc.Status; 13 | import io.grpc.StatusRuntimeException; 14 | import io.grpc.inprocess.InProcessChannelBuilder; 15 | import io.grpc.inprocess.InProcessServerBuilder; 16 | import org.junit.jupiter.api.AfterEach; 17 | import org.junit.jupiter.api.BeforeEach; 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 22 | import org.springframework.security.crypto.password.PasswordEncoder; 23 | 24 | import java.io.IOException; 25 | <%_ if (databaseType === 'cassandra') { _%> 26 | import java.util.UUID; 27 | <%_ } _%> 28 | import java.util.concurrent.TimeUnit; 29 | 30 | <%_ if (databaseType === 'couchbase') { _%> 31 | import static <%= packageName %>.web.rest.TestUtil.mockAuthentication; 32 | <%_ } _%>import static org.assertj.core.api.Assertions.assertThat; 33 | import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; 34 | 35 | @SpringBootTest(classes = <%=mainClass%>.class) 36 | public class JWTServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 37 | 38 | private static final String USER_LOGIN = "user-jwt"; 39 | private static final String USER_PASSWORD = "user-jwt-password"; 40 | 41 | @Autowired 42 | private TokenProvider tokenProvider; 43 | 44 | @Autowired 45 | private AuthenticationManagerBuilder authenticationManagerBuilder; 46 | 47 | @Autowired 48 | private UserRepository userRepository; 49 | 50 | @Autowired 51 | private PasswordEncoder encoder; 52 | 53 | private Server mockServer; 54 | 55 | private JWTServiceGrpc.JWTServiceBlockingStub stub; 56 | 57 | @BeforeEach 58 | public void setUp() throws IOException { 59 | JWTService service = new JWTService(tokenProvider, authenticationManagerBuilder); 60 | String uniqueServerName = "Mock server for " + JWTService.class; 61 | mockServer = InProcessServerBuilder 62 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 63 | InProcessChannelBuilder channelBuilder = 64 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 65 | stub = JWTServiceGrpc.newBlockingStub(channelBuilder.build()); 66 | 67 | <%_ if (databaseType === 'couchbase') { _%> 68 | mockAuthentication(); 69 | <%_ } _%> 70 | userRepository.deleteAll(); 71 | User user = new User(); 72 | <%_ if (databaseType === 'cassandra') { _%> 73 | user.setId(UUID.randomUUID().toString()); 74 | <%_ } _%> 75 | user.setLogin(USER_LOGIN); 76 | user.setPassword(encoder.encode(USER_PASSWORD)); 77 | user.setActivated(true); 78 | userRepository.save<% if (databaseType === 'sql') { %>AndFlush<% } %>(user); 79 | } 80 | 81 | @AfterEach 82 | public void tearDown() throws Exception { 83 | mockServer.shutdownNow(); 84 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 85 | } 86 | 87 | @Test 88 | public void testAuthenticate() { 89 | JWTToken token = stub.authenticate(Login.newBuilder().setUsername(USER_LOGIN).setPassword(USER_PASSWORD).build()); 90 | assertThat(token.getIdToken()).isNotEmpty(); 91 | } 92 | 93 | @Test 94 | public void tesAuthenticationRefused() { 95 | try { 96 | stub.authenticate(Login.newBuilder().setUsername(USER_LOGIN).setPassword("wrong-password").build()); 97 | failBecauseExceptionWasNotThrown(StatusRuntimeException.class); 98 | } catch (StatusRuntimeException e) { 99 | assertThat(e.getStatus().getCode()).isEqualTo(Status.Code.UNAUTHENTICATED); 100 | } 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /generators/app/templates/_LoggersService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.google.protobuf.Empty; 4 | import org.lognet.springboot.grpc.GRpcService; 5 | import org.springframework.boot.logging.LogLevel; 6 | import org.springframework.boot.logging.LoggingSystem; 7 | import org.springframework.util.Assert; 8 | import reactor.core.publisher.Flux; 9 | import reactor.core.publisher.Mono; 10 | 11 | @GRpcService(interceptors = {AuthenticationInterceptor.class}) 12 | public class LoggersService extends ReactorLoggersServiceGrpc.LoggersServiceImplBase { 13 | 14 | private final LoggingSystem loggingSystem; 15 | 16 | public LoggersService(LoggingSystem loggingSystem) { 17 | Assert.notNull(loggingSystem, "LoggingSystem must not be null"); 18 | this.loggingSystem = loggingSystem; 19 | } 20 | 21 | @Override 22 | public Flux getLoggers(Mono request) { 23 | return request 24 | .flatMapIterable(e -> loggingSystem.getLoggerConfigurations()) 25 | .map(loggerConfiguration -> 26 | Logger.newBuilder() 27 | .setName(loggerConfiguration.getName()) 28 | .setLevel(loggerConfiguration.getEffectiveLevel() == null ? Level.UNDEFINED : Level.valueOf(loggerConfiguration.getEffectiveLevel().name())) 29 | .build() 30 | ); 31 | } 32 | 33 | @Override 34 | public Mono changeLevel(Mono request) { 35 | return request 36 | .doOnSuccess(logger -> this.loggingSystem.setLogLevel( 37 | logger.getName(), 38 | Level.UNDEFINED == logger.getLevel() ? null : LogLevel.valueOf(logger.getLevel().toString())) 39 | ) 40 | .map(l -> Empty.newBuilder().build()); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /generators/app/templates/_LoggersServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.google.protobuf.Empty; 12 | import io.grpc.Server; 13 | import io.grpc.inprocess.InProcessChannelBuilder; 14 | import io.grpc.inprocess.InProcessServerBuilder; 15 | import org.junit.jupiter.api.AfterEach; 16 | import org.junit.jupiter.api.BeforeEach; 17 | import org.junit.jupiter.api.Test; 18 | import org.springframework.beans.factory.annotation.Autowired; 19 | import org.springframework.boot.logging.LoggingSystem; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | import java.io.IOException; 23 | import java.util.concurrent.TimeUnit; 24 | 25 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 26 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 27 | <%_ } else { _%> 28 | @SpringBootTest(classes = <%= mainClass %>.class) 29 | <%_ } _%> 30 | public class LoggersServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 31 | 32 | @Autowired 33 | private LoggingSystem loggingSystem; 34 | 35 | private Server mockServer; 36 | 37 | private LoggersServiceGrpc.LoggersServiceBlockingStub stub; 38 | 39 | @BeforeEach 40 | public void setUp() throws IOException { 41 | LoggersService service = new LoggersService(loggingSystem); 42 | String uniqueServerName = "Mock server for " + LoggersService.class; 43 | mockServer = InProcessServerBuilder 44 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 45 | InProcessChannelBuilder channelBuilder = 46 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 47 | stub = LoggersServiceGrpc.newBlockingStub(channelBuilder.build()); 48 | } 49 | 50 | @AfterEach 51 | public void tearDown() throws Exception { 52 | mockServer.shutdownNow(); 53 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 54 | } 55 | 56 | @Test 57 | public void getAllLogs() { 58 | stub.getLoggers(Empty.newBuilder().build()); 59 | } 60 | 61 | @Test 62 | public void changeLevel() { 63 | stub.changeLevel(Logger.newBuilder().setName("ROOT").setLevel(Level.INFO).build()); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /generators/app/templates/_MetricService.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import com.codahale.metrics.MetricFilter; 4 | import com.codahale.metrics.MetricRegistry; 5 | import com.codahale.metrics.json.MetricsModule; 6 | import com.fasterxml.jackson.core.JsonProcessingException; 7 | import com.fasterxml.jackson.databind.ObjectMapper; 8 | import com.google.protobuf.Empty; 9 | import com.google.protobuf.StringValue; 10 | import io.grpc.Status; 11 | import org.lognet.springboot.grpc.GRpcService; 12 | import reactor.core.publisher.Mono; 13 | 14 | import java.util.concurrent.TimeUnit; 15 | 16 | 17 | @GRpcService(interceptors = {AuthenticationInterceptor.class}) 18 | public class MetricService extends ReactorMetricServiceGrpc.MetricServiceImplBase { 19 | 20 | private final ObjectMapper mapper; 21 | 22 | private final MetricRegistry registry; 23 | 24 | public MetricService(MetricRegistry registry) { 25 | this.registry = registry; 26 | this.mapper = (new ObjectMapper()).registerModule( 27 | new MetricsModule(TimeUnit.SECONDS, TimeUnit.SECONDS, false, MetricFilter.ALL) 28 | ); 29 | } 30 | 31 | @Override 32 | public Mono getMetrics(Mono request) { 33 | return request 34 | .map(empty -> { 35 | try { 36 | return StringValue.newBuilder().setValue(mapper.writeValueAsString(registry)).build(); 37 | } catch (JsonProcessingException e) { 38 | throw Status.INTERNAL.withCause(e).asRuntimeException(); 39 | } 40 | }); 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /generators/app/templates/_MetricServiceIntTest.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | <%_ if (databaseType === 'cassandra') { _%> 4 | import <%= packageName %>.AbstractCassandraTest; 5 | <%_ } _%> 6 | import <%= packageName %>.<%=mainClass%>; 7 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 8 | import <%= packageName %>.config.SecurityBeanOverrideConfiguration; 9 | <%_ } _%> 10 | 11 | import com.codahale.metrics.MetricRegistry; 12 | import com.google.protobuf.Empty; 13 | import io.grpc.Server; 14 | import io.grpc.inprocess.InProcessChannelBuilder; 15 | import io.grpc.inprocess.InProcessServerBuilder; 16 | import org.junit.jupiter.api.AfterEach; 17 | import org.junit.jupiter.api.BeforeEach; 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.boot.test.context.SpringBootTest; 21 | 22 | import java.io.IOException; 23 | import java.util.concurrent.TimeUnit; 24 | 25 | import static org.assertj.core.api.Assertions.assertThat; 26 | 27 | <%_ if (authenticationType === 'uaa' && applicationType !== 'uaa') { _%> 28 | @SpringBootTest(classes = {SecurityBeanOverrideConfiguration.class, <%= mainClass %>.class}) 29 | <%_ } else { _%> 30 | @SpringBootTest(classes = <%= mainClass %>.class) 31 | <%_ } _%> 32 | public class MetricServiceIntTest <% if (databaseType === 'cassandra') { %>extends AbstractCassandraTest <% } %>{ 33 | 34 | @Autowired 35 | private MetricRegistry registry; 36 | 37 | private Server mockServer; 38 | 39 | private MetricServiceGrpc.MetricServiceBlockingStub stub; 40 | 41 | @BeforeEach 42 | public void setUp() throws IOException { 43 | MetricService service = new MetricService(registry); 44 | String uniqueServerName = "Mock server for " + MetricService.class; 45 | mockServer = InProcessServerBuilder 46 | .forName(uniqueServerName).directExecutor().addService(service).build().start(); 47 | InProcessChannelBuilder channelBuilder = 48 | InProcessChannelBuilder.forName(uniqueServerName).directExecutor(); 49 | stub = MetricServiceGrpc.newBlockingStub(channelBuilder.build()); 50 | } 51 | 52 | @AfterEach 53 | public void tearDown() throws Exception { 54 | mockServer.shutdownNow(); 55 | mockServer.awaitTermination(10, TimeUnit.SECONDS); 56 | } 57 | 58 | @Test 59 | public void testGetMetrics() { 60 | assertThat(stub.getMetrics(Empty.newBuilder().build()).getValue()).isNotEmpty(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /generators/app/templates/_UserProtoMapper.java: -------------------------------------------------------------------------------- 1 | package <%= packageName %>.grpc; 2 | 3 | import <%= packageName %>.domain.User; 4 | import <%= packageName %>.service.dto.UserDTO; 5 | 6 | import org.mapstruct.*; 7 | 8 | import java.util.HashSet; 9 | 10 | @Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, uses = {ProtobufMappers.class}) 11 | public interface UserProtoMapper { 12 | 13 | @Mapping(target = "firstName", ignore = true) 14 | @Mapping(target = "lastName", ignore = true) 15 | <%_ if (databaseType == 'mongodb' || databaseType == 'sql') { _%> 16 | @Mapping(target = "imageUrl", ignore = true) 17 | <%_ } _%> 18 | @Mapping(target = "langKey", ignore = true) 19 | UserDTO userProtoToUserDTO(UserProto userProto); 20 | 21 | @AfterMapping 22 | default void userProtoToUserDTO(UserProto userProto, @MappingTarget UserDTO userDTO) { 23 | userDTO.setFirstName(userProto.getFirstName().isEmpty() ? null : userProto.getFirstName()); 24 | userDTO.setLastName(userProto.getLastName().isEmpty() ? null : userProto.getLastName()); 25 | <%_ if (databaseType == 'mongodb' || databaseType == 'sql') { _%> 26 | userDTO.setImageUrl(userProto.getImageUrl().isEmpty() ? null : userProto.getImageUrl()); 27 | <%_ } _%> 28 | userDTO.setLangKey(userProto.getLangKey().isEmpty() ? null : userProto.getLangKey()); 29 | userDTO.setAuthorities(new HashSet<>(userProto.getAuthoritiesList())); 30 | } 31 | 32 | default UserProto userDTOToUserProto(UserDTO userDTO) { 33 | if (userDTO == null) { 34 | return null; 35 | } 36 | UserProto.Builder builder = userDTOToUserProtoBuilder(userDTO); 37 | // Authorities were not mapped because the method name doesn't match javabean setter names. 38 | if (userDTO.getAuthorities() != null) { 39 | builder.addAllAuthorities(userDTO.getAuthorities()); 40 | } 41 | return builder.build(); 42 | } 43 | 44 | default UserProto.Builder createUserProto () { 45 | return UserProto.newBuilder(); 46 | } 47 | 48 | UserProto.Builder userDTOToUserProtoBuilder (UserDTO userDTO); 49 | 50 | default UserProto userToUserProto(User user) { 51 | if (user == null) { 52 | return null; 53 | } 54 | return userToUserProtoBuilder(user).build(); 55 | } 56 | 57 | <%_ if (authenticationType !== 'oauth2') { _%> 58 | @Mapping(target = "password", ignore = true) 59 | <%_ } _%> 60 | @Mapping(target = "resetKey", ignore = true) 61 | UserProto.Builder userToUserProtoBuilder (User user); 62 | 63 | default User userFromId(<% if (databaseType === 'sql' && authenticationType !== 'oauth2') { %>Long<% } else { %>String<% } %> id) { 64 | if (id == null) { 65 | return null; 66 | } 67 | User user = new User(); 68 | user.setId(id); 69 | return user; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /generators/app/templates/_account.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | import "google/protobuf/wrappers.proto"; 8 | <%_ if (authenticationType === 'session') { _%> 9 | <%_ if (databaseType === 'cassandra') { _%> 10 | import "google/protobuf/timestamp.proto"; 11 | <%_ } else { _%> 12 | import "util/date.proto"; 13 | <%_ } _%> 14 | <%_ } _%> 15 | import "<%= packageFolder %>/user.proto"; 16 | 17 | package <%= packageName %>; 18 | 19 | service AccountService { 20 | rpc IsAuthenticated(google.protobuf.Empty) returns (google.protobuf.StringValue); 21 | rpc GetAccount(google.protobuf.Empty) returns (UserProto); 22 | <%_ if (authenticationType !== 'oauth2') { _%> 23 | rpc RegisterAccount(UserProto) returns (google.protobuf.Empty); 24 | rpc ActivateAccount(google.protobuf.StringValue) returns (UserProto); 25 | rpc SaveAccount(UserProto) returns (google.protobuf.Empty); 26 | rpc ChangePassword(PasswordChange) returns (google.protobuf.Empty); 27 | rpc RequestPasswordReset(google.protobuf.StringValue) returns (google.protobuf.Empty); 28 | rpc FinishPasswordReset(KeyAndPassword) returns (google.protobuf.Empty); 29 | <%_ } _%> 30 | <%_ if (authenticationType === 'session') { _%> 31 | rpc GetCurrentSessions(google.protobuf.Empty) returns (stream PersistentToken); 32 | rpc InvalidateSession(google.protobuf.StringValue) returns (google.protobuf.Empty); 33 | <%_ } _%> 34 | } 35 | 36 | <%_ if (authenticationType === 'session') { _%> 37 | message PersistentToken { 38 | string series = 1;<% if (databaseType === 'cassandra') { %> 39 | google.protobuf.Timestamp token_date = 2;<% } else { %> 40 | util.Date token_date = 2;<% } %> 41 | string ip_address = 3; 42 | string user_agent = 4; 43 | } 44 | 45 | <%_ } _%> 46 | <%_ if (authenticationType !== 'oauth2') { _%> 47 | message PasswordChange { 48 | string current_password = 1; 49 | string new_password =2; 50 | } 51 | 52 | message KeyAndPassword { 53 | string key = 1; 54 | string new_password =2; 55 | } 56 | <%_ } _%> 57 | -------------------------------------------------------------------------------- /generators/app/templates/_audit.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/timestamp.proto"; 7 | import "google/protobuf/wrappers.proto"; 8 | import "util/date.proto"; 9 | import "util/pagination.proto"; 10 | 11 | package <%= packageName %>; 12 | 13 | service AuditService { 14 | rpc getAuditEvents(AuditRequest) returns (stream AuditEvent); 15 | rpc getAuditEvent(google.protobuf.<% if (databaseType === 'sql') { %>Int64Value<% } %><% if (databaseType === 'mongodb' || databaseType === 'couchbase') { %>StringValue<% } %>) returns (AuditEvent); 16 | } 17 | 18 | message AuditRequest { 19 | util.PageRequest pagination_params = 1; 20 | util.Date from_date = 2; 21 | util.Date to_date = 3; 22 | } 23 | 24 | message AuditEvent { 25 | google.protobuf.Timestamp timestamp = 1; 26 | string principal = 2; 27 | string type = 3; 28 | string data = 4; 29 | } 30 | -------------------------------------------------------------------------------- /generators/app/templates/_configprops.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | package <%= packageName %>; 9 | 10 | service ConfigurationPropertiesReportService { 11 | rpc GetConfigurationProperties(google.protobuf.Empty) returns (ApplicationConfigurationProperties); 12 | } 13 | 14 | message ApplicationConfigurationProperties { 15 | map contexts = 1; 16 | } 17 | 18 | message ContextConfigurationProperties { 19 | map beans = 1; 20 | string parentId = 2; 21 | } 22 | 23 | message ConfigurationPropertiesBean { 24 | string prefix = 1; 25 | map properties = 2; 26 | } 27 | -------------------------------------------------------------------------------- /generators/app/templates/_date.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | option java_outer_classname = "DateProto"; 6 | 7 | package util; 8 | 9 | message Date { 10 | int32 year = 1; 11 | uint32 month = 2; 12 | uint32 day = 3; 13 | } 14 | -------------------------------------------------------------------------------- /generators/app/templates/_decimal.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | option java_outer_classname = "DecimalProto"; 6 | 7 | package util; 8 | 9 | message Decimal { 10 | int64 unscaledVal = 1; 11 | int32 scale = 2; 12 | } 13 | -------------------------------------------------------------------------------- /generators/app/templates/_environment.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | package <%= packageName %>; 9 | 10 | service EnvironmentService { 11 | rpc GetEnv(google.protobuf.Empty) returns (Environment); 12 | } 13 | 14 | message Environment { 15 | repeated string activeProfiles = 1; 16 | repeated PropertySource propertySources = 2; 17 | } 18 | 19 | message PropertySource { 20 | string name = 1; 21 | map properties = 2; 22 | } 23 | 24 | message PropertyValue { 25 | string origin = 1; 26 | string value = 2; 27 | } 28 | -------------------------------------------------------------------------------- /generators/app/templates/_grpc.gradle: -------------------------------------------------------------------------------- 1 | protobuf { 2 | protoc { 3 | // The artifact spec for the Protobuf Compiler 4 | artifact = "com.google.protobuf:protoc:<%= protocVersion %>" 5 | } 6 | clean { 7 | delete protobuf.generatedFilesBaseDir 8 | } 9 | plugins { 10 | grpc { 11 | artifact = "io.grpc:protoc-gen-grpc-java:<%= grpcVersion %>" 12 | } 13 | reactor { 14 | artifact = "com.salesforce.servicelibs:reactor-grpc:<%= reactiveGrpcVersion %>" 15 | } 16 | } 17 | generateProtoTasks { 18 | all()*.plugins { 19 | grpc { } 20 | reactor {} 21 | } 22 | } 23 | } 24 | 25 | sourceSets.main.java.srcDir new File(buildDir, 'generated/source/proto/main/grpc') 26 | sourceSets.main.java.srcDir new File(buildDir, 'generated/source/proto/main/reactor') 27 | sourceSets.main.java.srcDir new File(buildDir, 'generated/source/proto/main/java') 28 | idea { 29 | module { 30 | generatedSourceDirs += file("build/generated/source/proto/main/grpc") 31 | generatedSourceDirs += file("build/generated/source/proto/main/reactor") 32 | generatedSourceDirs += file("build/generated/source/proto/main/java") 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /generators/app/templates/_health.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | package <%= packageName %>; 9 | 10 | service HealthService { 11 | rpc GetHealth(google.protobuf.Empty) returns (Health); 12 | } 13 | 14 | enum Status { 15 | UNKNOWN = 0; 16 | UP = 1; 17 | DOWN = 2; 18 | OUT_OF_SERVICE = 3; 19 | } 20 | 21 | message HealthIndicator { 22 | Status status = 1; 23 | map details = 2; 24 | } 25 | 26 | message Health { 27 | Status status = 1; 28 | map healthIndicators = 2; 29 | } 30 | -------------------------------------------------------------------------------- /generators/app/templates/_info.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | package <%= packageName %>; 9 | 10 | service InfoService { 11 | rpc GetInfo(google.protobuf.Empty) returns (Info); 12 | } 13 | 14 | message Info { 15 | map details = 1; 16 | } 17 | -------------------------------------------------------------------------------- /generators/app/templates/_jwt.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | package <%= packageName %>; 7 | 8 | service JWTService { 9 | rpc Authenticate(Login) returns (JWTToken); 10 | } 11 | 12 | message Login { 13 | string username = 1; 14 | string password = 2; 15 | bool remember_me = 3; 16 | } 17 | 18 | message JWTToken { 19 | string id_token = 1; 20 | } 21 | -------------------------------------------------------------------------------- /generators/app/templates/_loggers.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | 8 | package <%= packageName %>; 9 | 10 | service LoggersService { 11 | rpc GetLoggers(google.protobuf.Empty) returns (stream Logger); 12 | rpc ChangeLevel(Logger) returns (google.protobuf.Empty); 13 | } 14 | 15 | enum Level { 16 | UNDEFINED = 0; 17 | OFF = 1; 18 | FATAL = 2; 19 | ERROR = 3; 20 | WARN = 4; 21 | INFO = 5; 22 | DEBUG = 6; 23 | TRACE = 7; 24 | ALL = 8; 25 | } 26 | 27 | message Logger { 28 | string name = 1; 29 | Level level = 2; 30 | } 31 | -------------------------------------------------------------------------------- /generators/app/templates/_metric.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | import "google/protobuf/wrappers.proto"; 8 | 9 | package <%= packageName %>; 10 | 11 | service MetricService { 12 | rpc GetMetrics(google.protobuf.Empty) returns (google.protobuf.StringValue); 13 | } 14 | -------------------------------------------------------------------------------- /generators/app/templates/_pagination.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | option java_outer_classname = "PageRequestProto"; 6 | 7 | package util; 8 | 9 | enum Direction { 10 | ASC = 0; 11 | DESC = 1; 12 | } 13 | 14 | message Order { 15 | Direction direction = 1; 16 | string property = 2; 17 | } 18 | 19 | message PageRequest { 20 | int32 page = 1; 21 | int32 size = 2; 22 | repeated Order orders = 3; 23 | } 24 | -------------------------------------------------------------------------------- /generators/app/templates/_queryfilters.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "util/pagination.proto"; 7 | 8 | package util; 9 | 10 | message QueryFilter { 11 | string property = 1; 12 | string value = 2; 13 | } 14 | 15 | message PageRequestAndFilters { 16 | PageRequest page_request = 1; 17 | repeated QueryFilter query_filters = 2; 18 | } 19 | -------------------------------------------------------------------------------- /generators/app/templates/_user.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_multiple_files = true; 4 | option java_package = "<%= packageName %>.grpc"; 5 | 6 | import "google/protobuf/empty.proto"; 7 | import "google/protobuf/timestamp.proto"; 8 | import "google/protobuf/wrappers.proto"; 9 | <%_ if (['sql', 'mongodb', 'couchbase'].includes(databaseType)) { _%> 10 | import "util/pagination.proto"; 11 | <%_ } _%> 12 | 13 | package <%= packageName %>; 14 | 15 | service UserService { 16 | <%_ if (authenticationType !== 'oauth2') { _%> 17 | // Create a new User. 18 | // request : the UserProto to create 19 | // response : the created UserProto or a ALREADY_EXISTS error 20 | rpc CreateUser (UserProto) returns (UserProto); 21 | 22 | // Update or create a User. 23 | // request : the UserProto to update or create 24 | // response : the updated UserProto 25 | rpc UpdateUser (UserProto) returns (UserProto); 26 | 27 | <%_ } _%> 28 | // Get all the Users. 29 | // response : the list of UserProtos 30 | rpc GetAllUsers (<% if (['sql', 'mongodb', 'couchbase'].includes(databaseType)) { %>util.PageRequest<% } else { %>google.protobuf.Empty<% } %>) returns (stream UserProto); 31 | 32 | // Get a User from it's id. 33 | // request : the id of the UserProto to retrieve 34 | // response : the UserProto or a NOT_FOUND error 35 | rpc GetUser (google.protobuf.StringValue) returns (UserProto); 36 | <%_ if (authenticationType !== 'oauth2') { _%> 37 | 38 | // Delete a User from it's id. 39 | // request : the id of the UserProto to delete 40 | // response : empty or a NOT_FOUND error 41 | rpc DeleteUser (google.protobuf.StringValue) returns (google.protobuf.Empty); 42 | <%_ } _%> 43 | <%_ if (['sql', 'mongodb', 'couchbase'].includes(databaseType)) { _%> 44 | 45 | // Get all authorities 46 | // request : empty 47 | // response : the list of existing roles 48 | rpc GetAllAuthorities (google.protobuf.Empty) returns (stream google.protobuf.StringValue); 49 | <%_ } _%> 50 | <%_ if (searchEngine === 'elasticsearch') { _%> 51 | 52 | // Search for the user corresponding to the query. 53 | // request : the query of the user search 54 | // response : the list of userProtos 55 | rpc SearchUsers(UserSearchPageRequest) returns (stream UserProto); 56 | } 57 | 58 | message UserSearchPageRequest { 59 | google.protobuf.StringValue query = 1; 60 | util.PageRequest page_request = 2; 61 | <%_ } _%> 62 | } 63 | 64 | message UserProto { 65 | oneof id_oneof { 66 | <%=idProtoType%> id = 1; 67 | } 68 | string login = 2; 69 | <%_ if (authenticationType !== 'oauth2') { _%> 70 | string password = 3; 71 | <%_ } _%> 72 | string first_name = 4; 73 | string last_name = 5; 74 | string email = 6; 75 | bool activated = 7; 76 | string lang_key = 8; 77 | repeated string authorities = 9; 78 | string reset_key = 10; 79 | google.protobuf.Timestamp reset_date = 11; 80 | <%_ if (databaseType !== 'cassandra') { _%> 81 | string image_url = 12; 82 | string created_by = 13; 83 | google.protobuf.Timestamp created_date = 14; 84 | string last_modified_by = 15; 85 | google.protobuf.Timestamp last_modified_date = 16; 86 | <%_ } _%> 87 | } 88 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-jhipster-grpc", 3 | "version": "0.22.0", 4 | "description": "Adds support for gRPC and generates gRPC CRUD services", 5 | "keywords": [ 6 | "yeoman-generator", 7 | "jhipster-module", 8 | "grpc" 9 | ], 10 | "homepage": "https://github.com/cbornet/generator-jhipster-grpc", 11 | "author": { 12 | "name": "Christophe Bornet", 13 | "email": "cbornet@hotmail.com" 14 | }, 15 | "files": [ 16 | "generators" 17 | ], 18 | "main": "generators/app/index.js", 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/cbornet/generator-jhipster-grpc.git" 22 | }, 23 | "dependencies": { 24 | "chalk": "3.0.0", 25 | "generator-jhipster": "6.6.0", 26 | "lodash": "4.17.15", 27 | "mkdirp": "0.5.1", 28 | "pluralize": "8.0.0", 29 | "yeoman-generator": "4.4.0" 30 | }, 31 | "devDependencies": { 32 | "eslint": "6.8.0", 33 | "eslint-config-airbnb-base": "14.0.0", 34 | "eslint-plugin-import": "2.19.1", 35 | "fs-extra": "8.1.0", 36 | "mocha": "7.0.0", 37 | "yeoman-assert": "3.1.1", 38 | "yeoman-test": "2.1.0" 39 | }, 40 | "scripts": { 41 | "pretest": "eslint .", 42 | "lint": "eslint .", 43 | "lint-fix": "eslint . --fix", 44 | "release": "git push && git push --tags && npm publish", 45 | "release:patch": "npm version patch -a -m \"Update to %s\" && npm run release", 46 | "release:minor": "npm version minor -a -m \"Update to %s\" && npm run release", 47 | "release:major": "npm version major -a -m \"Update to %s\" && npm run release", 48 | "test": "mocha test/*" 49 | }, 50 | "license": "Apache-2.0", 51 | "bugs": { 52 | "url": "https://github.com/cbornet/generator-jhipster-grpc/issues" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /test-integration/configstore/insight-generator-jhipster.json: -------------------------------------------------------------------------------- 1 | { 2 | "clientId": 495049364328, 3 | "optOut": true 4 | } 5 | -------------------------------------------------------------------------------- /test-integration/configstore/insight-yo.json: -------------------------------------------------------------------------------- 1 | { 2 | "clientId": 495049364328, 3 | "optOut": true 4 | } 5 | -------------------------------------------------------------------------------- /test-integration/generate-sample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | trap ctrl_c INT 6 | 7 | function ctrl_c() { 8 | exit 1 9 | } 10 | 11 | function usage() { 12 | me=$(basename "$0") 13 | echo 14 | echo "Usage: $me generate [sql|sqllight|sqlfull|micro|uaa|mongodb|cassandra|couchbase] | list" 15 | echo 16 | echo "Examples:" 17 | echo "$me generate /tmp/ngx-default/ ngx-default sql" 18 | echo "$me generate /tmp/ngx-default/ ngx-session-cassandra-fr cassandra" 19 | echo 20 | exit 2 21 | } 22 | 23 | function generateProject() { 24 | cd "$mydir" 25 | 26 | echo "JHI_FOLDER_APP=$JHI_FOLDER_APP" 27 | echo "JHI_APP=$JHI_APP" 28 | echo "JHI_ENTITY=$JHI_ENTITY" 29 | 30 | if [ ! -d "$JHI_FOLDER_APP" ]; then 31 | echo "*** Create $JHI_FOLDER_APP" 32 | mkdir -p "$JHI_FOLDER_APP" 33 | fi 34 | if [ ! -z "$(ls -A $JHI_FOLDER_APP)" ]; then 35 | echo "*** The folder is not empty: $JHI_FOLDER_APP" 36 | exit 1 37 | else 38 | mkdir -p "$JHI_FOLDER_APP"/.jhipster/ 39 | echo "*** Empty folder, let's generate JHipster project in: $JHI_FOLDER_APP" 40 | fi 41 | 42 | pushd scripts/ 43 | echo "*********************** Copying entities for $JHI_APP" 44 | source ./11-generate-entities.sh 45 | popd 46 | 47 | echo "*********************** Copy configuration" 48 | cp -f "$JHI_SAMPLES"/"$JHI_APP"/.yo-rc.json "$JHI_FOLDER_APP"/ 49 | ls -al "$JHI_FOLDER_APP"/ 50 | } 51 | 52 | mydir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 53 | JHI_SAMPLES="$mydir/samples" 54 | 55 | if [ "$1" = "list" ]; then 56 | for dir in $(ls -1 "$JHI_SAMPLES"); do 57 | if [ -f "$JHI_SAMPLES/$dir/.yo-rc.json" ] && [[ $dir != *-sample ]]; then 58 | echo "$dir" 59 | fi 60 | done 61 | 62 | elif [ "$1" = "generate" ]; then 63 | if [ "$3" != "" ]; then 64 | JHI_FOLDER_APP=$2 65 | JHI_APP=$3 66 | JHI_ENTITY=$4 67 | generateProject 68 | else 69 | usage 70 | fi 71 | 72 | else 73 | usage 74 | fi 75 | -------------------------------------------------------------------------------- /test-integration/samples/.gitignore: -------------------------------------------------------------------------------- 1 | */* 2 | !*/.yo-rc.json 3 | !*/*.jdl 4 | !.jhipster/* 5 | *-sample/.yo-rc.json 6 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/BankAccount.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "user", 6 | "otherEntityName": "user", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "login" 9 | }, 10 | { 11 | "relationshipName": "operation", 12 | "otherEntityName": "operation", 13 | "relationshipType": "one-to-many", 14 | "otherEntityRelationshipName": "bankAccount" 15 | } 16 | ], 17 | "fields": [ 18 | { 19 | "fieldName": "name", 20 | "fieldType": "String", 21 | "fieldValidateRules": [ 22 | "required" 23 | ] 24 | }, 25 | { 26 | "fieldName": "guid", 27 | "fieldType": "UUID" 28 | }, 29 | { 30 | "fieldName": "bankNumber", 31 | "fieldType": "Integer" 32 | }, 33 | { 34 | "fieldName": "agencyNumber", 35 | "fieldType": "Long" 36 | }, 37 | { 38 | "fieldName": "lastOperationDuration", 39 | "fieldType": "Float" 40 | }, 41 | { 42 | "fieldName": "meanOperationDuration", 43 | "fieldType": "Double" 44 | }, 45 | { 46 | "fieldName": "balance", 47 | "fieldType": "BigDecimal", 48 | "fieldValidateRules": [ 49 | "required" 50 | ] 51 | }, 52 | { 53 | "fieldName": "openingDay", 54 | "fieldType": "LocalDate" 55 | }, 56 | { 57 | "fieldName": "lastOperationDate", 58 | "fieldType": "Instant" 59 | }, 60 | { 61 | "fieldName": "active", 62 | "fieldType": "Boolean" 63 | }, 64 | { 65 | "fieldName": "accountType", 66 | "fieldType": "BankAccountType", 67 | "fieldValues": "CHECKING,SAVINGS,LOAN" 68 | }, 69 | { 70 | "fieldName": "attachment", 71 | "fieldType": "byte[]", 72 | "fieldTypeBlobContent": "any" 73 | }, 74 | { 75 | "fieldName": "description", 76 | "fieldType": "byte[]", 77 | "fieldTypeBlobContent": "text" 78 | } 79 | ], 80 | "changelogDate": "20150805124838", 81 | "dto": "mapstruct", 82 | "pagination": "no", 83 | "jpaMetamodelFiltering": true, 84 | "service": "serviceImpl", 85 | "angularJSSuffix": "mySuffix", 86 | "clientRootFolder": "test-root" 87 | } 88 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/CassBankAccount.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "fields": [ 4 | { 5 | "fieldName": "userId", 6 | "fieldType": "UUID" 7 | }, 8 | { 9 | "fieldName": "name", 10 | "fieldType": "String", 11 | "fieldValidateRules": [ 12 | "required" 13 | ] 14 | }, 15 | { 16 | "fieldName": "bankNumber", 17 | "fieldType": "Integer" 18 | }, 19 | { 20 | "fieldName": "agencyNumber", 21 | "fieldType": "Long" 22 | }, 23 | { 24 | "fieldName": "lastOperationDuration", 25 | "fieldType": "Float" 26 | }, 27 | { 28 | "fieldName": "meanOperationDuration", 29 | "fieldType": "Double" 30 | }, 31 | { 32 | "fieldName": "balance", 33 | "fieldType": "BigDecimal", 34 | "fieldValidateRules": [ 35 | "required" 36 | ] 37 | }, 38 | { 39 | "fieldName": "lastOperationDate", 40 | "fieldType": "Date" 41 | }, 42 | { 43 | "fieldName": "active", 44 | "fieldType": "Boolean" 45 | }, 46 | { 47 | "fieldName": "picture", 48 | "fieldType": "ByteBuffer", 49 | "fieldTypeBlobContent": "image", 50 | "fieldValidateRules": [ 51 | "required" 52 | ] 53 | }, 54 | { 55 | "fieldName": "operationsFile", 56 | "fieldType": "ByteBuffer" 57 | }, 58 | { 59 | "fieldName": "accountType", 60 | "fieldType": "AccountTypeEnum", 61 | "fieldValues": "STANDARD,PREMIUM" 62 | } 63 | ], 64 | "changelogDate": "20150805124838", 65 | "dto": "mapstruct", 66 | "service": "serviceImpl", 67 | "angularJSSuffix": "mySuffix", 68 | "pagination": "no" 69 | } 70 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/Division.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipType": "one-to-many", 6 | "relationshipName": "divisionsPlace", 7 | "otherEntityName": "place", 8 | "otherEntityRelationshipName": "owner" 9 | }, 10 | { 11 | "relationshipType": "many-to-many", 12 | "relationshipName": "preferredPlace", 13 | "otherEntityName": "place", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "preferredDivision" 16 | } 17 | ], 18 | "fields": [ 19 | { 20 | "fieldName": "name", 21 | "fieldType": "String", 22 | "fieldValidateRules": [ 23 | "required", 24 | "unique" 25 | ] 26 | }, 27 | { 28 | "fieldName": "shortName", 29 | "fieldType": "String", 30 | "fieldValidateRules": [ 31 | "unique" 32 | ] 33 | }, 34 | { 35 | "fieldName": "numberOfPeople", 36 | "fieldType": "Long" 37 | }, 38 | { 39 | "fieldName": "divisionType", 40 | "fieldType": "DivisionType", 41 | "fieldValues": "SCHOOL,CLASS,SUBGROUP", 42 | "fieldValidateRules": [ 43 | "required" 44 | ] 45 | }, 46 | { 47 | "fieldName": "colorBackground", 48 | "fieldType": "String" 49 | }, 50 | { 51 | "fieldName": "colorText", 52 | "fieldType": "String" 53 | } 54 | ], 55 | "changelogDate": "20170626061520", 56 | "entityTableName": "division", 57 | "dto": "no", 58 | "pagination": "no", 59 | "service": "serviceImpl", 60 | "clientRootFolder": "test-root" 61 | } 62 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/DocumentBankAccount.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "fields": [ 4 | { 5 | "fieldName": "name", 6 | "fieldType": "String", 7 | "fieldValidateRules": [ 8 | "required" 9 | ] 10 | }, 11 | { 12 | "fieldName": "bankNumber", 13 | "fieldType": "Integer" 14 | }, 15 | { 16 | "fieldName": "agencyNumber", 17 | "fieldType": "Long" 18 | }, 19 | { 20 | "fieldName": "lastOperationDuration", 21 | "fieldType": "Float" 22 | }, 23 | { 24 | "fieldName": "meanOperationDuration", 25 | "fieldType": "Double" 26 | }, 27 | { 28 | "fieldName": "balance", 29 | "fieldType": "BigDecimal", 30 | "fieldValidateRules": [ 31 | "required" 32 | ] 33 | }, 34 | { 35 | "fieldName": "openingDay", 36 | "fieldType": "LocalDate" 37 | }, 38 | { 39 | "fieldName": "lastOperationDate", 40 | "fieldType": "Instant" 41 | }, 42 | { 43 | "fieldName": "active", 44 | "fieldType": "Boolean" 45 | }, 46 | { 47 | "fieldName": "accountType", 48 | "fieldType": "BankAccountType", 49 | "fieldValues": "CHECKING,SAVINGS,LOAN" 50 | }, 51 | { 52 | "fieldName": "attachment", 53 | "fieldType": "byte[]", 54 | "fieldTypeBlobContent": "any" 55 | }, 56 | { 57 | "fieldName": "description", 58 | "fieldType": "byte[]", 59 | "fieldTypeBlobContent": "text" 60 | } 61 | ], 62 | "changelogDate": "20150805124838", 63 | "dto": "mapstruct", 64 | "service": "serviceImpl", 65 | "pagination": "no" 66 | } 67 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "emma", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123735", 11 | "entityTableName": "entity_with_dto", 12 | "dto": "mapstruct", 13 | "pagination": "no", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithPagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "nathan", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123738", 11 | "entityTableName": "entity_with_pagination", 12 | "dto": "no", 13 | "pagination": "pagination", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithPaginationAndDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "lea", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123743", 11 | "entityTableName": "entity_with_pagination_and_dto", 12 | "dto": "mapstruct", 13 | "pagination": "pagination", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceClass.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "zoe", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123736", 11 | "entityTableName": "entity_with_service_class", 12 | "dto": "no", 13 | "pagination": "no", 14 | "service": "serviceClass" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceClassAndDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "lucas", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123741", 11 | "entityTableName": "entity_with_service_class_and_dto", 12 | "dto": "mapstruct", 13 | "pagination": "no", 14 | "service": "serviceClass" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceClassAndPagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "enzo", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123739", 11 | "entityTableName": "entity_with_service_class_and_pagination", 12 | "dto": "no", 13 | "pagination": "pagination", 14 | "service": "serviceClass" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceClassPaginationAndDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "lena", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123744", 11 | "entityTableName": "entity_with_service_class_pagination_and_dto", 12 | "dto": "mapstruct", 13 | "pagination": "pagination", 14 | "service": "serviceClass" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceImpl.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "clara", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123737", 11 | "entityTableName": "entity_with_service_impl", 12 | "dto": "no", 13 | "pagination": "no", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceImplAndDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "louis", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123742", 11 | "entityTableName": "entity_with_service_impl_and_dto", 12 | "dto": "mapstruct", 13 | "pagination": "no", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceImplAndPagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "hugo", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123740", 11 | "entityTableName": "entity_with_service_impl_and_pagination", 12 | "dto": "no", 13 | "pagination": "pagination", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/EntityWithServiceImplPaginationAndDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [], 4 | "fields": [ 5 | { 6 | "fieldName": "theo", 7 | "fieldType": "String" 8 | } 9 | ], 10 | "changelogDate": "20160806123745", 11 | "entityTableName": "entity_with_service_impl_pagination_and_dto", 12 | "dto": "mapstruct", 13 | "pagination": "pagination", 14 | "service": "serviceImpl" 15 | } 16 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/Label.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "operation", 6 | "otherEntityName": "operation", 7 | "relationshipType": "many-to-many", 8 | "ownerSide": false, 9 | "otherEntityRelationshipName": "label" 10 | } 11 | ], 12 | "fields": [ 13 | { 14 | "fieldName": "labelName", 15 | "fieldType": "String", 16 | "fieldValidateRules": [ 17 | "required", 18 | "minlength" 19 | ], 20 | "fieldValidateRulesMinlength": "3" 21 | } 22 | ], 23 | "changelogDate": "20150805124936", 24 | "dto": "no", 25 | "pagination": "pagination", 26 | "service": "serviceClass", 27 | "clientRootFolder": "test-root", 28 | "readOnly": true 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MapsIdChildEntityWithDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "clientRootFolder": "", 4 | "relationships": [ 5 | { 6 | "relationshipName": "mapsIdParentEntityWithDTO", 7 | "otherEntityName": "mapsIdParentEntityWithDTO", 8 | "relationshipType": "one-to-one", 9 | "otherEntityField": "id", 10 | "ownerSide": true, 11 | "useJPADerivedIdentifier": true, 12 | "otherEntityRelationshipName": "mapsIdChildEntityWithDTO" 13 | } 14 | ], 15 | "fields": [ 16 | { 17 | "fieldName": "date", 18 | "fieldType": "Instant" 19 | } 20 | ], 21 | "changelogDate": "20190117075155", 22 | "dto": "mapstruct", 23 | "searchEngine": false, 24 | "service": "serviceImpl", 25 | "entityTableName": "maps_id_child_entity_withdto", 26 | "databaseType": "sql", 27 | "jpaMetamodelFiltering": false, 28 | "pagination": "no" 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MapsIdChildEntityWithoutDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "clientRootFolder": "", 4 | "relationships": [ 5 | { 6 | "relationshipName": "mapsIdParentEntityWithoutDTO", 7 | "otherEntityName": "mapsIdParentEntityWithoutDTO", 8 | "relationshipType": "one-to-one", 9 | "otherEntityField": "id", 10 | "ownerSide": true, 11 | "useJPADerivedIdentifier": true, 12 | "otherEntityRelationshipName": "mapsIdChildEntityWithoutDTO" 13 | } 14 | ], 15 | "fields": [ 16 | { 17 | "fieldName": "date", 18 | "fieldType": "Instant" 19 | } 20 | ], 21 | "changelogDate": "20190117074746", 22 | "dto": "no", 23 | "searchEngine": false, 24 | "service": "serviceImpl", 25 | "entityTableName": "child_entity_wo_dto", 26 | "databaseType": "sql", 27 | "jpaMetamodelFiltering": false, 28 | "pagination": "no" 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MapsIdParentEntityWithDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "clientRootFolder": "", 4 | "relationships": [ 5 | { 6 | "relationshipName": "mapsIdChildEntityWithDTO", 7 | "otherEntityName": "mapsIdChildEntityWithDTO", 8 | "relationshipType": "one-to-one", 9 | "ownerSide": false, 10 | "otherEntityRelationshipName": "mapsIdParentEntityWithDTO" 11 | } 12 | ], 13 | "fields": [ 14 | { 15 | "fieldName": "name", 16 | "fieldType": "String" 17 | } 18 | ], 19 | "changelogDate": "20190117075042", 20 | "dto": "mapstruct", 21 | "searchEngine": false, 22 | "service": "serviceImpl", 23 | "entityTableName": "maps_id_parent_entity_withdto", 24 | "databaseType": "sql", 25 | "jpaMetamodelFiltering": false, 26 | "pagination": "no" 27 | } 28 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MapsIdParentEntityWithoutDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "clientRootFolder": "", 4 | "relationships": [ 5 | { 6 | "relationshipName": "mapsIdChildEntityWithoutDTO", 7 | "otherEntityName": "mapsIdChildEntityWithoutDTO", 8 | "relationshipType": "one-to-one", 9 | "ownerSide": false, 10 | "otherEntityRelationshipName": "mapsIdParentEntityWithoutDTO" 11 | } 12 | ], 13 | "fields": [ 14 | { 15 | "fieldName": "name", 16 | "fieldType": "String" 17 | } 18 | ], 19 | "changelogDate": "20190117074315", 20 | "dto": "no", 21 | "searchEngine": false, 22 | "service": "serviceImpl", 23 | "entityTableName": "parent_entity_wo_dto", 24 | "databaseType": "sql", 25 | "jpaMetamodelFiltering": false, 26 | "pagination": "no" 27 | } 28 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MapsIdUserProfileWithDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "clientRootFolder": "", 4 | "relationships": [ 5 | { 6 | "relationshipName": "user", 7 | "otherEntityName": "user", 8 | "relationshipType": "one-to-one", 9 | "otherEntityField": "login", 10 | "ownerSide": true, 11 | "useJPADerivedIdentifier": true, 12 | "otherEntityRelationshipName": "mapsIdUserProfileWithDTO" 13 | } 14 | ], 15 | "fields": [ 16 | { 17 | "fieldName": "dateOfBirth", 18 | "fieldType": "Instant" 19 | } 20 | ], 21 | "changelogDate": "20190117080030", 22 | "dto": "mapstruct", 23 | "searchEngine": false, 24 | "service": "serviceImpl", 25 | "entityTableName": "maps_id_user_profile_withdto", 26 | "databaseType": "sql", 27 | "jpaMetamodelFiltering": false, 28 | "pagination": "no" 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MicroserviceBankAccount.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "operation", 6 | "otherEntityName": "microserviceOperation", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "bankAccount" 9 | } 10 | ], 11 | "fields": [ 12 | { 13 | "fieldName": "name", 14 | "fieldType": "String", 15 | "fieldValidateRules": [ 16 | "required" 17 | ] 18 | }, 19 | { 20 | "fieldName": "bankNumber", 21 | "fieldType": "Integer" 22 | }, 23 | { 24 | "fieldName": "agencyNumber", 25 | "fieldType": "Long" 26 | }, 27 | { 28 | "fieldName": "lastOperationDuration", 29 | "fieldType": "Float" 30 | }, 31 | { 32 | "fieldName": "meanOperationDuration", 33 | "fieldType": "Double" 34 | }, 35 | { 36 | "fieldName": "balance", 37 | "fieldType": "BigDecimal", 38 | "fieldValidateRules": [ 39 | "required" 40 | ] 41 | }, 42 | { 43 | "fieldName": "openingDay", 44 | "fieldType": "LocalDate" 45 | }, 46 | { 47 | "fieldName": "lastOperationDate", 48 | "fieldType": "Instant" 49 | }, 50 | { 51 | "fieldName": "active", 52 | "fieldType": "Boolean" 53 | }, 54 | { 55 | "fieldName": "accountType", 56 | "fieldType": "BankAccountType", 57 | "fieldValues": "CHECKING,SAVINGS,LOAN" 58 | }, 59 | { 60 | "fieldName": "attachment", 61 | "fieldType": "byte[]", 62 | "fieldTypeBlobContent": "any" 63 | }, 64 | { 65 | "fieldName": "description", 66 | "fieldType": "byte[]", 67 | "fieldTypeBlobContent": "text" 68 | } 69 | ], 70 | "changelogDate": "20150805124838", 71 | "dto": "mapstruct", 72 | "pagination": "no", 73 | "jpaMetamodelFiltering": true, 74 | "service": "serviceImpl" 75 | } 76 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MicroserviceLabel.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "operation", 6 | "otherEntityName": "microserviceOperation", 7 | "relationshipType": "many-to-many", 8 | "ownerSide": false, 9 | "otherEntityRelationshipName": "label" 10 | } 11 | ], 12 | "fields": [ 13 | { 14 | "fieldName": "label", 15 | "fieldType": "String", 16 | "fieldValidateRules": [ 17 | "required", 18 | "minlength" 19 | ], 20 | "fieldValidateRulesMinlength": "3" 21 | } 22 | ], 23 | "changelogDate": "20150805124936", 24 | "dto": "no", 25 | "pagination": "pagination", 26 | "jpaMetamodelFiltering": true, 27 | "service": "serviceClass" 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/MicroserviceOperation.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "bankAccount", 6 | "otherEntityName": "microserviceBankAccount", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "name", 9 | "otherEntityRelationshipName": "operation" 10 | }, 11 | { 12 | "relationshipName": "label", 13 | "otherEntityName": "microserviceLabel", 14 | "relationshipType": "many-to-many", 15 | "otherEntityField": "label", 16 | "ownerSide": true, 17 | "otherEntityRelationshipName": "operation" 18 | } 19 | ], 20 | "fields": [ 21 | { 22 | "fieldName": "date", 23 | "fieldType": "Instant", 24 | "fieldValidateRules": [ 25 | "required" 26 | ] 27 | }, 28 | { 29 | "fieldName": "description", 30 | "fieldType": "String" 31 | }, 32 | { 33 | "fieldName": "amount", 34 | "fieldType": "BigDecimal", 35 | "fieldValidateRules": [ 36 | "required" 37 | ] 38 | } 39 | ], 40 | "changelogDate": "20150805125054", 41 | "dto": "no", 42 | "service": "serviceImpl", 43 | "pagination": "infinite-scroll" 44 | } 45 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/Operation.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "bankAccount", 6 | "otherEntityName": "bankAccount", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "name", 9 | "otherEntityRelationshipName": "operation" 10 | }, 11 | { 12 | "relationshipName": "label", 13 | "otherEntityName": "label", 14 | "relationshipType": "many-to-many", 15 | "otherEntityField": "labelName", 16 | "ownerSide": true, 17 | "otherEntityRelationshipName": "operation" 18 | } 19 | ], 20 | "fields": [ 21 | { 22 | "fieldName": "date", 23 | "fieldType": "Instant", 24 | "fieldValidateRules": [ 25 | "required" 26 | ] 27 | }, 28 | { 29 | "fieldName": "description", 30 | "fieldType": "String" 31 | }, 32 | { 33 | "fieldName": "amount", 34 | "fieldType": "BigDecimal", 35 | "fieldValidateRules": [ 36 | "required" 37 | ] 38 | } 39 | ], 40 | "changelogDate": "20150805125054", 41 | "dto": "no", 42 | "service": "serviceImpl", 43 | "pagination": "infinite-scroll", 44 | "clientRootFolder": "test-root" 45 | } 46 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/Place.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipType": "many-to-many", 6 | "otherEntityRelationshipName": "preferredPlace", 7 | "relationshipName": "preferredDivision", 8 | "otherEntityName": "division", 9 | "otherEntityField": "name", 10 | "ownerSide": true 11 | }, 12 | { 13 | "relationshipType": "many-to-one", 14 | "relationshipName": "owner", 15 | "otherEntityName": "division", 16 | "otherEntityField": "name", 17 | "otherEntityRelationshipName": "divisionsPlace" 18 | } 19 | ], 20 | "fields": [ 21 | { 22 | "fieldName": "name", 23 | "fieldType": "String", 24 | "fieldValidateRules": [ 25 | "required" 26 | ] 27 | }, 28 | { 29 | "fieldName": "numberOfSeats", 30 | "fieldType": "Long" 31 | }, 32 | { 33 | "fieldName": "shortName", 34 | "fieldType": "String" 35 | }, 36 | { 37 | "fieldName": "colorBackground", 38 | "fieldType": "String" 39 | }, 40 | { 41 | "fieldName": "colorText", 42 | "fieldType": "String" 43 | }, 44 | { 45 | "fieldName": "description", 46 | "fieldType": "byte[]", 47 | "fieldTypeBlobContent": "text" 48 | } 49 | ], 50 | "changelogDate": "20170626061521", 51 | "entityTableName": "place", 52 | "dto": "no", 53 | "pagination": "no", 54 | "service": "serviceImpl", 55 | "clientRootFolder": "test-root" 56 | } 57 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/SuperMegaLargeTestEntity.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "superMegaLargeTestManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "superMegaLargeTestEntity" 9 | }, 10 | { 11 | "relationshipName": "superMegaLargeTestManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "superMegaLargeTestEntity" 16 | }, 17 | { 18 | "relationshipName": "superMegaLargeTestOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "superMegaLargeTestEntity" 23 | }, 24 | { 25 | "relationshipName": "superMegaLargeUserOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "relationshipValidateRules": "required", 29 | "otherEntityField": "login" 30 | }, 31 | { 32 | "relationshipName": "superMegaLargeUserManyToMany", 33 | "otherEntityName": "user", 34 | "relationshipType": "many-to-many", 35 | "otherEntityField": "login", 36 | "ownerSide": true 37 | }, 38 | { 39 | "relationshipName": "superMegaLargeUserOneToOne", 40 | "otherEntityName": "user", 41 | "relationshipType": "one-to-one", 42 | "otherEntityField": "login", 43 | "ownerSide": true, 44 | "otherEntityRelationshipName": "parent" 45 | }, 46 | { 47 | "relationshipName": "superMegaLargeTestCustomTableName", 48 | "otherEntityName": "testCustomTableName", 49 | "relationshipType": "one-to-many", 50 | "otherEntityRelationshipName": "superMegaLargeTestEntity" 51 | } 52 | ], 53 | "fields": [], 54 | "changelogDate": "20181120190609", 55 | "dto": "no", 56 | "service": "serviceImpl", 57 | "jpaMetamodelFiltering": false, 58 | "angularJSSuffix": "mySuffixAlt", 59 | "pagination": "no" 60 | } 61 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestCustomTableName.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testCustomTableName" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testCustomTableName" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testCustomTableName" 23 | }, 24 | { 25 | "relationshipName": "testEntity", 26 | "otherEntityName": "testEntity", 27 | "relationshipType": "many-to-one", 28 | "relationshipValidateRules": "required", 29 | "otherEntityField": "id" 30 | }, 31 | { 32 | "relationshipName": "userOneToMany", 33 | "otherEntityName": "user", 34 | "relationshipType": "many-to-one", 35 | "otherEntityField": "login" 36 | }, 37 | { 38 | "relationshipName": "userManyToMany", 39 | "otherEntityName": "user", 40 | "relationshipType": "many-to-many", 41 | "otherEntityField": "login", 42 | "ownerSide": true 43 | }, 44 | { 45 | "relationshipName": "userOneToOne", 46 | "otherEntityName": "user", 47 | "relationshipType": "one-to-one", 48 | "otherEntityField": "login", 49 | "ownerSide": true, 50 | "otherEntityRelationshipName": "parent" 51 | }, 52 | { 53 | "relationshipName": "superMegaLargeTestEntity", 54 | "otherEntityName": "superMegaLargeTestEntity", 55 | "relationshipType": "many-to-one", 56 | "otherEntityField": "id" 57 | } 58 | ], 59 | "fields": [], 60 | "changelogDate": "20160208210109", 61 | "dto": "no", 62 | "service": "serviceImpl", 63 | "entityTableName": "test_custom_table_name_entity", 64 | "pagination": "no" 65 | } 66 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestEntity.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testEntity" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testEntity" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testEntity" 23 | }, 24 | { 25 | "relationshipName": "userOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "relationshipValidateRules": "required", 29 | "otherEntityField": "login" 30 | }, 31 | { 32 | "relationshipName": "userManyToMany", 33 | "otherEntityName": "user", 34 | "relationshipType": "many-to-many", 35 | "otherEntityField": "login", 36 | "ownerSide": true 37 | }, 38 | { 39 | "relationshipName": "userOneToOne", 40 | "otherEntityName": "user", 41 | "relationshipType": "one-to-one", 42 | "otherEntityField": "login", 43 | "ownerSide": true, 44 | "otherEntityRelationshipName": "parent" 45 | }, 46 | { 47 | "relationshipName": "testCustomTableName", 48 | "otherEntityName": "testCustomTableName", 49 | "relationshipType": "one-to-many", 50 | "otherEntityRelationshipName": "testEntity" 51 | } 52 | ], 53 | "fields": [], 54 | "changelogDate": "20160208210109", 55 | "dto": "no", 56 | "service": "serviceImpl", 57 | "jpaMetamodelFiltering": true, 58 | "angularJSSuffix": "mySuffixAlt", 59 | "pagination": "no" 60 | } 61 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestInfiniteScroll.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testInfiniteScroll" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testInfiniteScroll" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testInfiniteScroll" 23 | }, 24 | { 25 | "relationshipName": "userOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "otherEntityField": "login" 29 | }, 30 | { 31 | "relationshipName": "userManyToMany", 32 | "otherEntityName": "user", 33 | "relationshipType": "many-to-many", 34 | "otherEntityField": "login", 35 | "ownerSide": true 36 | }, 37 | { 38 | "relationshipName": "userOneToOne", 39 | "otherEntityName": "user", 40 | "relationshipType": "one-to-one", 41 | "otherEntityField": "login", 42 | "ownerSide": true, 43 | "otherEntityRelationshipName": "parent" 44 | } 45 | ], 46 | "fields": [], 47 | "changelogDate": "20160208210109", 48 | "dto": "no", 49 | "service": "serviceImpl", 50 | "pagination": "infinite-scroll" 51 | } 52 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestManyRelPaginDTO.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testMapstruct", 6 | "otherEntityName": "testMapstruct", 7 | "relationshipType": "many-to-many", 8 | "otherEntityField": "id", 9 | "ownerSide": true, 10 | "otherEntityRelationshipName": "testManyRelPaginDTO" 11 | } 12 | ], 13 | "fields": [], 14 | "changelogDate": "20160208210534", 15 | "dto": "mapstruct", 16 | "service": "serviceImpl", 17 | "angularJSSuffix": "mySuffix", 18 | "entityTableName": "test_many_many_pagination_dto", 19 | "pagination": "pagination" 20 | } 21 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestManyToMany.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testEntity", 6 | "otherEntityName": "testEntity", 7 | "relationshipType": "many-to-many", 8 | "otherEntityField": "id", 9 | "ownerSide": true, 10 | "otherEntityRelationshipName": "testManyToMany" 11 | }, 12 | { 13 | "relationshipName": "testMapstruct", 14 | "otherEntityName": "testMapstruct", 15 | "relationshipType": "many-to-many", 16 | "otherEntityField": "id", 17 | "ownerSide": true, 18 | "otherEntityRelationshipName": "testManyToMany" 19 | }, 20 | { 21 | "relationshipName": "testServiceClass", 22 | "otherEntityName": "testServiceClass", 23 | "relationshipType": "many-to-many", 24 | "otherEntityField": "id", 25 | "ownerSide": true, 26 | "otherEntityRelationshipName": "testManyToMany" 27 | }, 28 | { 29 | "relationshipName": "testServiceImpl", 30 | "otherEntityName": "testServiceImpl", 31 | "relationshipType": "many-to-many", 32 | "otherEntityField": "id", 33 | "ownerSide": true, 34 | "otherEntityRelationshipName": "testManyToMany" 35 | }, 36 | { 37 | "relationshipName": "testInfiniteScroll", 38 | "otherEntityName": "testInfiniteScroll", 39 | "relationshipType": "many-to-many", 40 | "otherEntityField": "id", 41 | "ownerSide": true, 42 | "otherEntityRelationshipName": "testManyToMany" 43 | }, 44 | { 45 | "relationshipName": "testPagination", 46 | "otherEntityName": "testPagination", 47 | "relationshipType": "many-to-many", 48 | "otherEntityField": "id", 49 | "ownerSide": true, 50 | "otherEntityRelationshipName": "testManyToMany" 51 | }, 52 | { 53 | "relationshipName": "testCustomTableName", 54 | "otherEntityName": "testCustomTableName", 55 | "relationshipType": "many-to-many", 56 | "otherEntityField": "id", 57 | "ownerSide": true, 58 | "otherEntityRelationshipName": "testManyToMany" 59 | }, 60 | { 61 | "relationshipName": "superMegaLargeTestEntity", 62 | "otherEntityName": "superMegaLargeTestEntity", 63 | "relationshipType": "many-to-many", 64 | "otherEntityField": "id", 65 | "ownerSide": true, 66 | "otherEntityRelationshipName": "superMegaLargeTestManyToMany" 67 | } 68 | ], 69 | "fields": [], 70 | "changelogDate": "20160208210534", 71 | "dto": "no", 72 | "service": "serviceImpl", 73 | "angularJSSuffix": "mySuffix", 74 | "pagination": "no" 75 | } 76 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestManyToOne.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testEntity", 6 | "otherEntityName": "testEntity", 7 | "relationshipType": "many-to-one", 8 | "otherEntityField": "id", 9 | "otherEntityRelationshipName": "testManyToOne" 10 | }, 11 | { 12 | "relationshipName": "testMapstruct", 13 | "otherEntityName": "testMapstruct", 14 | "relationshipType": "many-to-one", 15 | "otherEntityField": "id", 16 | "otherEntityRelationshipName": "testManyToOne" 17 | }, 18 | { 19 | "relationshipName": "testServiceClass", 20 | "otherEntityName": "testServiceClass", 21 | "relationshipType": "many-to-one", 22 | "otherEntityField": "id", 23 | "otherEntityRelationshipName": "testManyToOne" 24 | }, 25 | { 26 | "relationshipName": "testServiceImpl", 27 | "otherEntityName": "testServiceImpl", 28 | "relationshipType": "many-to-one", 29 | "otherEntityField": "id", 30 | "otherEntityRelationshipName": "testManyToOne" 31 | }, 32 | { 33 | "relationshipName": "testInfiniteScroll", 34 | "otherEntityName": "testInfiniteScroll", 35 | "relationshipType": "many-to-one", 36 | "otherEntityField": "id", 37 | "otherEntityRelationshipName": "testManyToOne" 38 | }, 39 | { 40 | "relationshipName": "testPagination", 41 | "otherEntityName": "testPagination", 42 | "relationshipType": "many-to-one", 43 | "otherEntityField": "id", 44 | "otherEntityRelationshipName": "testManyToOne" 45 | }, 46 | { 47 | "relationshipName": "testCustomTableName", 48 | "otherEntityName": "testCustomTableName", 49 | "relationshipType": "many-to-one", 50 | "otherEntityField": "id", 51 | "otherEntityRelationshipName": "testManyToOne" 52 | }, 53 | { 54 | "relationshipName": "superMegaLargeTestEntity", 55 | "otherEntityName": "superMegaLargeTestEntity", 56 | "relationshipType": "many-to-one", 57 | "otherEntityField": "id", 58 | "otherEntityRelationshipName": "testManyToOne" 59 | } 60 | ], 61 | "fields": [], 62 | "changelogDate": "20160208211440", 63 | "dto": "no", 64 | "service": "serviceImpl", 65 | "angularJSSuffix": "mySuffix", 66 | "pagination": "no" 67 | } 68 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestMapstruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testMapstruct" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testMapstruct" 16 | }, 17 | { 18 | "relationshipName": "testManyRelPaginDTO", 19 | "otherEntityName": "testManyRelPaginDTO", 20 | "relationshipType": "many-to-many", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testMapstruct" 23 | }, 24 | { 25 | "relationshipName": "testOneToOne", 26 | "otherEntityName": "testOneToOne", 27 | "relationshipType": "one-to-one", 28 | "ownerSide": false, 29 | "otherEntityRelationshipName": "testMapstruct" 30 | }, 31 | { 32 | "relationshipName": "userOneToMany", 33 | "otherEntityName": "user", 34 | "relationshipType": "many-to-one", 35 | "otherEntityField": "login" 36 | }, 37 | { 38 | "relationshipName": "userManyToMany", 39 | "otherEntityName": "user", 40 | "relationshipType": "many-to-many", 41 | "otherEntityField": "login", 42 | "ownerSide": true 43 | }, 44 | { 45 | "relationshipName": "userOneToOne", 46 | "otherEntityName": "user", 47 | "relationshipType": "one-to-one", 48 | "otherEntityField": "login", 49 | "ownerSide": true, 50 | "otherEntityRelationshipName": "parent" 51 | } 52 | ], 53 | "fields": [], 54 | "changelogDate": "20160208210109", 55 | "dto": "mapstruct", 56 | "service": "serviceImpl", 57 | "pagination": "no" 58 | } 59 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestOneToOne.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testEntity", 6 | "otherEntityName": "testEntity", 7 | "relationshipType": "one-to-one", 8 | "otherEntityField": "id", 9 | "ownerSide": true, 10 | "otherEntityRelationshipName": "testOneToOne" 11 | }, 12 | { 13 | "relationshipName": "testMapstruct", 14 | "otherEntityName": "testMapstruct", 15 | "relationshipType": "one-to-one", 16 | "otherEntityField": "id", 17 | "ownerSide": true, 18 | "otherEntityRelationshipName": "testOneToOne" 19 | }, 20 | { 21 | "relationshipName": "testServiceClass", 22 | "otherEntityName": "testServiceClass", 23 | "relationshipType": "one-to-one", 24 | "otherEntityField": "id", 25 | "ownerSide": true, 26 | "otherEntityRelationshipName": "testOneToOne" 27 | }, 28 | { 29 | "relationshipName": "testServiceImpl", 30 | "otherEntityName": "testServiceImpl", 31 | "relationshipType": "one-to-one", 32 | "otherEntityField": "id", 33 | "ownerSide": true, 34 | "otherEntityRelationshipName": "testOneToOne" 35 | }, 36 | { 37 | "relationshipName": "testInfiniteScroll", 38 | "otherEntityName": "testInfiniteScroll", 39 | "relationshipType": "one-to-one", 40 | "otherEntityField": "id", 41 | "ownerSide": true, 42 | "otherEntityRelationshipName": "testOneToOne" 43 | }, 44 | { 45 | "relationshipName": "testPagination", 46 | "otherEntityName": "testPagination", 47 | "relationshipType": "one-to-one", 48 | "otherEntityField": "id", 49 | "ownerSide": true, 50 | "otherEntityRelationshipName": "testOneToOne" 51 | }, 52 | { 53 | "relationshipName": "testCustomTableName", 54 | "otherEntityName": "testCustomTableName", 55 | "relationshipType": "one-to-one", 56 | "otherEntityField": "id", 57 | "ownerSide": true, 58 | "otherEntityRelationshipName": "testOneToOne" 59 | }, 60 | { 61 | "relationshipName": "superMegaLargeTestEntity", 62 | "otherEntityName": "superMegaLargeTestEntity", 63 | "relationshipType": "one-to-one", 64 | "otherEntityField": "id", 65 | "ownerSide": true, 66 | "otherEntityRelationshipName": "superMegaLargeTestOneToOne" 67 | } 68 | ], 69 | "fields": [], 70 | "changelogDate": "20160208211541", 71 | "dto": "no", 72 | "service": "serviceImpl", 73 | "angularJSSuffix": "mySuffix", 74 | "pagination": "no" 75 | } 76 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestPagination.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testPagination" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testPagination" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testPagination" 23 | }, 24 | { 25 | "relationshipName": "userOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "otherEntityField": "login" 29 | }, 30 | { 31 | "relationshipName": "userManyToMany", 32 | "otherEntityName": "user", 33 | "relationshipType": "many-to-many", 34 | "otherEntityField": "login", 35 | "ownerSide": true 36 | }, 37 | { 38 | "relationshipName": "userOneToOne", 39 | "otherEntityName": "user", 40 | "relationshipType": "one-to-one", 41 | "otherEntityField": "login", 42 | "ownerSide": true, 43 | "otherEntityRelationshipName": "parent" 44 | } 45 | ], 46 | "fields": [], 47 | "changelogDate": "20160208210109", 48 | "dto": "no", 49 | "service": "serviceImpl", 50 | "pagination": "pagination" 51 | } 52 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestServiceClass.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testServiceClass" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testServiceClass" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testServiceClass" 23 | }, 24 | { 25 | "relationshipName": "userOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "otherEntityField": "login" 29 | }, 30 | { 31 | "relationshipName": "userManyToMany", 32 | "otherEntityName": "user", 33 | "relationshipType": "many-to-many", 34 | "otherEntityField": "login", 35 | "ownerSide": true 36 | }, 37 | { 38 | "relationshipName": "userOneToOne", 39 | "otherEntityName": "user", 40 | "relationshipType": "one-to-one", 41 | "otherEntityField": "login", 42 | "ownerSide": true, 43 | "otherEntityRelationshipName": "parent" 44 | } 45 | ], 46 | "fields": [], 47 | "changelogDate": "20160208210109", 48 | "dto": "no", 49 | "service": "serviceClass", 50 | "jpaMetamodelFiltering": true, 51 | "pagination": "no" 52 | } 53 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestServiceImpl.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipName": "testManyToOne", 6 | "otherEntityName": "testManyToOne", 7 | "relationshipType": "one-to-many", 8 | "otherEntityRelationshipName": "testServiceImpl" 9 | }, 10 | { 11 | "relationshipName": "testManyToMany", 12 | "otherEntityName": "testManyToMany", 13 | "relationshipType": "many-to-many", 14 | "ownerSide": false, 15 | "otherEntityRelationshipName": "testServiceImpl" 16 | }, 17 | { 18 | "relationshipName": "testOneToOne", 19 | "otherEntityName": "testOneToOne", 20 | "relationshipType": "one-to-one", 21 | "ownerSide": false, 22 | "otherEntityRelationshipName": "testServiceImpl" 23 | }, 24 | { 25 | "relationshipName": "userOneToMany", 26 | "otherEntityName": "user", 27 | "relationshipType": "many-to-one", 28 | "otherEntityField": "login" 29 | }, 30 | { 31 | "relationshipName": "userManyToMany", 32 | "otherEntityName": "user", 33 | "relationshipType": "many-to-many", 34 | "otherEntityField": "login", 35 | "ownerSide": true 36 | }, 37 | { 38 | "relationshipName": "userOneToOne", 39 | "otherEntityName": "user", 40 | "relationshipType": "one-to-one", 41 | "otherEntityField": "login", 42 | "ownerSide": true, 43 | "otherEntityRelationshipName": "parent" 44 | } 45 | ], 46 | "fields": [], 47 | "changelogDate": "20160208210109", 48 | "dto": "no", 49 | "service": "serviceImpl", 50 | "jpaMetamodelFiltering": true, 51 | "pagination": "no" 52 | } 53 | -------------------------------------------------------------------------------- /test-integration/samples/.jhipster/TestTwoRelationshipsSameEntity.json: -------------------------------------------------------------------------------- 1 | { 2 | "fluentMethods": true, 3 | "relationships": [ 4 | { 5 | "relationshipType": "many-to-one", 6 | "relationshipName": "firstRelationship", 7 | "otherEntityName": "testEntity", 8 | "otherEntityField": "id", 9 | "otherEntityRelationshipName": "firstTestTwoRelationshipsSameEntity" 10 | }, 11 | { 12 | "relationshipType": "many-to-one", 13 | "relationshipName": "secondRelationship", 14 | "otherEntityName": "testEntity", 15 | "otherEntityField": "id", 16 | "otherEntityRelationshipName": "secondTestTwoRelationshipsSameEntity" 17 | }, 18 | { 19 | "relationshipName": "userOne", 20 | "otherEntityName": "user", 21 | "relationshipType": "one-to-one", 22 | "ownerSide": true 23 | }, 24 | { 25 | "relationshipName": "userTwo", 26 | "otherEntityName": "user", 27 | "relationshipType": "one-to-one", 28 | "ownerSide": true 29 | }, 30 | { 31 | "relationshipType": "many-to-one", 32 | "relationshipName": "firstUniqueRequiredRelation", 33 | "relationshipValidateRules": "required", 34 | "otherEntityName": "division", 35 | "otherEntityField": "id", 36 | "otherEntityRelationshipName": "firstTestTwoRelationshipsSameEntity" 37 | }, 38 | { 39 | "relationshipType": "many-to-one", 40 | "relationshipName": "secondUniqueRequiredRelation", 41 | "relationshipValidateRules": "required", 42 | "otherEntityName": "division", 43 | "otherEntityField": "id", 44 | "otherEntityRelationshipName": "secondTestTwoRelationshipsSameEntity" 45 | } 46 | ], 47 | "fields": [], 48 | "changelogDate": "20160208210109", 49 | "entityTableName": "test_multiple_rel", 50 | "dto": "no", 51 | "service": "serviceImpl", 52 | "angularJSSuffix": "mySuffix", 53 | "pagination": "no" 54 | } 55 | -------------------------------------------------------------------------------- /test-integration/samples/README.md: -------------------------------------------------------------------------------- 1 | # Sample application generation 2 | 3 | To generate test applications, either automatically by the CI or locally on the developer machine, a number of pre-defined configurations have been prepared. 4 | 5 | ## Application configurations 6 | 7 | Those are described in `.yo-rc.json` files which is the descriptor file created by Yeoman to keep track of the choices selected while generating an application. 8 | 9 | - app-sample-dev: left empty for local testing, launching the generator with the VSCode debugger will generate an app in this folder 10 | - jdl-default 11 | - ms-micro-consul 12 | - ms-micro-eureka 13 | - ms-ngx-gateway-consul 14 | - ms-ngx-gateway-eureka 15 | - ms-ngx-gateway-eureka-oauth2 16 | - ms-ngx-gateway-uaa 17 | - ngx-couchbase 18 | - ngx-default 19 | - ngx-gradle-fr 20 | - ngx-h2mem-ws-nol2 21 | - ngx-mariadb-oauth2-sass-infinispan 22 | - ngx-mongodb-kafka-cucumber 23 | - ngx-psql-es-noi18n 24 | - ngx-session-cassandra-fr 25 | - react-default 26 | - react-noi18n-es-ws-gradle-session 27 | - uaa 28 | - webflux-mongodb 29 | 30 | ## Entity configurations 31 | 32 | We also have a number of `Entity.json` files for testing different entity configurations. 33 | -------------------------------------------------------------------------------- /test-integration/samples/app-sample-dev/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "jhipsterSampleApplication", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling", "protractor"], 20 | "serverPort": "8080", 21 | "jhiPrefix": "myPrefix", 22 | "messageBroker": false, 23 | "serviceDiscoveryType": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "embeddableLaunchScript": false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/jdl-default/app.jdl: -------------------------------------------------------------------------------- 1 | application { 2 | config { 3 | applicationType monolith, 4 | baseName jhipsterSampleApplication, 5 | packageName io.github.jhipster.sample, 6 | authenticationType jwt, 7 | prodDatabaseType mysql, 8 | buildTool maven, 9 | searchEngine false, 10 | testFrameworks [gatling, protractor], 11 | clientFramework angularX, 12 | enableTranslation true, 13 | nativeLanguage en, 14 | languages [ en, fr ] 15 | } 16 | entities * 17 | } 18 | 19 | entity BankAccount { 20 | name String required 21 | bankNumber Integer 22 | agencyNumber Long 23 | lastOperationDuration Float 24 | meanOperationDuration Double 25 | balance BigDecimal required 26 | openingDay LocalDate 27 | lastOperationDate Instant 28 | active Boolean 29 | accountType BankAccountType 30 | attachment AnyBlob 31 | description TextBlob 32 | } 33 | entity TheLabel { 34 | labelName String required minlength(3) 35 | } 36 | entity Operation { 37 | date Instant required 38 | description String 39 | amount BigDecimal required 40 | } 41 | 42 | enum BankAccountType { 43 | CHECKING, 44 | SAVINGS, 45 | LOAN 46 | } 47 | 48 | entity Department { 49 | name String required, 50 | description TextBlob, 51 | advertisement Blob, 52 | logo ImageBlob 53 | } 54 | 55 | /** 56 | * JobHistory comment. 57 | */ 58 | entity JobHistory { 59 | startDate ZonedDateTime, 60 | endDate ZonedDateTime, 61 | language Language 62 | } 63 | 64 | enum Language { 65 | FRENCH, ENGLISH, SPANISH 66 | } 67 | 68 | enum JobType { 69 | BOSS, SLAVE 70 | } 71 | 72 | entity Job { 73 | title String minlength(5) maxlength(25), 74 | type JobType, 75 | minSalary Long, 76 | maxSalary Long 77 | } 78 | 79 | /** 80 | * The Employee entity. 81 | * Second line in javadoc. 82 | */ 83 | entity Employee { 84 | /** 85 | * The firstname attribute. 86 | */ 87 | firstName String, 88 | lastName String, 89 | email String, 90 | phoneNumber String, 91 | hireDate ZonedDateTime, 92 | salary Long, 93 | commissionPct Long 94 | } 95 | 96 | entity Location { 97 | streetAddress String, 98 | postalCode String, 99 | city String, 100 | stateProvince String 101 | } 102 | 103 | entity Task { 104 | title String, 105 | description String 106 | } 107 | 108 | entity GoldenBadge { 109 | name String 110 | } 111 | 112 | entity SilverBadge { 113 | name String 114 | } 115 | 116 | entity Identifier { 117 | name String required unique 118 | } 119 | 120 | entity Country { 121 | name String 122 | } 123 | 124 | entity Region { 125 | name String 126 | } 127 | 128 | relationship OneToOne { 129 | Department{location} to Location, 130 | Employee{user(login)} to User with jpaDerivedIdentifier 131 | } 132 | 133 | relationship OneToMany { 134 | BankAccount{operation} to Operation{bankAccount(name)} 135 | } 136 | relationship ManyToOne { 137 | BankAccount{user(login)} to User 138 | } 139 | relationship ManyToMany { 140 | Operation{theLabel(labelName)} to TheLabel{operation} 141 | } 142 | 143 | relationship OneToMany { 144 | /** 145 | * A relationship 146 | */ 147 | Department{employee} to 148 | /** 149 | * Another side of the same relationship, 150 | */ 151 | Employee{department}, 152 | Employee{job} to Job{emp(lastName)}, 153 | Location{country} to Country, 154 | Country{area(name)} to Region 155 | } 156 | 157 | relationship ManyToOne { 158 | Employee{manager(lastName)} to Employee, 159 | Employee{sibag(name) required} to SilverBadge, 160 | Employee{gobag(name) required} to GoldenBadge, 161 | SilverBadge{iden(name) required} to Identifier, 162 | GoldenBadge{iden(name) required} to Identifier 163 | } 164 | 165 | relationship ManyToMany { 166 | JobHistory{department} to Department{history}, 167 | JobHistory{job} to Job{history}, 168 | JobHistory{emp(firstName)} to Employee{history}, 169 | Job{chore(title)} to Task{linkedJob(title)} 170 | } 171 | 172 | dto BankAccount, Employee, Department, Location, Country, Region, SilverBadge, GoldenBadge, Identifier with mapstruct 173 | 174 | angularSuffix BankAccount with mySuffix 175 | filter BankAccount, Employee 176 | clientRootFolder BankAccount, TheLabel, Operation with test-root 177 | 178 | paginate TheLabel, Job with pagination 179 | paginate Operation, JobHistory, Employee with infinite-scroll 180 | 181 | service TheLabel, Employee, Department, Region with serviceClass 182 | service BankAccount, Location, Country with serviceImpl 183 | -------------------------------------------------------------------------------- /test-integration/samples/ms-micro-consul/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "microservice", 4 | "baseName": "sampleMicroserviceConsul", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "databaseType": "sql", 11 | "devDatabaseType": "h2Disk", 12 | "prodDatabaseType": "mysql", 13 | "searchEngine": false, 14 | "serviceDiscoveryType": "consul", 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling"], 20 | "skipClient": true, 21 | "skipUserManagement": true, 22 | "serverPort": "8081", 23 | "jhiPrefix": "jhi", 24 | "websocket": false, 25 | "messageBroker": false, 26 | "clientFramework": "angularX", 27 | "clientPackageManager": "npm" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/ms-micro-eureka-jwt/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "microservice", 4 | "baseName": "samplesMicroserviceEureka", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "databaseType": "sql", 11 | "devDatabaseType": "h2Disk", 12 | "prodDatabaseType": "mysql", 13 | "searchEngine": false, 14 | "serviceDiscoveryType": "eureka", 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling"], 20 | "skipClient": true, 21 | "skipUserManagement": true, 22 | "serverPort": "8081", 23 | "jhiPrefix": "jhi", 24 | "websocket": false, 25 | "messageBroker": false, 26 | "clientPackageManager": "npm", 27 | "jwtSecretKey": "ZjY4MTM4YjI5YzMwZjhjYjI2OTNkNTRjMWQ5Y2Q0Y2YwOWNmZTE2NzRmYzU3NTMwM2NjOTE3MTllOTM3MWRkMzcyYTljMjVmNmQ0Y2MxOTUzODc0MDhhMTlkMDIxMzI2YzQzZDM2ZDE3MmQ3NjVkODk3OTVmYzljYTQyZDNmMTQ=", 28 | "embeddableLaunchScript": false, 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "blueprints": [] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-integration/samples/ms-micro-eureka/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "microservice", 4 | "baseName": "sampleMicroserviceEureka", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "databaseType": "sql", 11 | "devDatabaseType": "h2Disk", 12 | "prodDatabaseType": "mysql", 13 | "searchEngine": false, 14 | "serviceDiscoveryType": "eureka", 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling"], 20 | "skipClient": true, 21 | "skipUserManagement": true, 22 | "serverPort": "8081", 23 | "jhiPrefix": "jhi", 24 | "websocket": false, 25 | "messageBroker": false, 26 | "clientFramework": "angularX", 27 | "clientPackageManager": "npm" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-consul/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleDefault", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "consul", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "myPrefix", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-eureka-jwt/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleGateway", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "eureka", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling", "protractor"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "NDQ5NmU1YmEwNjFlZWUyNGVjOGUxMGEwMzA4N2Q2NTRlNTkwNTI5MmEzOTU5NjViNjEzYzhlYWVhNzBlMTg5ZWI5YjJkN2Q2NDJlZjcxZDA3YTIzNzgxZmI0MTVlZWVlNDYzNzFhYmU5OWRiMDhjMWNjNWM2Yzg4YTVhMzZmMzE=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-eureka-oauth2/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleGateway", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "oauth2", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "eureka", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling", "protractor"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "NDQ5NmU1YmEwNjFlZWUyNGVjOGUxMGEwMzA4N2Q2NTRlNTkwNTI5MmEzOTU5NjViNjEzYzhlYWVhNzBlMTg5ZWI5YjJkN2Q2NDJlZjcxZDA3YTIzNzgxZmI0MTVlZWVlNDYzNzFhYmU5OWRiMDhjMWNjNWM2Yzg4YTVhMzZmMzE=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-eureka-uaa/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleGateway", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "uaa", 8 | "uaaBaseName": "sampleUaa", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "h2Disk", 14 | "prodDatabaseType": "mysql", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": "eureka", 18 | "buildTool": "maven", 19 | "applicationType": "gateway", 20 | "testFrameworks": ["gatling"], 21 | "jhiPrefix": "jhi", 22 | "enableTranslation": true, 23 | "nativeLanguage": "en", 24 | "languages": ["en"], 25 | "clientPackageManager": "npm", 26 | "clientFramework": "angularX", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-eureka/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleGateway", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "eureka", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "NDQ5NmU1YmEwNjFlZWUyNGVjOGUxMGEwMzA4N2Q2NTRlNTkwNTI5MmEzOTU5NjViNjEzYzhlYWVhNzBlMTg5ZWI5YjJkN2Q2NDJlZjcxZDA3YTIzNzgxZmI0MTVlZWVlNDYzNzFhYmU5OWRiMDhjMWNjNWM2Yzg4YTVhMzZmMzE=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ms-ngx-gateway-uaa/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleGateway", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "uaa", 8 | "uaaBaseName": "sampleUaa", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "h2Disk", 14 | "prodDatabaseType": "mysql", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": "eureka", 18 | "buildTool": "maven", 19 | "applicationType": "gateway", 20 | "testFrameworks": ["gatling"], 21 | "jhiPrefix": "jhi", 22 | "enableTranslation": true, 23 | "nativeLanguage": "en", 24 | "languages": ["en"], 25 | "clientPackageManager": "npm", 26 | "clientFramework": "angularX" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/ms-react-gateway-consul-jwt/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleGateway", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "oauth2", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "consul", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling", "protractor"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "react", 26 | "jwtSecretKey": "NDQ5NmU1YmEwNjFlZWUyNGVjOGUxMGEwMzA4N2Q2NTRlNTkwNTI5MmEzOTU5NjViNjEzYzhlYWVhNzBlMTg5ZWI5YjJkN2Q2NDJlZjcxZDA3YTIzNzgxZmI0MTVlZWVlNDYzNzFhYmU5OWRiMDhjMWNjNWM2Yzg4YTVhMzZmMzE=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ms-react-gateway-consul-oauth2/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "gateway", 4 | "baseName": "sampleGateway", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "serviceDiscoveryType": "consul", 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling", "protractor"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "react", 26 | "jwtSecretKey": "NDQ5NmU1YmEwNjFlZWUyNGVjOGUxMGEwMzA4N2Q2NTRlNTkwNTI5MmEzOTU5NjViNjEzYzhlYWVhNzBlMTg5ZWI5YjJkN2Q2NDJlZjcxZDA3YTIzNzgxZmI0MTVlZWVlNDYzNzFhYmU5OWRiMDhjMWNjNWM2Yzg4YTVhMzZmMzE=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-couchbase/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleCouchbaseNoCache", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "no", 9 | "enableHibernateCache": false, 10 | "websocket": false, 11 | "databaseType": "couchbase", 12 | "devDatabaseType": "couchbase", 13 | "prodDatabaseType": "couchbase", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "serviceDiscoveryType": false, 17 | "buildTool": "maven", 18 | "enableSwaggerCodegen": false, 19 | "clientFramework": "angularX", 20 | "clientPackageManager": "npm", 21 | "applicationType": "monolith", 22 | "testFrameworks": ["gatling", "protractor"], 23 | "jhiPrefix": "jhi", 24 | "enableTranslation": true, 25 | "nativeLanguage": "en", 26 | "languages": ["en", "fr"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-default/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "jhipsterSampleApplication", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": [ 19 | "en", 20 | "al", 21 | "ar-ly", 22 | "hy", 23 | "by", 24 | "bn", 25 | "ca", 26 | "zh-cn", 27 | "zh-tw", 28 | "cs", 29 | "da", 30 | "nl", 31 | "et", 32 | "fa", 33 | "fr", 34 | "gl", 35 | "de", 36 | "el", 37 | "hi", 38 | "hu", 39 | "in", 40 | "it", 41 | "ja", 42 | "ko", 43 | "mr", 44 | "my", 45 | "pl", 46 | "pt-br", 47 | "pt-pt", 48 | "ro", 49 | "ru", 50 | "sk", 51 | "sr", 52 | "es", 53 | "sv", 54 | "tr", 55 | "ta", 56 | "te", 57 | "th", 58 | "ua", 59 | "uz-Cyrl-uz", 60 | "uz-Latn-uz", 61 | "vi" 62 | ], 63 | "testFrameworks": ["gatling", "protractor"], 64 | "serverPort": "8080", 65 | "jhiPrefix": "myPrefix", 66 | "messageBroker": false, 67 | "serviceDiscoveryType": false, 68 | "clientPackageManager": "npm", 69 | "clientFramework": "angularX", 70 | "entitySuffix": "", 71 | "dtoSuffix": "DTO", 72 | "jwtSecretKey": "MjJjOTA4ZWFjNmU5NTkyNjA4MGM4OGRmZjlmODM0M2Y3Y2UwYzYzZDJmNDMxNDM4ZmEwODlkY2MzMDc4YzZlOGM5MzZhNjVhMGFhNGM0MDlmMzUyM2I3MDdlZTZkY2UxMzkwMTc4MGU1Njc0YWY4OWY1NTk2MzIwMDRiYTg2MWQ=", 73 | "embeddableLaunchScript": false, 74 | "useSass": true, 75 | "clientTheme": "none", 76 | "otherModules": [], 77 | "blueprints": [] 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-gradle-fr/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleNgxGradle", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "mysql", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "buildTool": "gradle", 17 | "applicationType": "monolith", 18 | "testFrameworks": ["gatling", "protractor"], 19 | "jhiPrefix": "jhi", 20 | "enableTranslation": true, 21 | "nativeLanguage": "fr", 22 | "languages": ["en", "fr"], 23 | "serviceDiscoveryType": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "ZGRhODA2ZGUxOTZlYmI4NDcxMTQzNjViOGQxYjM2MDk4M2YyOGNhYzg4ZTZjN2NmYTE2NGVhYWQ3YTMyYTFiNmVkZDhlYTliNTViODBmODU0MTFhOTQwZWY5ZDdhMWYwYmI1ZmY5MTMwM2I4ZDA4NThhYzllY2U4NzczMjljZGQ=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-gradle-mariadb-oauth2-infinispan/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleGradleOauth2Infinispan", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "oauth2", 8 | "cacheProvider": "infinispan", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "mariadb", 13 | "prodDatabaseType": "mariadb", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "buildTool": "gradle", 17 | "applicationType": "monolith", 18 | "testFrameworks": ["gatling", "protractor"], 19 | "jhiPrefix": "myPrefix", 20 | "serviceDiscoveryType": false, 21 | "enableTranslation": false, 22 | "clientPackageManager": "npm", 23 | "clientFramework": "angularX", 24 | "embeddableLaunchScript": false, 25 | "useSass": true, 26 | "clientTheme": "none", 27 | "entitySuffix": "", 28 | "dtoSuffix": "DTO", 29 | "otherModules": [], 30 | "blueprints": [] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-gradle-mongodb-kafka-cucumber/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleMongoKafka", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": false, 10 | "websocket": false, 11 | "databaseType": "mongodb", 12 | "devDatabaseType": "mongodb", 13 | "prodDatabaseType": "mongodb", 14 | "searchEngine": false, 15 | "buildTool": "gradle", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling", "cucumber", "protractor"], 20 | "serverPort": "8080", 21 | "jhiPrefix": "myPrefix", 22 | "messageBroker": "kafka", 23 | "serviceDiscoveryType": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "OTNiNTU1YzgyNjA3NjUwNDRhYWM1OTBiMGI3YmY1ODk3NWFiZWIyMmZiNzFhM2JiOWY4OWY0OTc1YTllNTkzZWExNjk5NWMzZGQxZTEwODNhZWFlNjc2M2IzNGViODg2NWRlNjM0ZDdkNDkxYjdhZThhODY1ZGJmODRhYWM4OTk=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-gradle-psql-es-noi18n-mapsid/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "samplePsqlEsNoi18nMapsIdWithNgx", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "postgresql", 14 | "prodDatabaseType": "postgresql", 15 | "searchEngine": "elasticsearch", 16 | "buildTool": "gradle", 17 | "enableSwaggerCodegen": false, 18 | "jwtSecretKey": "NDA4MWUyZjMzNDFmYWIxZGRlZTRkZDkzNDJiODM2MTQ4YTE4NTMxMTdhZmFlODg4NTNjYWM4MzZmMmYxN2M0OTUyYzllYjI3NDY4YWM2M2RmN2UyZTExNzA5MDQ5ZDVhN2QzNjNkMzQxZGQwOWZkZGVkYzlkMzU1NzA4MmU3Zjc=", 19 | "clientFramework": "angularX", 20 | "useSass": true, 21 | "clientPackageManager": "npm", 22 | "testFrameworks": ["gatling", "protractor"], 23 | "jhiPrefix": "jhi", 24 | "otherModules": [], 25 | "enableTranslation": false, 26 | "messageBroker": false, 27 | "serviceDiscoveryType": false, 28 | "embeddableLaunchScript": false, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "blueprints": [] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-gradle-yarn-h2disk-ws-nocache/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleYarnWebsocketNocache", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "no", 10 | "enableHibernateCache": false, 11 | "websocket": "spring-websocket", 12 | "databaseType": "sql", 13 | "devDatabaseType": "h2Disk", 14 | "prodDatabaseType": "mysql", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "gradle", 19 | "enableSwaggerCodegen": false, 20 | "jwtSecretKey": "Njc1MTI5MjM2OWNhMDUyNjI4ZmNhOWU0YTQ1OTYwMmU0YWZhNDI1YmZlMmQ2MDM3Mjc1YjdiMTBkNThiOWExZWNhNjI4ODE3ZTZkMDM0MDcxOTkzOWRkN2IzMjdmODljZjIxZmRkOGY0OGU0NDBjMDU5ZWQ3MGJhMjhjZWM2OWU=", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "angularX", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en", "fr", "de"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-h2mem-ws-nol2/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleWebsocket", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": false, 10 | "websocket": "spring-websocket", 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Memory", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling", "protractor"], 20 | "serverPort": "8080", 21 | "jhiPrefix": "myPrefix", 22 | "messageBroker": false, 23 | "serviceDiscoveryType": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "Mjk3ZDFjNTgyYTRkOGU3NDdjOWI2M2NiNzk3MmYwNjFiMWI3MzQ5Y2RjYTM2ZDUyMmM3MjY1OWJiY2ViNmUzODdmZTNiYmMwMDFlMzM1NTc4N2NiMGRhNWZiMjBjNDA5NDlhOWMyYTk5YmM5MzIwYzEyOGJmMmEwOWJiZjI3ZTk=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-mariadb-oauth2-infinispan/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleOauth2Infinispan", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "oauth2", 8 | "cacheProvider": "infinispan", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "mariadb", 13 | "prodDatabaseType": "mariadb", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "buildTool": "maven", 17 | "applicationType": "monolith", 18 | "testFrameworks": ["gatling", "protractor"], 19 | "jhiPrefix": "myPrefix", 20 | "serviceDiscoveryType": false, 21 | "enableTranslation": false, 22 | "clientPackageManager": "npm", 23 | "clientFramework": "angularX", 24 | "embeddableLaunchScript": false, 25 | "useSass": true, 26 | "clientTheme": "none", 27 | "entitySuffix": "", 28 | "dtoSuffix": "DTO", 29 | "otherModules": [], 30 | "blueprints": [] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-mariadb-oauth2-sass-infinispan/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleOauth2SassInfinispan", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "oauth2", 8 | "cacheProvider": "infinispan", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "mariadb", 13 | "prodDatabaseType": "mariadb", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "buildTool": "maven", 17 | "rememberMeKey": "448f9a67a8a292c4905a733ec22cc3b78e493c56", 18 | "applicationType": "monolith", 19 | "testFrameworks": ["gatling", "protractor"], 20 | "jhiPrefix": "myPrefix", 21 | "serviceDiscoveryType": false, 22 | "enableTranslation": false, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "angularX" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-mongodb-kafka-cucumber/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleMongoKafka", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": false, 10 | "websocket": false, 11 | "databaseType": "mongodb", 12 | "devDatabaseType": "mongodb", 13 | "prodDatabaseType": "mongodb", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": ["en", "fr"], 19 | "testFrameworks": ["gatling", "protractor"], 20 | "serverPort": "8080", 21 | "jhiPrefix": "myPrefix", 22 | "messageBroker": "kafka", 23 | "serviceDiscoveryType": false, 24 | "clientPackageManager": "npm", 25 | "clientFramework": "angularX", 26 | "jwtSecretKey": "OTNiNTU1YzgyNjA3NjUwNDRhYWM1OTBiMGI3YmY1ODk3NWFiZWIyMmZiNzFhM2JiOWY4OWY0OTc1YTllNTkzZWExNjk5NWMzZGQxZTEwODNhZWFlNjc2M2IzNGViODg2NWRlNjM0ZDdkNDkxYjdhZThhODY1ZGJmODRhYWM4OTk=", 27 | "embeddableLaunchScript": false, 28 | "useSass": true, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "otherModules": [], 33 | "blueprints": [] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-psql-es-noi18n-mapsid/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "samplePsqlEsNoi18nMapsIdWithNgx", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "postgresql", 14 | "prodDatabaseType": "postgresql", 15 | "searchEngine": "elasticsearch", 16 | "buildTool": "maven", 17 | "enableSwaggerCodegen": false, 18 | "jwtSecretKey": "NDA4MWUyZjMzNDFmYWIxZGRlZTRkZDkzNDJiODM2MTQ4YTE4NTMxMTdhZmFlODg4NTNjYWM4MzZmMmYxN2M0OTUyYzllYjI3NDY4YWM2M2RmN2UyZTExNzA5MDQ5ZDVhN2QzNjNkMzQxZGQwOWZkZGVkYzlkMzU1NzA4MmU3Zjc=", 19 | "clientFramework": "angularX", 20 | "useSass": true, 21 | "clientPackageManager": "npm", 22 | "testFrameworks": ["gatling", "protractor"], 23 | "jhiPrefix": "jhi", 24 | "otherModules": [], 25 | "enableTranslation": false, 26 | "messageBroker": false, 27 | "serviceDiscoveryType": false, 28 | "embeddableLaunchScript": false, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "blueprints": [] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-integration/samples/ngx-session-cassandra-fr/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleCassandra", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "session", 8 | "cacheProvider": "no", 9 | "enableHibernateCache": false, 10 | "websocket": false, 11 | "databaseType": "cassandra", 12 | "devDatabaseType": "cassandra", 13 | "prodDatabaseType": "cassandra", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "fr", 18 | "languages": ["en", "fr"], 19 | "rememberMeKey": "f19f0827c622eb9b81f5227a869ccd44932d78eb", 20 | "testFrameworks": ["gatling"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "messageBroker": false, 24 | "serviceDiscoveryType": false, 25 | "clientPackageManager": "npm", 26 | "clientFramework": "angularX" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/react-default/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "jhipsterSampleApplication", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "authenticationType": "jwt", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "buildTool": "maven", 16 | "enableTranslation": true, 17 | "nativeLanguage": "en", 18 | "languages": [ 19 | "en", 20 | "al", 21 | "ar-ly", 22 | "hy", 23 | "by", 24 | "bn", 25 | "ca", 26 | "zh-cn", 27 | "zh-tw", 28 | "cs", 29 | "da", 30 | "nl", 31 | "et", 32 | "fa", 33 | "fr", 34 | "gl", 35 | "de", 36 | "el", 37 | "hi", 38 | "hu", 39 | "in", 40 | "it", 41 | "ja", 42 | "ko", 43 | "mr", 44 | "my", 45 | "pl", 46 | "pt-br", 47 | "pt-pt", 48 | "ro", 49 | "ru", 50 | "sk", 51 | "sr", 52 | "es", 53 | "sv", 54 | "tr", 55 | "ta", 56 | "te", 57 | "th", 58 | "ua", 59 | "uz-Cyrl-uz", 60 | "uz-Latn-uz", 61 | "vi" 62 | ], 63 | "testFrameworks": ["gatling", "protractor"], 64 | "serverPort": "8080", 65 | "jhiPrefix": "myPrefix", 66 | "messageBroker": false, 67 | "serviceDiscoveryType": false, 68 | "clientPackageManager": "npm", 69 | "clientFramework": "react", 70 | "entitySuffix": "", 71 | "dtoSuffix": "DTO", 72 | "jwtSecretKey": "MjJjOTA4ZWFjNmU5NTkyNjA4MGM4OGRmZjlmODM0M2Y3Y2UwYzYzZDJmNDMxNDM4ZmEwODlkY2MzMDc4YzZlOGM5MzZhNjVhMGFhNGM0MDlmMzUyM2I3MDdlZTZkY2UxMzkwMTc4MGU1Njc0YWY4OWY1NTk2MzIwMDRiYTg2MWQ=", 73 | "embeddableLaunchScript": false, 74 | "useSass": true, 75 | "clientTheme": "none", 76 | "otherModules": [], 77 | "blueprints": [] 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /test-integration/samples/react-gradle-cassandra-session-redis/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactCassandraSessionRedis", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "session", 9 | "cacheProvider": "caffeine", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "cassandra", 13 | "devDatabaseType": "cassandra", 14 | "prodDatabaseType": "cassandra", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "gradle", 19 | "enableSwaggerCodegen": false, 20 | "rememberMeKey": "6e6046f07954160649d92d36ec3a32d9e02ad6a37d3411765fa8e9445c7c10a81570225a7dfaa56e1679498363f2daa4b8e2", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en", "fr"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-gradle-couchbase-caffeine/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactCouchbaseCaffeine", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "caffeine", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "couchbase", 13 | "devDatabaseType": "couchbase", 14 | "prodDatabaseType": "couchbase", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "gradle", 19 | "enableSwaggerCodegen": false, 20 | "jwtSecretKey": "MjM5ZDE0ZjlhYWQyZTczNWM2OTVlYmI1OTM0YmRjY2QzODRiZjE5MGNhMmU2M2NhOGM0NThiYzU2YjEyNTM3NDM1MzcxMzQ3NGU3ZDAwNjUxODI5YzgxZDZiNGIwNzJiNDVhOTZiMGY0NjVkMGRlNDUxZGRlOTdlYTk4YTgwMGM=", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-gradle-h2mem-memcached/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactH2memMemcached", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "memcached", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "h2Memory", 14 | "prodDatabaseType": "mysql", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "gradle", 19 | "enableSwaggerCodegen": false, 20 | "jwtSecretKey": "NTgzZTljNWEzZWM1OTJjNTE2NTM0ODAwYWM5ZjFmMmNiNjgwMzVmMjhjOGU2ZmQyZTA4MTJhMzJiZGUyMjc3Y2VjMzRhMWE1ZjUwOThiMzMzYThlYTk2NzhiMTU1NzFhMDE2MjNhODg2ZDIxYjg2MzgwMGRmZDhjNjA0ZmRlODE=", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-gradle-psql-es-noi18n-mapsid/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "samplePsqlEsNoi18nMapsIdWithReact", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "postgresql", 14 | "prodDatabaseType": "postgresql", 15 | "searchEngine": "elasticsearch", 16 | "buildTool": "gradle", 17 | "enableSwaggerCodegen": false, 18 | "jwtSecretKey": "NDA4MWUyZjMzNDFmYWIxZGRlZTRkZDkzNDJiODM2MTQ4YTE4NTMxMTdhZmFlODg4NTNjYWM4MzZmMmYxN2M0OTUyYzllYjI3NDY4YWM2M2RmN2UyZTExNzA5MDQ5ZDVhN2QzNjNkMzQxZGQwOWZkZGVkYzlkMzU1NzA4MmU3Zjc=", 19 | "clientFramework": "react", 20 | "useSass": true, 21 | "clientPackageManager": "npm", 22 | "testFrameworks": ["gatling", "protractor"], 23 | "jhiPrefix": "jhi", 24 | "otherModules": [], 25 | "enableTranslation": false, 26 | "messageBroker": false, 27 | "serviceDiscoveryType": false, 28 | "embeddableLaunchScript": false, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "blueprints": [] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-integration/samples/react-maven-cassandra-session-redis/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactCassandraSessionRedis", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "session", 9 | "cacheProvider": "caffeine", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "cassandra", 13 | "devDatabaseType": "cassandra", 14 | "prodDatabaseType": "cassandra", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "maven", 19 | "enableSwaggerCodegen": false, 20 | "rememberMeKey": "6e6046f07954160649d92d36ec3a32d9e02ad6a37d3411765fa8e9445c7c10a81570225a7dfaa56e1679498363f2daa4b8e2", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en", "fr"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-maven-couchbase-caffeine/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactCouchbaseCaffeine", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "caffeine", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "couchbase", 13 | "devDatabaseType": "couchbase", 14 | "prodDatabaseType": "couchbase", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "maven", 19 | "enableSwaggerCodegen": false, 20 | "jwtSecretKey": "MjM5ZDE0ZjlhYWQyZTczNWM2OTVlYmI1OTM0YmRjY2QzODRiZjE5MGNhMmU2M2NhOGM0NThiYzU2YjEyNTM3NDM1MzcxMzQ3NGU3ZDAwNjUxODI5YzgxZDZiNGIwNzJiNDVhOTZiMGY0NjVkMGRlNDUxZGRlOTdlYTk4YTgwMGM=", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-maven-h2mem-memcached/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "sampleReactH2memMemcached", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "memcached", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "h2Memory", 14 | "prodDatabaseType": "mysql", 15 | "searchEngine": false, 16 | "messageBroker": false, 17 | "serviceDiscoveryType": false, 18 | "buildTool": "maven", 19 | "enableSwaggerCodegen": false, 20 | "jwtSecretKey": "NTgzZTljNWEzZWM1OTJjNTE2NTM0ODAwYWM5ZjFmMmNiNjgwMzVmMjhjOGU2ZmQyZTA4MTJhMzJiZGUyMjc3Y2VjMzRhMWE1ZjUwOThiMzMzYThlYTk2NzhiMTU1NzFhMDE2MjNhODg2ZDIxYjg2MzgwMGRmZDhjNjA0ZmRlODE=", 21 | "embeddableLaunchScript": false, 22 | "useSass": true, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react", 25 | "clientTheme": "none", 26 | "clientThemeVariant": "", 27 | "testFrameworks": ["gatling", "protractor"], 28 | "jhiPrefix": "jhi", 29 | "entitySuffix": "", 30 | "dtoSuffix": "DTO", 31 | "otherModules": [], 32 | "enableTranslation": true, 33 | "nativeLanguage": "en", 34 | "languages": ["en"], 35 | "blueprints": [] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-integration/samples/react-maven-psql-es-noi18n-mapsid/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "baseName": "samplePsqlEsNoi18nMapsIdWithReact", 5 | "packageName": "io.github.jhipster.sample", 6 | "packageFolder": "io/github/jhipster/sample", 7 | "serverPort": "8080", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "hazelcast", 10 | "enableHibernateCache": true, 11 | "websocket": false, 12 | "databaseType": "sql", 13 | "devDatabaseType": "postgresql", 14 | "prodDatabaseType": "postgresql", 15 | "searchEngine": "elasticsearch", 16 | "buildTool": "maven", 17 | "enableSwaggerCodegen": false, 18 | "jwtSecretKey": "NDA4MWUyZjMzNDFmYWIxZGRlZTRkZDkzNDJiODM2MTQ4YTE4NTMxMTdhZmFlODg4NTNjYWM4MzZmMmYxN2M0OTUyYzllYjI3NDY4YWM2M2RmN2UyZTExNzA5MDQ5ZDVhN2QzNjNkMzQxZGQwOWZkZGVkYzlkMzU1NzA4MmU3Zjc=", 19 | "clientFramework": "react", 20 | "useSass": true, 21 | "clientPackageManager": "npm", 22 | "testFrameworks": ["gatling", "protractor"], 23 | "jhiPrefix": "jhi", 24 | "otherModules": [], 25 | "enableTranslation": false, 26 | "messageBroker": false, 27 | "serviceDiscoveryType": false, 28 | "embeddableLaunchScript": false, 29 | "clientTheme": "none", 30 | "entitySuffix": "", 31 | "dtoSuffix": "DTO", 32 | "blueprints": [] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test-integration/samples/react-noi18n-es-ws-gradle-session/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleReact", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "8080", 7 | "authenticationType": "session", 8 | "cacheProvider": "ehcache", 9 | "enableHibernateCache": true, 10 | "websocket": "spring-websocket", 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": "elasticsearch", 15 | "buildTool": "gradle", 16 | "enableTranslation": false, 17 | "messageBroker": false, 18 | "rememberMeKey": "448f9a67a8a292c4905a733ec22cc3b78e493c56", 19 | "applicationType": "monolith", 20 | "testFrameworks": ["protractor"], 21 | "jhiPrefix": "myPrefix", 22 | "serviceDiscoveryType": false, 23 | "clientPackageManager": "npm", 24 | "clientFramework": "react" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test-integration/samples/uaa/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleUaa", 4 | "packageName": "io.github.jhipster.sample", 5 | "packageFolder": "io/github/jhipster/sample", 6 | "serverPort": "9999", 7 | "authenticationType": "uaa", 8 | "cacheProvider": "hazelcast", 9 | "enableHibernateCache": true, 10 | "websocket": false, 11 | "databaseType": "sql", 12 | "devDatabaseType": "h2Disk", 13 | "prodDatabaseType": "mysql", 14 | "searchEngine": false, 15 | "messageBroker": false, 16 | "serviceDiscoveryType": "eureka", 17 | "buildTool": "maven", 18 | "enableTranslation": true, 19 | "applicationType": "uaa", 20 | "testFrameworks": ["gatling"], 21 | "jhiPrefix": "jhi", 22 | "skipClient": true, 23 | "nativeLanguage": "en", 24 | "languages": ["en"], 25 | "clientFramework": "angularX", 26 | "clientPackageManager": "npm" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test-integration/samples/webflux-mongodb/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "applicationType": "monolith", 4 | "reactive": true, 5 | "baseName": "sampleWebflux", 6 | "packageName": "io.github.jhipster.sample", 7 | "packageFolder": "io/github/jhipster/sample", 8 | "authenticationType": "jwt", 9 | "cacheProvider": "no", 10 | "enableHibernateCache": false, 11 | "websocket": false, 12 | "databaseType": "mongodb", 13 | "devDatabaseType": "mongodb", 14 | "prodDatabaseType": "mongodb", 15 | "searchEngine": false, 16 | "buildTool": "maven", 17 | "enableTranslation": true, 18 | "nativeLanguage": "en", 19 | "languages": ["en", "fr"], 20 | "testFrameworks": ["gatling"], 21 | "serverPort": "8080", 22 | "jhiPrefix": "jhi", 23 | "clientPackageManager": "yarn", 24 | "clientFramework": "angularX" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test-integration/scripts/00-init-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | init_var() { 4 | result="" 5 | if [[ $1 != "" ]]; then 6 | result=$1 7 | elif [[ $2 != "" ]]; then 8 | result=$2 9 | elif [[ $3 != "" ]]; then 10 | result=$3 11 | fi 12 | echo $result 13 | } 14 | 15 | # uri of repo 16 | JHI_REPO=$(init_var "$BUILD_REPOSITORY_URI" "$TRAVIS_REPO_SLUG" "$GITHUB_WORKSPACE" ) 17 | 18 | # folder where the repo is cloned 19 | JHI_HOME=$(init_var "$BUILD_REPOSITORY_LOCALPATH" "$TRAVIS_BUILD_DIR" "$GITHUB_WORKSPACE") 20 | 21 | # folder for test-integration 22 | if [[ "$JHI_INTEG" == "" ]]; then 23 | JHI_INTEG="$JHI_HOME"/test-integration 24 | fi 25 | 26 | # folder for samples 27 | if [[ "$JHI_SAMPLES" == "" ]]; then 28 | JHI_SAMPLES="$JHI_INTEG"/samples 29 | fi 30 | 31 | # folder for scripts 32 | if [[ "$JHI_SCRIPTS" == "" ]]; then 33 | JHI_SCRIPTS="$JHI_INTEG"/scripts 34 | fi 35 | 36 | # folder for app 37 | if [[ "$JHI_FOLDER_APP" == "" ]]; then 38 | JHI_FOLDER_APP="$HOME"/app 39 | fi 40 | 41 | # folder for uaa app 42 | if [[ "$JHI_FOLDER_UAA" == "" ]]; then 43 | JHI_FOLDER_UAA="$HOME"/uaa 44 | fi 45 | 46 | # set correct OpenJDK version 47 | if [[ "$JHI_JDK" == "11" && "$JHI_GITHUB_CI" != "true" ]]; then 48 | JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::") 49 | fi 50 | -------------------------------------------------------------------------------- /test-integration/scripts/01-display-configuration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname $0)/00-init-env.sh 4 | 5 | echo "----- parameters -----" 6 | echo JHI_APP="$JHI_APP" 7 | echo JHI_ENTITY="$JHI_ENTITY" 8 | echo JHI_PROFILE="$JHI_PROFILE" 9 | echo JHI_RUN_APP="$JHI_RUN_APP" 10 | echo JHI_PROTRACTOR="$JHI_PROTRACTOR" 11 | echo JHI_LIB_REPO="$JHI_LIB_REPO" 12 | echo JHI_LIB_BRANCH="$JHI_LIB_BRANCH" 13 | echo JHI_GEN_REPO="$JHI_GEN_REPO" 14 | echo JHI_GEN_BRANCH="$JHI_GEN_BRANCH" 15 | echo JHI_DISABLE_WEBPACK_LOGS="$JHI_DISABLE_WEBPACK_LOGS" 16 | echo JHI_E2E_HEADLESS="$JHI_E2E_HEADLESS" 17 | echo SPRING_OUTPUT_ANSI_ENABLED="$SPRING_OUTPUT_ANSI_ENABLED" 18 | echo SPRING_JPA_SHOW_SQL="$SPRING_JPA_SHOW_SQL" 19 | echo "----- technical vars -----" 20 | echo JHI_REPO="$JHI_REPO" 21 | echo JHI_HOME="$JHI_HOME" 22 | echo JHI_INTEG="$JHI_INTEG" 23 | echo JHI_SAMPLES="$JHI_SAMPLES" 24 | echo JHI_SCRIPTS="$JHI_SCRIPTS" 25 | echo JHI_FOLDER_APP="$JHI_FOLDER_APP" 26 | echo JHI_FOLDER_UAA="$JHI_FOLDER_UAA" 27 | echo JAVA_HOME="$JAVA_HOME" 28 | -------------------------------------------------------------------------------- /test-integration/scripts/02-display-tools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git version 4 | java -version 5 | node -v 6 | npm -v 7 | docker version 8 | docker-compose version 9 | -------------------------------------------------------------------------------- /test-integration/scripts/03-system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo /etc/init.d/mysql stop 4 | -------------------------------------------------------------------------------- /test-integration/scripts/04-git-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git config --global user.name "JHipster Bot" 4 | git config --global user.email "jhipster-bot@jhipster.tech" 5 | -------------------------------------------------------------------------------- /test-integration/scripts/10-install-jhipster-grpc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Install JHipster gRPC Generator 8 | #------------------------------------------------------------------------------- 9 | cd "$JHI_HOME" 10 | git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 11 | 12 | npm ci 13 | npm install -g "$JHI_HOME" 14 | -------------------------------------------------------------------------------- /test-integration/scripts/11-generate-entities.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | if [[ -a $(dirname $0)/00-init-env.sh ]]; then 5 | source $(dirname $0)/00-init-env.sh 6 | else 7 | echo "*** 00-init-env.sh not found" 8 | fi 9 | 10 | #------------------------------------------------------------------------------- 11 | # Functions 12 | #------------------------------------------------------------------------------- 13 | moveEntity() { 14 | local entity="$1" 15 | cp "$JHI_SAMPLES"/.jhipster/"$entity".json "$JHI_FOLDER_APP"/.jhipster/ 16 | } 17 | 18 | prepareFolder() { 19 | rm -rf "$JHI_FOLDER_APP" 20 | mkdir -p "$JHI_FOLDER_APP"/.jhipster/ 21 | } 22 | #------------------------------------------------------------------------------- 23 | # Copy entities json 24 | #------------------------------------------------------------------------------- 25 | 26 | if [[ $JHI_REPO != "" ]]; then 27 | prepareFolder 28 | fi 29 | 30 | if [[ ("$JHI_ENTITY" == "mongodb") || ("$JHI_ENTITY" == "couchbase") ]]; then 31 | moveEntity DocumentBankAccount 32 | 33 | moveEntity FieldTestEntity 34 | moveEntity FieldTestMapstructEntity 35 | moveEntity FieldTestServiceClassEntity 36 | moveEntity FieldTestServiceImplEntity 37 | moveEntity FieldTestInfiniteScrollEntity 38 | moveEntity FieldTestPaginationEntity 39 | 40 | elif [[ "$JHI_ENTITY" == "cassandra" ]]; then 41 | moveEntity CassBankAccount 42 | 43 | moveEntity CassTestEntity 44 | moveEntity CassTestMapstructEntity 45 | moveEntity CassTestServiceClassEntity 46 | moveEntity CassTestServiceImplEntity 47 | 48 | elif [[ "$JHI_ENTITY" == "micro" ]]; then 49 | moveEntity MicroserviceBankAccount 50 | moveEntity MicroserviceOperation 51 | moveEntity MicroserviceLabel 52 | 53 | moveEntity FieldTestEntity 54 | moveEntity FieldTestMapstructEntity 55 | moveEntity FieldTestServiceClassEntity 56 | moveEntity FieldTestServiceImplEntity 57 | moveEntity FieldTestInfiniteScrollEntity 58 | moveEntity FieldTestPaginationEntity 59 | 60 | elif [[ "$JHI_ENTITY" == "uaa" ]]; then 61 | moveEntity FieldTestEntity 62 | moveEntity FieldTestMapstructEntity 63 | moveEntity FieldTestServiceClassEntity 64 | moveEntity FieldTestServiceImplEntity 65 | moveEntity FieldTestInfiniteScrollEntity 66 | moveEntity FieldTestPaginationEntity 67 | 68 | elif [[ "$JHI_ENTITY" == "sqllight" ]]; then 69 | moveEntity BankAccount 70 | moveEntity Label 71 | moveEntity Operation 72 | 73 | elif [[ "$JHI_ENTITY" == "sqlfull" ]]; then 74 | moveEntity BankAccount 75 | moveEntity Label 76 | moveEntity Operation 77 | moveEntity Place 78 | moveEntity Division 79 | 80 | moveEntity FieldTestEntity 81 | moveEntity FieldTestMapstructEntity 82 | moveEntity FieldTestServiceClassEntity 83 | moveEntity FieldTestServiceImplEntity 84 | moveEntity FieldTestInfiniteScrollEntity 85 | moveEntity FieldTestPaginationEntity 86 | 87 | moveEntity TestEntity 88 | moveEntity TestMapstruct 89 | moveEntity TestServiceClass 90 | moveEntity TestServiceImpl 91 | moveEntity TestInfiniteScroll 92 | moveEntity TestPagination 93 | moveEntity TestManyToOne 94 | moveEntity TestManyToMany 95 | moveEntity TestManyRelPaginDTO 96 | moveEntity TestOneToOne 97 | moveEntity TestCustomTableName 98 | moveEntity TestTwoRelationshipsSameEntity 99 | moveEntity SuperMegaLargeTestEntity 100 | 101 | moveEntity EntityWithDTO 102 | moveEntity EntityWithPagination 103 | moveEntity EntityWithPaginationAndDTO 104 | moveEntity EntityWithServiceClass 105 | moveEntity EntityWithServiceClassAndDTO 106 | moveEntity EntityWithServiceClassAndPagination 107 | moveEntity EntityWithServiceClassPaginationAndDTO 108 | moveEntity EntityWithServiceImpl 109 | moveEntity EntityWithServiceImplAndDTO 110 | moveEntity EntityWithServiceImplAndPagination 111 | moveEntity EntityWithServiceImplPaginationAndDTO 112 | 113 | #moveEntity MapsIdParentEntityWithoutDTO 114 | #moveEntity MapsIdChildEntityWithoutDTO 115 | #moveEntity MapsIdParentEntityWithDTO 116 | #moveEntity MapsIdChildEntityWithDTO 117 | #moveEntity MapsIdUserProfileWithDTO 118 | 119 | elif [[ "$JHI_ENTITY" == "sql" ]]; then 120 | moveEntity BankAccount 121 | moveEntity Label 122 | moveEntity Operation 123 | 124 | moveEntity FieldTestEntity 125 | moveEntity FieldTestMapstructEntity 126 | moveEntity FieldTestServiceClassEntity 127 | moveEntity FieldTestServiceImplEntity 128 | moveEntity FieldTestInfiniteScrollEntity 129 | moveEntity FieldTestPaginationEntity 130 | 131 | moveEntity EntityWithDTO 132 | moveEntity EntityWithPagination 133 | moveEntity EntityWithPaginationAndDTO 134 | moveEntity EntityWithServiceClass 135 | moveEntity EntityWithServiceClassAndDTO 136 | moveEntity EntityWithServiceClassAndPagination 137 | moveEntity EntityWithServiceClassPaginationAndDTO 138 | moveEntity EntityWithServiceImpl 139 | moveEntity EntityWithServiceImplAndDTO 140 | moveEntity EntityWithServiceImplAndPagination 141 | moveEntity EntityWithServiceImplPaginationAndDTO 142 | 143 | #moveEntity MapsIdUserProfileWithDTO 144 | 145 | fi 146 | 147 | #------------------------------------------------------------------------------- 148 | # Copy entities json 149 | #------------------------------------------------------------------------------- 150 | echo "*** Entities:" 151 | ls -al "$JHI_FOLDER_APP"/.jhipster/ 152 | -------------------------------------------------------------------------------- /test-integration/scripts/12-generate-project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Force no insight 8 | #------------------------------------------------------------------------------- 9 | if [ "$JHI_FOLDER_APP" == "$HOME/app" ]; then 10 | mkdir -p "$HOME"/.config/configstore/ 11 | cp "$JHI_INTEG"/configstore/*.json "$HOME"/.config/configstore/ 12 | fi 13 | 14 | if [[ "$JHI_ENTITY" == "jdl" ]]; then 15 | #------------------------------------------------------------------------------- 16 | # Generate with JDL 17 | #------------------------------------------------------------------------------- 18 | mkdir -p "$JHI_FOLDER_APP" 19 | cp -f "$JHI_SAMPLES"/"$JHI_APP"/*.jdl "$JHI_FOLDER_APP"/ 20 | cd "$JHI_FOLDER_APP" 21 | jhipster import-jdl *.jdl --no-insight 22 | 23 | else 24 | #------------------------------------------------------------------------------- 25 | # Generate UAA project with jhipster 26 | #------------------------------------------------------------------------------- 27 | if [[ "$JHI_APP" == *"uaa"* ]]; then 28 | mkdir -p "$JHI_FOLDER_UAA" 29 | cp -f "$JHI_SAMPLES"/uaa/.yo-rc.json "$JHI_FOLDER_UAA"/ 30 | cd "$JHI_FOLDER_UAA" 31 | jhipster --force --no-insight --with-entities --skip-checks --from-cli 32 | ls -al "$JHI_FOLDER_UAA" 33 | fi 34 | 35 | #------------------------------------------------------------------------------- 36 | # Generate project with jhipster 37 | #------------------------------------------------------------------------------- 38 | mkdir -p "$JHI_FOLDER_APP" 39 | cp -f "$JHI_SAMPLES"/"$JHI_APP"/.yo-rc.json "$JHI_FOLDER_APP"/ 40 | cd "$JHI_FOLDER_APP" 41 | jhipster --force --no-insight --skip-checks --with-entities --from-cli 42 | yo jhipster-grpc --force --all-entities 43 | 44 | fi 45 | 46 | #------------------------------------------------------------------------------- 47 | # Check folder where the app is generated 48 | #------------------------------------------------------------------------------- 49 | ls -al "$JHI_FOLDER_APP" 50 | git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit 51 | -------------------------------------------------------------------------------- /test-integration/scripts/13-replace-version-generated-project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | 7 | if [[ "$JHI_LIB_BRANCH" == "release" ]]; then 8 | echo "*** no need to change version in generated project" 9 | exit 0 10 | fi 11 | 12 | if [[ $JHI_VERSION == '' ]]; then 13 | JHI_VERSION=0.0.0-CICD 14 | fi 15 | 16 | # replace version in uaa 17 | if [[ "$JHI_APP" == *"uaa"* ]]; then 18 | cd "$JHI_FOLDER_UAA" 19 | sed -e 's/.*<\/jhipster-dependencies.version>/'$JHI_VERSION'<\/jhipster-dependencies.version>/1;' pom.xml > pom.xml.sed 20 | mv -f pom.xml.sed pom.xml 21 | cat pom.xml | grep \ 22 | fi 23 | 24 | # jhipster-dependencies.version in generated pom.xml or gradle.properties 25 | cd "$JHI_FOLDER_APP" 26 | if [[ -a mvnw ]]; then 27 | sed -e 's/.*<\/jhipster-dependencies.version>/'$JHI_VERSION'<\/jhipster-dependencies.version>/1;' pom.xml > pom.xml.sed 28 | mv -f pom.xml.sed pom.xml 29 | cat pom.xml | grep \ 30 | 31 | elif [[ -a gradlew ]]; then 32 | sed -e 's/jhipster_dependencies_version=.*/jhipster_dependencies_version='$JHI_VERSION'/1;' gradle.properties > gradle.properties.sed 33 | mv -f gradle.properties.sed gradle.properties 34 | cat gradle.properties | grep jhipster_dependencies_version= 35 | 36 | fi 37 | -------------------------------------------------------------------------------- /test-integration/scripts/14-jhipster-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | cd "$JHI_FOLDER_APP" 7 | jhipster info 8 | -------------------------------------------------------------------------------- /test-integration/scripts/20-docker-compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Start docker container 8 | #------------------------------------------------------------------------------- 9 | cd "$JHI_FOLDER_APP" 10 | if [ -a src/main/docker/keycloak.yml ]; then 11 | docker-compose -f src/main/docker/keycloak.yml up -d 12 | fi 13 | if [ -a src/main/docker/elasticsearch.yml ]; then 14 | docker-compose -f src/main/docker/elasticsearch.yml up -d 15 | fi 16 | if [ -a src/main/docker/kafka.yml ]; then 17 | docker-compose -f src/main/docker/kafka.yml up -d 18 | fi 19 | if [ -a src/main/docker/consul.yml ]; then 20 | docker-compose -f src/main/docker/consul.yml up -d 21 | fi 22 | if [ -a src/main/docker/cassandra.yml ]; then 23 | docker-compose -f src/main/docker/cassandra.yml up -d 24 | fi 25 | if [ -a src/main/docker/mongodb.yml ]; then 26 | docker-compose -f src/main/docker/mongodb.yml up -d 27 | fi 28 | if [ -a src/main/docker/couchbase.yml ]; then 29 | # this container can't be started otherwise, it will be conflict with tests 30 | # so here, only prepare the image 31 | docker-compose -f src/main/docker/couchbase.yml build 32 | fi 33 | if [ -a src/main/docker/mysql.yml ]; then 34 | docker-compose -f src/main/docker/mysql.yml up -d 35 | fi 36 | if [ -a src/main/docker/postgresql.yml ]; then 37 | docker-compose -f src/main/docker/postgresql.yml up -d 38 | fi 39 | if [ -a src/main/docker/mariadb.yml ]; then 40 | docker-compose -f src/main/docker/mariadb.yml up -d 41 | fi 42 | if [ -a src/main/docker/redis.yml ]; then 43 | docker-compose -f src/main/docker/redis.yml up -d 44 | fi 45 | if [ -a src/main/docker/memcached.yml ]; then 46 | docker-compose -f src/main/docker/memcached.yml up -d 47 | fi 48 | if [ -a src/main/docker/jhipster-registry.yml ]; then 49 | docker-compose -f src/main/docker/jhipster-registry.yml up -d 50 | fi 51 | if [ "$JHI_SONAR" = 1 ]; then 52 | docker-compose -f src/main/docker/sonar.yml up -d 53 | fi 54 | docker ps -a 55 | -------------------------------------------------------------------------------- /test-integration/scripts/20-no-memory-limit-elasticsearch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | cd "$JHI_FOLDER_APP" 7 | if [ -a src/main/docker/elasticsearch.yml ]; then 8 | sed -i -e 's/ - \"ES_JAVA_OPTS=-Xms1024m -Xmx1024m\"/ # - \"ES_JAVA_OPTS=-Xms1024m -Xmx1024m\"/1;' src/main/docker/elasticsearch.yml 9 | cat src/main/docker/elasticsearch.yml 10 | fi 11 | -------------------------------------------------------------------------------- /test-integration/scripts/21-tests-backend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Display environment information like JDK version 8 | #------------------------------------------------------------------------------- 9 | cd "$JHI_FOLDER_APP" 10 | if [ -f "mvnw" ]; then 11 | ./mvnw -ntp enforcer:display-info 12 | elif [ -f "gradlew" ]; then 13 | ./gradlew -v 14 | fi 15 | 16 | #------------------------------------------------------------------------------- 17 | # Exclude webpack task from Gradle if not skipping client 18 | #------------------------------------------------------------------------------- 19 | JHI_GRADLE_EXCLUDE_WEBPACK="-x webpack" 20 | if [[ $(grep "\"skipClient\": true" .yo-rc.json) != "" ]]; then 21 | JHI_GRADLE_EXCLUDE_WEBPACK="" 22 | fi 23 | 24 | #------------------------------------------------------------------------------- 25 | # Check Javadoc generation 26 | #------------------------------------------------------------------------------- 27 | if [ -f "mvnw" ]; then 28 | ./mvnw -ntp javadoc:javadoc 29 | elif [ -f "gradlew" ]; then 30 | ./gradlew javadoc $JHI_GRADLE_EXCLUDE_WEBPACK 31 | fi 32 | 33 | #------------------------------------------------------------------------------- 34 | # Check no-http 35 | #------------------------------------------------------------------------------- 36 | if [ -f "mvnw" ]; then 37 | ./mvnw -ntp checkstyle:check 38 | elif [ -f "gradlew" ]; then 39 | ./gradlew checkstyleNohttp $JHI_GRADLE_EXCLUDE_WEBPACK 40 | fi 41 | 42 | #------------------------------------------------------------------------------- 43 | # Launch UAA tests 44 | #------------------------------------------------------------------------------- 45 | if [[ "$JHI_APP" == *"uaa"* ]]; then 46 | cd "$JHI_FOLDER_UAA" 47 | ./mvnw -ntp verify 48 | fi 49 | 50 | #------------------------------------------------------------------------------- 51 | # Launch tests 52 | #------------------------------------------------------------------------------- 53 | cd "$JHI_FOLDER_APP" 54 | if [ -f "mvnw" ]; then 55 | ./mvnw -ntp -P-webpack verify \ 56 | -Dlogging.level.ROOT=OFF \ 57 | -Dlogging.level.org.zalando=OFF \ 58 | -Dlogging.level.io.github.jhipster=OFF \ 59 | -Dlogging.level.io.github.jhipster.sample=OFF \ 60 | -Dlogging.level.org.springframework=OFF \ 61 | -Dlogging.level.org.springframework.web=OFF \ 62 | -Dlogging.level.org.springframework.security=OFF 63 | 64 | elif [ -f "gradlew" ]; then 65 | ./gradlew test integrationTest $JHI_GRADLE_EXCLUDE_WEBPACK \ 66 | -Dlogging.level.ROOT=OFF \ 67 | -Dlogging.level.org.zalando=OFF \ 68 | -Dlogging.level.io.github.jhipster=OFF \ 69 | -Dlogging.level.io.github.jhipster.sample=OFF \ 70 | -Dlogging.level.org.springframework=OFF \ 71 | -Dlogging.level.org.springframework.web=OFF \ 72 | -Dlogging.level.org.springframework.security=OFF 73 | fi 74 | -------------------------------------------------------------------------------- /test-integration/scripts/22-tests-frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Launch frontend tests 8 | #------------------------------------------------------------------------------- 9 | cd "$JHI_FOLDER_APP" 10 | if [[ $(grep yarn .yo-rc.json) != "" ]]; then 11 | JHI_CLIENT_PACKAGE_MANAGER=yarn 12 | else 13 | JHI_CLIENT_PACKAGE_MANAGER=npm 14 | fi 15 | 16 | if [ -f "tsconfig.json" ]; then 17 | if [ -f "src/main/webapp/app/app.tsx" ]; then 18 | $JHI_CLIENT_PACKAGE_MANAGER run test-ci 19 | else 20 | $JHI_CLIENT_PACKAGE_MANAGER test 21 | fi 22 | fi 23 | -------------------------------------------------------------------------------- /test-integration/scripts/23-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | source $(dirname $0)/00-init-env.sh 5 | 6 | #------------------------------------------------------------------------------- 7 | # Package UAA 8 | #------------------------------------------------------------------------------- 9 | if [[ "$JHI_APP" == *"uaa"* ]]; then 10 | cd "$JHI_FOLDER_UAA" 11 | ./mvnw -ntp verify -DskipTests -Pdev 12 | mv target/*.jar app.jar 13 | fi 14 | 15 | #------------------------------------------------------------------------------- 16 | # Decrease Angular timeout for Protractor tests 17 | #------------------------------------------------------------------------------- 18 | cd "$JHI_FOLDER_APP" 19 | if [ "$JHI_PROTRACTOR" == 1 ] && [ -e "src/main/webapp/app/core/core.module.ts" ]; then 20 | sed -e 's/alertTimeout: 5000/alertTimeout: 1/1;' src/main/webapp/app/core/core.module.ts > src/main/webapp/app/core/core.module.ts.sed 21 | mv -f src/main/webapp/app/core/core.module.ts.sed src/main/webapp/app/core/core.module.ts 22 | cat src/main/webapp/app/core/core.module.ts | grep alertTimeout 23 | fi 24 | 25 | #------------------------------------------------------------------------------- 26 | # Package the application 27 | #------------------------------------------------------------------------------- 28 | if [ "$JHI_WAR" == 1 ]; then 29 | if [ -f "mvnw" ]; then 30 | ./mvnw -ntp verify -DskipTests -P"$JHI_PROFILE",war 31 | mv target/*.war app.war 32 | elif [ -f "gradlew" ]; then 33 | ./gradlew bootWar -P"$JHI_PROFILE" -Pwar -x test 34 | mv build/libs/*SNAPSHOT.war app.war 35 | else 36 | echo "*** no mvnw or gradlew" 37 | exit 0 38 | fi 39 | if [ $? -ne 0 ]; then 40 | echo "*** error when packaging" 41 | exit 1 42 | fi 43 | else 44 | if [ -f "mvnw" ]; then 45 | ./mvnw -ntp verify -DskipTests -P"$JHI_PROFILE" 46 | mv target/*.jar app.jar 47 | elif [ -f "gradlew" ]; then 48 | ./gradlew bootJar -P"$JHI_PROFILE" -x test 49 | mv build/libs/*SNAPSHOT.jar app.jar 50 | else 51 | echo "*** no mvnw or gradlew" 52 | exit 0 53 | fi 54 | if [ $? -ne 0 ]; then 55 | echo "*** error when packaging" 56 | exit 1 57 | fi 58 | fi 59 | -------------------------------------------------------------------------------- /test-integration/scripts/24-tests-e2e.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname $0)/00-init-env.sh 4 | 5 | #------------------------------------------------------------------------------- 6 | # Specific for couchbase 7 | #------------------------------------------------------------------------------- 8 | cd "$JHI_FOLDER_APP" 9 | if [ -a src/main/docker/couchbase.yml ]; then 10 | docker-compose -f src/main/docker/couchbase.yml up -d 11 | sleep 20 12 | docker ps -a 13 | fi 14 | 15 | #------------------------------------------------------------------------------- 16 | # Functions 17 | #------------------------------------------------------------------------------- 18 | launchCurlOrProtractor() { 19 | retryCount=1 20 | maxRetry=10 21 | httpUrl="http://localhost:8080" 22 | if [[ "$JHI_APP" == *"micro"* ]]; then 23 | httpUrl="http://localhost:8081/management/health" 24 | fi 25 | 26 | rep=$(curl -v "$httpUrl") 27 | status=$? 28 | while [ "$status" -ne 0 ] && [ "$retryCount" -le "$maxRetry" ]; do 29 | echo "*** [$(date)] Application not reachable yet. Sleep and retry - retryCount =" $retryCount "/" $maxRetry 30 | retryCount=$((retryCount+1)) 31 | sleep 10 32 | rep=$(curl -v "$httpUrl") 33 | status=$? 34 | done 35 | 36 | if [ "$status" -ne 0 ]; then 37 | echo "*** [$(date)] Not connected after" $retryCount " retries." 38 | return 1 39 | fi 40 | 41 | if [ "$JHI_PROTRACTOR" != 1 ]; then 42 | return 0 43 | fi 44 | 45 | retryCount=0 46 | maxRetry=1 47 | until [ "$retryCount" -ge "$maxRetry" ] 48 | do 49 | result=0 50 | if [[ -f "tsconfig.json" ]]; then 51 | npm run e2e 52 | fi 53 | result=$? 54 | [ $result -eq 0 ] && break 55 | retryCount=$((retryCount+1)) 56 | echo "*** e2e tests failed... retryCount =" $retryCount "/" $maxRetry 57 | sleep 15 58 | done 59 | return $result 60 | } 61 | 62 | #------------------------------------------------------------------------------- 63 | # Run the application 64 | #------------------------------------------------------------------------------- 65 | if [ "$JHI_RUN_APP" == 1 ]; then 66 | if [[ "$JHI_APP" == *"uaa"* ]]; then 67 | cd "$JHI_FOLDER_UAA" 68 | java \ 69 | -jar app.jar \ 70 | --spring.profiles.active=dev \ 71 | --logging.level.ROOT=OFF \ 72 | --logging.level.org.zalando=OFF \ 73 | --logging.level.io.github.jhipster=OFF \ 74 | --logging.level.io.github.jhipster.sample=OFF & 75 | sleep 80 76 | fi 77 | 78 | cd "$JHI_FOLDER_APP" 79 | # Run the app packaged as war/jar 80 | if [[ "$JHI_WAR" == 1 ]]; then 81 | java \ 82 | -jar app.war \ 83 | --spring.profiles.active="$JHI_PROFILE" \ 84 | --logging.level.ROOT=OFF \ 85 | --logging.level.org.zalando=OFF \ 86 | --logging.level.org.springframework.web=ERROR \ 87 | --logging.level.io.github.jhipster=OFF \ 88 | --logging.level.io.github.jhipster.sample=OFF & 89 | echo $! > .pidRunApp 90 | else 91 | java \ 92 | -jar app.jar \ 93 | --spring.profiles.active="$JHI_PROFILE" \ 94 | --logging.level.ROOT=OFF \ 95 | --logging.level.org.zalando=OFF \ 96 | --logging.level.org.springframework.web=ERROR \ 97 | --logging.level.io.github.jhipster=OFF \ 98 | --logging.level.io.github.jhipster.sample=OFF & 99 | echo $! > .pidRunApp 100 | fi 101 | sleep 40 102 | 103 | launchCurlOrProtractor 104 | resultRunApp=$? 105 | kill $(cat .pidRunApp) 106 | 107 | exit $((resultRunApp)) 108 | fi 109 | -------------------------------------------------------------------------------- /test-integration/scripts/25-sonar-analyze.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source $(dirname $0)/00-init-env.sh 4 | 5 | #-------------------------------------------------- 6 | # Launch Sonar analysis 7 | #-------------------------------------------------- 8 | cd "$JHI_FOLDER_APP" 9 | 10 | if [[ "$JHI_APP" = "ngx-default" && "$GITHUB_REPOSITORY" = "jhipster/generator-jhipster" && "$GITHUB_REF" = "refs/heads/master" ]]; then 11 | echo "*** Sonar analyze for master branch" 12 | ./mvnw -ntp initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \ 13 | -Dsonar.host.url=https://sonarcloud.io \ 14 | -Dsonar.projectKey=jhipster-sample-application \ 15 | -Dsonar.organization=jhipster \ 16 | -Dsonar.login=$SONAR_TOKEN 17 | 18 | elif [[ $JHI_SONAR = 1 ]]; then 19 | echo "*** Sonar analyze locally" 20 | ./mvnw -ntp initialize org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar \ 21 | -Dsonar.host.url=http://localhost:9001 \ 22 | -Dsonar.projectKey=JHipsterSonar 23 | 24 | sleep 30 25 | docker-compose -f src/main/docker/sonar.yml logs 26 | echo "*** Sonar results:" 27 | curl 'http://localhost:9001/api/measures/component?componentKey=JHipsterSonar&metricKeys=bugs%2Ccoverage%2Cvulnerabilities%2Cduplicated_lines_density%2Ccode_smells' 28 | 29 | else 30 | echo "*** No sonar analyze" 31 | 32 | fi 33 | -------------------------------------------------------------------------------- /test/templates/default/.yo-rc.json: -------------------------------------------------------------------------------- 1 | { 2 | "generator-jhipster": { 3 | "baseName": "sampleMysql", 4 | "packageName": "com.mycompany.myapp", 5 | "packageFolder": "com/mycompany/myapp", 6 | "authenticationType": "session", 7 | "hibernateCache": "ehcache", 8 | "clusteredHttpSession": "no", 9 | "websocket": "no", 10 | "databaseType": "sql", 11 | "devDatabaseType": "h2Disk", 12 | "prodDatabaseType": "mysql", 13 | "searchEngine": "no", 14 | "useSass": false, 15 | "buildTool": "maven", 16 | "frontendBuilder": "grunt", 17 | "enableTranslation": true, 18 | "enableSocialSignIn": false, 19 | "rememberMeKey": "2bb60a80889aa6e6767e9ccd8714982681152aa5", 20 | "testFrameworks": [ 21 | 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/test-app.js: -------------------------------------------------------------------------------- 1 | /*'use strict'; 2 | var path = require('path'); 3 | var fse = require('fs-extra'); 4 | var assert = require('yeoman-assert'); 5 | var helpers = require('yeoman-test'); 6 | 7 | var deps = [ 8 | [helpers.createDummyGenerator(), 'jhipster:modules'] 9 | ]; 10 | 11 | describe('JHipster generator grpc', function () { 12 | describe('simple test', function () { 13 | before(function (done) { 14 | helpers 15 | .run(path.join( __dirname, '../generators/app')) 16 | .inTmpDir(function (dir) { 17 | fse.copySync(path.join(__dirname, '../test/templates/default'), dir) 18 | }) 19 | .withOptions({ 20 | testmode: true 21 | }) 22 | .withPrompts({ 23 | message: 'simple message to say hello' 24 | }) 25 | .withGenerators(deps) 26 | .on('end', done); 27 | }); 28 | 29 | it('generate dummy.txt file', function () { 30 | assert.file([ 31 | 'dummy.txt' 32 | ]); 33 | }); 34 | }); 35 | }); 36 | */ 37 | --------------------------------------------------------------------------------