<%#
 Copyright 2013-2018 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see http://www.jhipster.tech/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
<%_
let cacheManagerIsAvailable = false;
if (['ehcache', 'hazelcast', 'infinispan'].includes(cacheProvider) || applicationType === 'gateway') {
    cacheManagerIsAvailable = true;
}
_%>
# ===================================================================
# Spring Boot configuration.
#
# This configuration is used for unit/integration tests.
#
# More information on profiles: http://www.jhipster.tech/profiles/
# More information on configuration properties: http://www.jhipster.tech/common-application-properties/
# ===================================================================

# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ===================================================================

<%_ if (serviceDiscoveryType === 'eureka') { _%>
eureka:
    client:
        enabled: true
    instance:
        appname: <%= baseName %>
        instanceId: <%= baseName %>:${spring.application.instance-id:${random.value}}
<%_ } _%>

spring:
    application:
        name: <%= baseName %>
    jackson:
        serialization.write_dates_as_timestamps: false
    <%_ if (cacheManagerIsAvailable === true) { _%>
    cache:
        type: simple
    <%_ } _%>
    <%_ if (messageBroker === 'kafka') { _%>
    cloud:
        stream:
            kafka:
                binder:
                    brokers: localhost
                    zk-nodes: localhost
            bindings:
                output:
                    destination: topic-jhipster
    <%_ } _%>
    <%_ if (databaseType === 'sql') { _%>
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: jdbc:h2:mem:<%= baseName %>;DB_CLOSE_DELAY=-1
        name:
        username:
        password:
    jpa:
        database-platform: io.github.jhipster.domain.util.FixedH2Dialect
        database: H2
        open-in-view: false
        show-sql: false
        hibernate:
            ddl-auto: none
            naming:
                physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
                implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
        properties:
            hibernate.id.new_generator_mappings: true
            hibernate.cache.use_second_level_cache: false
            hibernate.cache.use_query_cache: false
            hibernate.generate_statistics: true
            hibernate.hbm2ddl.auto: validate
    <%_ } _%>
    <%_ if (databaseType === 'mongodb' || databaseType === 'cassandra' || searchEngine === 'elasticsearch') { _%>
    data:
    <%_ } _%>
    <%_ if (databaseType === 'mongodb') { _%>
        mongodb:
            host: localhost
            port: 0
            database: <%= baseName %>
    <%_ } _%>
    <%_ if (databaseType === 'cassandra') { _%>
        cassandra:
            contactPoints: localhost
            port: 0
            protocolVersion: V4
            compression: NONE
            keyspaceName: cassandra_unit_keyspace
    <%_ } _%>
    <%_ if (searchEngine === 'elasticsearch') { _%>
        elasticsearch:
            cluster-name:
            cluster-nodes:
            properties:
                path:
                    logs: <%= BUILD_DIR %>elasticsearch/log
                    data: <%= BUILD_DIR %>elasticsearch/data
    <%_ } _%>
    <%_ if (databaseType === 'couchbase') { _%>
    couchbase:
        bucket:
            name: jhipster
    <%_ } _%>
    mail:
        host: localhost
    messages:
        basename: i18n/messages
    mvc:
        favicon:
            enabled: false
    thymeleaf:
        mode: XHTML

liquibase:
    contexts: test

server:
    port: 10344
    address: localhost

info:
    project:
        version: #project.version#

# ===================================================================
# JHipster specific properties
#
# Full reference is available at: http://www.jhipster.tech/common-application-properties/
# ===================================================================

jhipster:
    async:
        core-pool-size: 1
        max-pool-size: 50
        queue-capacity: 10000
    # To test logstash appender
    logging:
        logstash:
            enabled: true
            host: localhost
            port: 5000
            queue-size: 512
<%_ if (!skipUserManagement || authenticationType === 'oauth2') { _%>
    mail:
        from: test@localhost
        base-url: http://127.0.0.1:8080
<%_ } _%>
<%_ if (authenticationType === 'jwt' || authenticationType === 'uaa') { _%>
    security:
        authentication:
    <%_ if (authenticationType === 'jwt' || authenticationType === 'uaa') { _%>
            jwt:
                secret: <%= jwtSecretKey %>
                # Token is valid 24 hours
                token-validity-in-seconds: 86400
    <%_ } _%>
    <%_ if ((applicationType === 'microservice' || applicationType === 'uaa') && authenticationType === 'uaa') { _%>
        client-authorization:
            <%_ if (applicationType !== 'uaa') { _%>
            access-token-uri: http://<%= uaaBaseName.toLowerCase() %>/oauth/token
            token-service-id: <%= uaaBaseName.toLowerCase() %>
            <%_ } _%>
            client-id: internal
            client-secret: internal
    <%_ } _%>
<%_ } _%>
<%_ if (authenticationType === 'session') { _%>
    security:
        remember-me:
            # security key (this key should be unique for your application, and kept secret)
            key: <%= rememberMeKey %>
<%_ } _%>
    metrics: # DropWizard Metrics configuration, used by MetricsConfiguration
        jmx.enabled: true
        logs: # Reports Dropwizard metrics in the logs
            enabled: true
            report-frequency: 60 # in seconds

# ===================================================================
# Application specific properties
# Add your own application properties here, see the ApplicationProperties class
# to have type-safe configuration, like in the JHipsterProperties above
#
# More documentation is available at:
# http://www.jhipster.tech/common-application-properties/
# ===================================================================

application:
