How to see my scenario names in Test Result in Java - java

In the Test Result section, the class names appear as classMethod. I use the cucumber test library for tests. In the Test Result section, I want to see the "Scenario:" names that I have specified in the feature file. What should I do about it? Can you help me?
build.gradle file:
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.+'
testCompile("io.github.bonigarcia:webdrivermanager:3.+")
testCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.+'
compile group: 'info.cukes', name: 'cucumber-java', version: '1.+'
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
testCompile group: 'org.testng', name: 'testng', version: '6.14.3'
}
RunFeature class:
package feature;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
#RunWith(Cucumber.class)
#CucumberOptions(features = "src/test/java/testCases" )
public class RunFeatures {
}
Cucember feature:
Feature: OpenBrowser
Scenario: SelectBrowser
When I have opened "https://www.trendyol.com/" with "explorer" browser

You can print the scenario name in the #before hook using the below code.
#Before
public void scenarioInit(Scenario scenario){
String scenarioName = scenario.getName()
//log the name to logger or to console here
}
you can log the name into your logger or into console.

Related

Selenium 4 : Getting java.lang.NoSuchMethodError: org.openqa.selenium.WebElement.getDomAttribute(Ljava/lang/String;)Ljava/lang/String;

I am using selenium "4.1.2" with chrome 97. While selecting value from drop down using select class, getting exception:
java.lang.NoSuchMethodError: org.openqa.selenium.WebElement.getDomAttribute(Ljava/lang/String;)Ljava/lang/String;
Below are dependencies in my project:
ext {
selenium = '4.1.2'
webdrivermanager = '5.0.3'
}
dependencies {
compile("org.seleniumhq.selenium:selenium-java:${selenium}")
// compile("io.github.bonigarcia:webdrivermanager:${webdrivermanager}")
testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-firefox-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-ie-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-edge-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-safari-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:${selenium}"
testImplementation "org.seleniumhq.selenium:selenium-support:${selenium}"
testImplementation('org.junit.jupiter:junit-jupiter:5.5.1')
testImplementation 'org.hamcrest:hamcrest:2.1'
testImplementation 'org.hamcrest:hamcrest-library:2.1'
testCompile("org.junit.jupiter:junit-jupiter-api:5.7.2")
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
testRuntime("org.junit.platform:junit-platform-launcher:1.7.2")
testCompile('io.github.bonigarcia:selenium-jupiter:3.3.4')
compile group: 'io.qameta.allure', name: 'allure-junit5', version: '2.11.0'
compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.16'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
compile group: 'io.qameta.allure', name: 'allure-gradle', version: '2.7.0'
compile 'org.apache.maven.plugins:maven-surefire-plugin:2.21.0'
compile('com.assertthat:selenium-shutterbug:1.5')
compile 'org.slf4j:slf4j-nop:1.7.25'
implementation group: 'javax.mail', name: 'mail', version: '1.4.7'
implementation group: 'javax.mail', name: 'javax.mail-api', version: '1.6.2'
runtimeClasspath group: 'javax.mail', name: 'javax.mail-api', version: '1.6.2'
compile group: 'net.lightbody.bmp', name: 'browsermob-core', version: '2.1.4'
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.14'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.12.4'
compile group: 'ru.yandex.qatools.ashot', name: 'ashot', version: '1.5.4'
implementation group: 'org.json', name: 'json', version: '20201115'
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.7.2'
testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.7.2'
testImplementation group: 'org.junit.platform', name: 'junit-platform-surefire-provider', version: '1.3.2'
}
Any help in resolving this issue is highly appreciated.
This error message...
java.lang.NoSuchMethodError: org.openqa.selenium.WebElement.getDomAttribute(Ljava/lang/String;)Ljava/lang/String;
...is the result of dependency version conflict.
Deep Dive
As per #titusfortner comment in the discussion you need to crosscheck that everything related to Selenium is set to 4.x and that nothing that requires Selenium 3.x (e.g., Appium 7) is included in your dependencies as #asolntsev in the comment mentions:
All implementations of WebElement do override method getDomAttribute(). It never throws UnsupportedOperationException in real life.
Solution
You need to execute mvn dependency:tree or gradle dependencies and you will be able to trace the problem as described in this example.
I would try forcing below dependency in build.gradle
implementation (group: 'org.seleniumhq.selenium', name: 'selenium-api', version: '4.1.2') { force = true }
NoSuchMethod error occurs when dependency version conflict happens. If you are using lower version Appium, upgrading to following version,
implementation 'io.appium:java-client:8.0.0'
may resolve errors.

Spring Boot: Logback Issue with Owasp ESAPI version 2.2.3.1

I've recently started looking at how to sanitise any user inputs to my test api and I came across this tutorial
Before attempting the tutorial I had logging to console with GCP cloud as thats where I want to run my API.
Now after adding owasp esapi my application will not start when using version 2.2.3.1 of esapi. I just by sure luck attempted using a previous version and it works as in the application will start.
Below is the error I get from logback on application start up
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.SimpleLoggerFactory loaded from file:/Users/xxx/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.30/e606eac955f55ecf1d8edcccba04eb8ac98088dd/slf4j-simple-1.7.30.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory
Again, If I use version 2.2.2.0 I have no issues at all on startup. Can anyone with experience shed some light here. (PLEASE SEE EDIT)
Below is my gradle build file (note I'm also using GCP logging)
plugins {
id "org.springframework.boot" version "2.5.0"
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "idea"
id 'com.google.cloud.tools.jib' version '3.0.0'
}
group 'network.thefullstack.search-service'
version '1.0'
java {
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
}
jib.from.image = 'openjdk:15-jdk-buster'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
testImplementation group: 'org.springframework.security', name: 'spring-security-test'
implementation group: 'org.springframework.security', name: 'spring-security-oauth2-client'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux'
implementation('org.springframework.boot:spring-boot-starter-data-elasticsearch')
implementation group: 'org.springframework.data', name: 'spring-data-elasticsearch'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
compile group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging', version: '1.2.8.RELEASE'
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0'
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.11.2'
implementation group: 'org.openapitools', name: 'jackson-databind-nullable', version: '0.2.1'
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'org.json', name: 'json', version: '20210307'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.11'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.owasp:dependency-check-gradle:6.1.6'
compile (group: 'org.owasp.esapi', name: 'esapi', version: '2.2.2.0')
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompileOnly 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
jar {
manifest {
attributes(
'Main-Class': 'org.test.SearchServiceApplication'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
}
Here is my ESAPI.properties file:
ESAPI.Logger=org.owasp.esapi.logging.slf4j.Slf4JLogFactory
Here is an example of where I am logging:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.converter.Converter;
import java.util.Arrays;
public class StringToEnumConverter implements Converter<String, Filters> {
private static Logger logger = LoggerFactory.getLogger(StringToEnumConverter.class);
#Override
public Filters convert(String source) {
try {
logger.info("Attempting to convert ENUM param to uppercase {}", source);
return Filters.valueOf(source.toUpperCase());
} catch (IllegalArgumentException e) {
logger.error("Failed to convert ENUM param to uppercase {}", source);
throw new BadFilterRequestException("Error: Filter provide must be one of: " + Arrays.asList(Filters.values()), "Search");
}
}
}
EDIT: Using the older version while it will allow the API to start, it will fire this error message when its envoked:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.owasp.esapi.logging.slf4j.Slf4JLogFactory
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:340)
at org.owasp.esapi.util.ObjFactory.loadClassByStringName(ObjFactory.java:158)
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:81)
at org.owasp.esapi.ESAPI.logFactory(ESAPI.java:139)
at org.owasp.esapi.ESAPI.getLogger(ESAPI.java:155)
at org.owasp.esapi.reference.DefaultEncoder.<init>(DefaultEncoder.java:83)
at org.owasp.esapi.reference.DefaultEncoder.getInstance(DefaultEncoder.java:67)
... 46 common frames omitted
Thank you for your time

No tests found for given includes: JUNIT

I wrote a test for my method from the service, but the test won't run. Gives an error message! I did everything strictly according to the guide, I did not add anything new. There are few solutions to this problem on the Internet. What could be the problem?
P.S. I tried changing in runner settings -> test runner -> Gradle / Intelij Idea - not works.
Testing started at 17:43 ...
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> No tests found for given includes: [ru.coffeetearea.service.OrderServiceTest.setOrderService](filter.includeTestsMatching)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
4 actionable tasks: 2 executed, 2 up-to-date
build.gradle:
plugins {
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
// Без этих опций Mapstruct выдает ошибку на кириллицу!
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
//
dependencies {
// Thymeleaf
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf
compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.3.3.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation
compile group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '2.3.3.RELEASE'
// Swagger UI
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
// Swagger 2
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot
compile group: 'org.springframework.boot', name: 'spring-boot', version: '2.3.1.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.3.1.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jdbc
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.3.1.RELEASE'
// https://mvnrepository.com/artifact/org.postgresql/postgresql
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.14'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.3.1.RELEASE'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.3.1.RELEASE'
// https://mvnrepository.com/artifact/org.flywaydb/flyway-core
compile group: 'org.flywaydb', name: 'flyway-core', version: '6.5.1'
// MapStruct
implementation 'org.mapstruct:mapstruct:1.3.1.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.3.1.Final'
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
// https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-jpamodelgen
annotationProcessor('org.hibernate:hibernate-jpamodelgen:6.0.0.Alpha5')
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.3.2.RELEASE'
// https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt
compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
// https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180830.0359'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.5.10'
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.3.3.RELEASE'
testImplementation('org.junit.jupiter:junit-jupiter:5.4.0')
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
test {
useJUnitPlatform()
}
method makeOrder():
public OrderDTO makeOrder(MakeOrderDTO makeOrderDTO) {
Long userId = JwtUser.getCurrentUserID();
Order order = orderRepository.findByUserIdAndOrderStatus(userId, OrderStatus.NEW);
if (order == null) {
throw new MainNullPointerException("Ошибка! Ваша корзина пуста!");
}
order.setTotalCost(calculateOrderPrice(order));
order.setAddress(makeOrderDTO.getAddress());
order.setPhoneNumber(makeOrderDTO.getPhoneNumber());
order.setDateOrder(new Date());
order.setOrderStatus(OrderStatus.ACTIVE);
orderRepository.save(order);
return orderMapper.orderToOrderDTO(order);
}
My tests for method:
package ru.coffeetearea.service;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import ru.coffeetearea.dto.MakeOrderDTO;
import ru.coffeetearea.dto.OrderDTO;
import ru.coffeetearea.mappers.OrderMapper;
import ru.coffeetearea.model.Order;
import ru.coffeetearea.repository.OrderRepository;
#RunWith(SpringRunner.class)
#SpringBootTest
class OrderServiceTest {
#MockBean
private OrderRepository orderRepository;
#MockBean
private OrderMapper orderMapper;
private OrderService orderService;
#Autowired
public void setOrderService(OrderService orderService) {
this.orderService = orderService;
}
#Test
void makeOrder() {
MakeOrderDTO makeOrderDTO = new MakeOrderDTO();
OrderDTO orderDTO = orderService.makeOrder(makeOrderDTO);
Assert.assertNotNull(orderDTO.getAddress());
Assert.assertNotNull(orderDTO.getPhoneNumber());
}
}
I believe it may be related to your folder hierarchy.
Try to make your test folder hierarchy exactly the same as you src folder. Example:
Make sure you have set up your project structure the right sources. See the picture of intellij setup for project structure (right click on project > open module settings > modules > sources)

Error while compiling code for firebase admin

I got an error while compiling code for Firebase admin.
Error:
Following the info from http://www.slf4j.org/codes.html#StaticLoggerBinder I've tried adding all the dependencies one by one
adding
testCompile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.13.3'
or
testCompile group: 'org.slf4j', name: 'slf4j-nop', version: '1.8.0-beta4'
or
testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
or
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.8.0-beta4'
or
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
doesn't remove the error.
May I know what I'm going wrong with?
My Gradle file:
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'com.google.firebase:firebase-admin:6.13.0'
//None of these seem to remove the error
// testCompile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.13.3'
// testCompile group: 'org.slf4j', name: 'slf4j-nop', version: '1.8.0-beta4'
// testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
// testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.8.0-beta4'
// testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
My main Class
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.database.*;
import java.io.IOException;
public class MainClass {
public static void main(String[] args) throws IOException {
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.getApplicationDefault())
.setDatabaseUrl("https://{my database name}.firebaseio.com/")
.build();
FirebaseApp.initializeApp(options);
DatabaseReference ref = FirebaseDatabase.getInstance()
.getReference("restricted_access/secret_document");
ref.setValue("hiIII", new DatabaseReference.CompletionListener() {
#Override
public void onComplete(DatabaseError error, DatabaseReference ref) {
System.out.println("Completed");
}
});
}
}
May I know What I'm going wrong with? and How can I Correct it?
This warning message is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
If this problem doesnot solve try clear caches and restart.

Gradle Package does not exist

I am trying to build Gradle using ./gradlew build but during compilation getting following error package not found.In eclipse I am able to run refresh gradle but in command prompt facing the below issue :
> Task :compileJava FAILED
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: package io.restassured does not exist
import static io.restassured.RestAssured.given;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:3: error: static import only from classes and interfaces
import static io.restassured.RestAssured.given;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:21: error: package org.apache.commons.lang3 does not exist
import org.apache.commons.lang3.StringUtils;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:34: error: package io.restassured.response does not exist
import io.restassured.response.ExtractableResponse;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/BaseTest.java:35: error: package io.restassured.response does not exist
import io.restassured.response.Response;
^
/Users/Documents/em-cedm-integ-test/src/main/java/com/CedmTest.java:3: error: package org.junit.runner does not exist
import org.junit.runner.JUnitCore;
^
^
Build.gradle file I am using
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java'
allprojects {
repositories {
// You can declare any Maven/Ivy/file repository here.
maven {
url "http://repo.hortonworks.com/content/repositories/releases"
}
maven {
url "${artifactory_contextUrl}"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
maven {
url "${artifactory_contextUrl}/ip-fci-maven-virtual"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
configurations.all {
transitive = false
}
}
version = '1.0'
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.ibm.cedm.CedmTest'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
defaultTasks 'downloadFile'
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '12.0.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.7'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.7'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.7'
compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.3'
compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hbase', name: 'hbase-common', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hbase', name: 'hbase-client', version: '1.1.2.2.6.4.0-91'
compile group: 'org.apache.hadoop', name: 'hadoop-common', version: '2.7.3.2.6.4.0-91'
compile group: 'com.tdunning', name: 'json', version: '1.8'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10'
compile group: 'org.apache.oozie', name: 'oozie-client', version: '4.2.0'
compileOnly group: 'io.swagger', name: 'swagger-annotations', version: '1.5.12'
compileOnly group: 'javax', name: 'javaee-api', version: '7.0'
compile group: 'ip-fci-generic-local.fcco-core', name: 'fci-core-utils', version: 'master'
compile(group: 'ip-fci-generic-local.media', name: 'db2jcc4', version: '11.1.3')
testImplementation 'junit:junit:4.12'
testCompile group: 'commons-codec', name: 'commons-codec', version: '1.9'
testCompile group: 'com.tdunning', name: 'json', version: '1.8'
testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
testCompile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.6'
testCompile group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.10'
testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
testCompile group: 'commons-logging', name: 'commons-logging', version: '1.2'
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'rest-assured-common', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'json-path', version: '3.0.2'
testCompile group: 'io.rest-assured', name: 'xml-path', version: '3.0.2'
testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit', version: '1.5.2'
testCompile group: 'net.javacrumbs.json-unit', name: 'json-unit-core', version: '1.5.2'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.4'
testCompile group: 'org.codehaus.groovy', name: 'groovy-json', version: '2.4.4'
testCompile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.25'
}
/*
test {
filter {
//include specific method in any of the tests
includeTestsMatching "*createBasicIndividualParty"
}
}
*/
Can someone please tell me why it is so? and what changes I should I make it to work?
How dependency mapped
dependencies mapped with testCompile will be compiled with src/test/java classes
dependencies mapped with compile will be compiled with src/main/java classes
Issue with the gradle config
Few dependencies are mapped as testCompile but it could be referenced in production code src/main/java.
testCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
Should be
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'

Categories