/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you 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.
 */
dependencies {
    // testCompile dependencies are ONLY used in src/test, not src/main.
    // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly!
    //
    tomcat 'org.apache.tomcat:tomcat:10.1.20@zip'
    testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"),
            project(path: ':fineract-core', configuration: 'runtimeElements'),
            project(path: ':fineract-accounting', configuration: 'runtimeElements'),
            project(path: ':fineract-investor', configuration: 'runtimeElements'),
            project(path: ':fineract-loan', configuration: 'runtimeElements'),
            project(path: ':fineract-savings', configuration: 'runtimeElements'),
            project(path: ':fineract-provider', configuration: 'runtimeElements'),
            project(path: ':fineract-avro-schemas', configuration: 'runtimeElements'),
            project(path: ':fineract-client', configuration: 'runtimeElements'),
            'com.intuit.karate:karate-junit5',
            // 'com.google.code.gson:gson',
            )
    testImplementation ('org.mock-server:mockserver-junit-jupiter') {
        exclude group: 'com.sun.mail', module: 'mailapi'
        exclude group: 'javax.servlet', module: 'javax.servlet-api'
        exclude group: 'javax.validation'
    }
    testImplementation ('io.rest-assured:rest-assured') {
        exclude group: 'commons-logging'
        exclude group: 'org.apache.sling'
        exclude group: 'com.sun.xml.bind'
    }
    testImplementation 'org.apache.groovy:groovy-xml'
    testImplementation 'org.apache.groovy:groovy-json'
    testImplementation 'org.awaitility:awaitility'

    testCompileOnly 'org.projectlombok:lombok'
    testAnnotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.assertj:assertj-core'

    testImplementation 'org.mapstruct:mapstruct'
    testAnnotationProcessor 'org.mapstruct:mapstruct-processor'

    testImplementation 'com.github.tomakehurst:wiremock-standalone:3.0.1'
}
