Gradle and two testing framework like Junit and testng

Hi, i have in project two testing framework JUnit and TestNG, when i running the test task firstly testng working by all test classes and after junit. How me right configure gradle each testing framework run own tests? If exist a possible soluition without splitting configuration(different directories and prefix for classes)?
With best regards, Viacheslav Bondarchuk
Thanks in advance!

My currently build.gradle file following below:

plugins {
id ‘idea’
id ‘jacoco’
id ‘java-library’
id ‘maven-publish’
id ‘io.spring.dependency-management’
}

ext[‘elasticsearch.version’] = “${libs.versions.elasticsearchVersion.get()}”

repositories {
mavenCentral()
mavenLocal()
maven {
url = uri(‘Index of maven’)
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11);
}
}

group = ‘gamesys.sportsbook’
version = ‘0.4-SNAPSHOT’

dependencies {
annotationProcessor(libs.lombok)

implementation platform(libs.springBootDependenciesPlatform)
implementation(libs.bundles.apacheCommonsBundle)
implementation(libs.bundles.javaxBundle)
implementation(libs.javaObjectDiff)
implementation(libs.findBugs)
implementation(libs.jodaTime)
implementation(libs.guava)
implementation(libs.clonning)

compileOnly(libs.lombok)
compileOnly(libs.jetbrainsAnnotations)

testAnnotationProcessor(libs.lombok)

testImplementation(libs.junit)
testImplementation(libs.testNG)
testImplementation(libs.findBugs)
testImplementation(libs.clonning)
testImplementation(libs.javaObjectDiff)
testImplementation('org.springframework.boot:spring-boot-starter-test')

testCompileOnly(libs.lombok)
testCompileOnly(libs.jetbrainsAnnotations)

testRuntimeOnly(libs.junitVintageEngine)

}

publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}

tasks.withType(JavaCompile) {
options.encoding = ‘UTF-8’
}

tasks.named(“jacocoTestReport”) {
dependsOn(test)
}

def testngTask = tasks.register(“testng”, Test) {
useTestNG()
}

def junitTask = tasks.register(“junit”, Test) {
useJUnitPlatform()
}

test {
failFast(true)
finalizedBy(jacocoTestReport)
dependsOn(testngTask, junitTask)
testLogging {
exceptionFormat(“full”)
events(“passed”, “skipped”, “failed”)
}
}