Skip to content

Commit

Permalink
Cucumber Http Response Glue
Browse files Browse the repository at this point in the history
  • Loading branch information
nhojpatrick committed May 10, 2022
1 parent 8208210 commit 4aa3d4b
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 0 deletions.
4 changes: 4 additions & 0 deletions all-glue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-http-request-glue</artifactId>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-http-response-glue</artifactId>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-json-map-glue</artifactId>
Expand Down
1 change: 1 addition & 0 deletions all-glue/src/main/java11/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
requires org.junit.jupiter.api;
requires org.slf4j;
requires transitive com.github.nhojpatrick.cucumber.http.request.glue;
requires transitive com.github.nhojpatrick.cucumber.http.response.glue;
requires transitive com.github.nhojpatrick.cucumber.json.map.glue;
requires transitive com.github.nhojpatrick.cucumber.json.transform.glue;
requires transitive com.github.nhojpatrick.cucumber.state.glue;
Expand Down
5 changes: 5 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<artifactId>nhojpatrick-cucumber-http-response</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-http-response-glue</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-json-all</artifactId>
Expand Down
1 change: 1 addition & 0 deletions http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<module>request</module>
<module>request-glue</module>
<module>response</module>
<module>response-glue</module>
</modules>
<!--repositories / -->
<!--pluginRepositories / -->
Expand Down
83 changes: 83 additions & 0 deletions http/response-glue/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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 / -->
<modelVersion>4.0.0</modelVersion>
<!--parent / -->
<parent>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber</artifactId>
<version>1.0.2-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<!--groupId / -->
<!--artifactId / -->
<artifactId>nhojpatrick-cucumber-http-response-glue</artifactId>
<!--packaging / -->
<packaging>jar</packaging>
<!--name / -->
<!--version / -->
<!--description / -->
<!--url / -->
<!--prerequisites / -->
<!--issueManagement / -->
<!--ciManagement / -->
<!--inceptionYear / -->
<!--mailingLists / -->
<!--developers / -->
<!--contributors / -->
<!--licenses / -->
<!--scm / -->
<!--organization / -->
<!--build /-->
<!--profiles / -->
<!--modules / -->
<!--repositories / -->
<!--pluginRepositories / -->
<!--dependencies / -->
<dependencies>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-http-response</artifactId>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-state</artifactId>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.hamcrest</groupId>
<artifactId>nhojpatrick-hamcrest-lang</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
</dependencies>
<!--reports (Deprecated) / -->
<!--reporting / -->
<!--dependencyManagement / -->
<!--distributionManagement / -->
<!--properties / -->
<properties>
<project.Automatic-Module-Name>com.github.nhojpatrick.cucumber.http.response.glue</project.Automatic-Module-Name>
<project.surefire.argLine.jpms.module></project.surefire.argLine.jpms.module>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.github.nhojpatrick.cucumber.http.response.steps;

import com.github.nhojpatrick.cucumber.core.exceptions.IllegalKeyException;
import com.github.nhojpatrick.cucumber.state.RunState;
import com.github.nhojpatrick.cucumber.state.exceptions.NullRunStateException;
import com.github.nhojpatrick.cucumber.state.validation.RunStateValidatorFactory;
import com.google.inject.Inject;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.cucumber.java.en.Given;

import static com.github.nhojpatrick.cucumber.http.constants.HttpConstants.HTTP_RESPONSE_BODY;

public class HttpResponseSteps {

@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "Accepted will look at changing")
private final RunState runState;

@Inject
public HttpResponseSteps(final RunState runState) {
this.runState = runState;
}

@Given("http trace to url {string}")
public void httpTraceToUrl(final String url)
throws IllegalKeyException,
NullRunStateException {

RunStateValidatorFactory.getInstance()
.withValue(HTTP_RESPONSE_BODY)
.verify(this.runState);

throw new UnsupportedOperationException("To Be Implemented");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.github.nhojpatrick.cucumber.http.response.steps;

public class ModuleInfoHack {
}
9 changes: 9 additions & 0 deletions http/response-glue/src/main/java11/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module com.github.nhojpatrick.cucumber.http.response.glue {
requires transitive com.github.nhojpatrick.cucumber.http.constants;
requires transitive com.github.nhojpatrick.cucumber.http.core;
requires transitive com.github.nhojpatrick.cucumber.http.response;
requires transitive com.github.nhojpatrick.cucumber.state;
requires org.hamcrest;
requires org.junit.jupiter.api;
requires org.slf4j;
}
19 changes: 19 additions & 0 deletions http/response-glue/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="TestConsole %-5p %l %m%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="com.github.nhojpatrick.cucumber.http.response.steps" level="debug">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="com.github.nhojpatrick" level="info">
<AppenderRef ref="Console"/>
</Logger>
<Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,11 @@
<artifactId>nhojpatrick-cucumber-http-response</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-http-response-glue</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.github.nhojpatrick.cucumber</groupId>
<artifactId>nhojpatrick-cucumber-json-all</artifactId>
Expand Down

0 comments on commit 4aa3d4b

Please sign in to comment.