Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>academy-api-exercise</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
6 changes: 6 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
8 changes: 8 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
29 changes: 10 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,24 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<base.api.url>https://reqres.in/api/users</base.api.url>
<base.api.url>http://vps2.crowdaronline.com:8083</base.api.url>
<cucumber.stepsDefinitions>--glue ar/steps</cucumber.stepsDefinitions>
<cucumber.hooks>--glue com/crowdar/bdd/cukes --glue ar/apiExampleProject/hook</cucumber.hooks>
<cucumber.tags>@Success</cucumber.tags>
<cucumber.tags>@Smoke</cucumber.tags>
<cucumber.reporters>--plugin pretty</cucumber.reporters>
<crowdar.cucumber.option>src/test/resources/features ${cucumber.hooks} ${cucumber.stepsDefinitions} --tags 'not @Ignore' --tags ${cucumber.tags} ${cucumber.reporters}</crowdar.cucumber.option>
<crowdar.projectType>API</crowdar.projectType>

</properties>
<profiles>
<profile>
<id>Secuencial</id>
<activation>
</activation>
<properties>
<apiExample.runner>testng.xml</apiExample.runner>
</properties>
</profile>
<profile>
<id>Paralelo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<apiExample.runner>testngParalell.xml</apiExample.runner>
</properties>
</profile>
<id>Paralelo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<apiExample.runner>testngParalell.xml</apiExample.runner>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
Expand Down
84 changes: 84 additions & 0 deletions pom.xml_bkp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.lippia</groupId>
<artifactId>root</artifactId>
<version>3.2.1.1</version>
</parent>

<groupId>com.Crowdar</groupId>
<artifactId>lippia-api-example-project</artifactId>
<name>api-rest-automation</name>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<base.api.url>http://vps2.crowdaronline.com:8083</base.api.url>
<cucumber.stepsDefinitions>--glue ar/steps</cucumber.stepsDefinitions>
<cucumber.hooks>--glue com/crowdar/bdd/cukes --glue
ar/apiExampleProject/hook</cucumber.hooks>
<cucumber.tags>@Smoke</cucumber.tags>
<cucumber.reporters>--plugin pretty</cucumber.reporters>
<crowdar.cucumber.option>src/test/resources/features ${cucumber.hooks}
${cucumber.stepsDefinitions} --tags 'not @Ignore' --tags
${cucumber.tags} ${cucumber.reporters}</crowdar.cucumber.option>
<crowdar.projectType>API</crowdar.projectType>

</properties>
<profiles>
<profile>
<id>Secuencial</id>
<activation>
</activation>
<properties>
<apiExample.runner>testng.xml</apiExample.runner>
</properties>
</profile>
<profile>
<id>Paralelo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<apiExample.runner>testngParalell.xml</apiExample.runner>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.lippia</groupId>
<artifactId>core</artifactId>
<version>3.2.1.1</version>
</dependency>
</dependencies>
<build>
<filters>
<filter>src/main/resources/cucumber.properties</filter>
</filters>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>${apiExample.runner}</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>crowdarRepo</id>
<name>crowdar-repository</name>
<url>https://nexus-v3-repositories.automation.crowdaronline.com/repository/maven-public/</url>
</repository>
</repositories>


</project>
14 changes: 14 additions & 0 deletions src/main/java/api/config/EntityConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import services.ResponseHeadersService;
import services.UserService;
import services.AuthorsService;
import services.EnvironmentService;

public enum EntityConfiguration {

Expand All @@ -12,6 +14,18 @@ public Class<?> getEntityService() {
}

},
AUTHORS{
@Override
public Class<?> getEntityService() {
return AuthorsService.class;
}
},
ENVIRONMENT{
@Override
public Class<?> getEntityService() {
return EnvironmentService.class;
}
},
RESPONSE_HEADERS {
@Override
public Class<?> getEntityService() {
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/api/model/Data.java

This file was deleted.

100 changes: 66 additions & 34 deletions src/main/java/api/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,88 @@

public class User {

@JsonProperty("id")
private int id;
@JsonProperty("email")
private String email;
@JsonProperty("first_name")
private String first_name;
@JsonProperty("last_name")
private String last_name;
@JsonProperty("avatar")
private String avatar;
@JsonProperty("jwt")
private String jwt;
@JsonProperty("expires")
private int expires;
@JsonProperty("username")
private String username;
@JsonProperty("role")
private String[] role;
@JsonProperty("timestamp")
private String timestamp;
@JsonProperty("status")
private int status;
@JsonProperty("error")
private String error;
@JsonProperty("message")
private String message;
@JsonProperty("path")
private String path;


public int getId() {
return id;
public String getJwt() {
return jwt;
}

public void setId(int id) {
this.id = id;
public void setJwt(String jwt) {
this.jwt = jwt;
}

public String getEmail() {
return email;
public int getExpires() {
return expires;
}

public void setEmail(String email) {
this.email = email;
public void setEmail(int expires) {
this.expires = expires;
}

public String getFirst_name() {
return first_name;
public String getUsername() {
return username;
}

public void setFirst_name(String first_name) {
this.first_name = first_name;
public void setUsername(String username) {
this.username = username;
}

public String getLast_name() {
return last_name;
public String[] getRole() {
return role;
}

public void setLast_name(String last_name) {
this.last_name = last_name;
}

public String getAvatar() {
return avatar;
}

public void setAvatar(String avatar) {
this.avatar = avatar;
public void setRole(String[] role) {
this.role = role;
}

public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}


}
Loading