/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch 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. */ plugins { id 'java' id "io.freefair.lombok" id 'jacoco' } dependencies { implementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre' implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${versions.jackson}" implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${versions.jackson_databind}" implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${versions.jackson}" implementation 'com.google.code.gson:gson:2.8.9' implementation project(':core') implementation project(':opensearch') testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.12.4' testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.12.4' } configurations.all { resolutionStrategy.force "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" } test { useJUnitPlatform() testLogging { events "passed", "skipped", "failed" exceptionFormat "full" } } jacocoTestReport { reports { html.enabled true xml.enabled true } afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it) })) } } test.finalizedBy(project.tasks.jacocoTestReport) jacocoTestCoverageVerification { violationRules { rule { limit { counter = 'LINE' minimum = 1.0 } limit { counter = 'BRANCH' minimum = 1.0 } } } afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it) })) } } check.dependsOn jacocoTestCoverageVerification jacocoTestCoverageVerification.dependsOn jacocoTestReport