Run Test task while/or after Build task

I am trying to force run “test” and “jacocoVerification” tasks during/after application’s build for a gradle based spring-boot application, but it seems that none of the verification tasks like jacocoCoverage, test are being run while I build/run my spring boot application. I am able to run my test cases using gradlew test but launching my application using intellij launcher doesnt seem to run test cases at all.

Following is my build.gradle

buildscript {
ext {
springBootVersion = ‘2.1.3.RELEASE’
openFeignVersion = ‘10.3.0’
}
repositories {
mavenCentral()
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
}
}
plugins {
id ‘java’
}
apply plugin: ‘org.springframework.boot’
apply plugin: ‘io.spring.dependency-management’
apply plugin: ‘jacoco’
group ‘application’
version ‘1.0-SNAPSHOT’
sourceCompatibility = 1.8
ext {
springBootVersion = ‘2.1.3.RELEASE’
}
repositories {
mavenCentral()
}
dependencies {
implementation ‘org.projectlombok:lombok:1.18.16’
testImplementation ‘org.junit.jupiter:junit-jupiter-api:5.3.1’
testRuntimeOnly ‘org.junit.jupiter:junit-jupiter-engine:5.3.1’
testImplementation ‘org.mockito:mockito-core:2.28.2’
implementation(‘org.springframework.boot:spring-boot-starter-web’)
implementation(‘org.springframework.boot:spring-boot-starter-test’)
compileOnly(‘org.projectlombok:lombok:1.18.20’)
annotationProcessor(‘org.projectlombok:lombok:1.18.20’)
implementation(‘commons-beanutils:commons-beanutils:1.9.3’)
implementation project(“:core”)
}
test {
useJUnitPlatform()
}
dependencyManagement {
imports {
mavenBom “org.springframework.cloud:spring-cloud-dependencies:Greenwich.SR1”
mavenBom(“org.springframework.boot:spring-boot-dependencies:${springBootVersion}”)
}
}

I am using gradle 4.8