Skip to content

Commit

Permalink
Resolves ctco#49
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Shnyakin authored and Alexey Shnyakin committed Sep 1, 2016
1 parent db49f37 commit deec44f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 13 additions & 6 deletions cukes-rest/src/main/java/lv/ctco/cukesrest/api/GivenSteps.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package lv.ctco.cukesrest.api;

import com.google.inject.*;
import cucumber.api.java.en.*;
import lv.ctco.cukesrest.*;
import lv.ctco.cukesrest.internal.*;
import lv.ctco.cukesrest.internal.context.*;
import lv.ctco.cukesrest.internal.resources.*;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import cucumber.api.java.en.Given;
import lv.ctco.cukesrest.CukesOptions;
import lv.ctco.cukesrest.internal.RequestSpecificationFacade;
import lv.ctco.cukesrest.internal.context.ContextScope;
import lv.ctco.cukesrest.internal.context.GlobalWorldFacade;
import lv.ctco.cukesrest.internal.resources.ResourceFileReader;

import java.io.File;

@Singleton
public class GivenSteps {
Expand Down Expand Up @@ -79,6 +83,9 @@ public void request_Body_From_File(String path) {
facade.body(reader.read(path));
}

@Given("^request body is a multipart file (.+)$")
public void request_Body_Is_A_Multipart_File(String path) { facade.multiPart(new File(path)); }

@Given("^session ID \"([^\"]+)\"$")
public void session_ID(String sessionId) {
facade.sessionId(sessionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public void header(String headerName, String headerValue) {
specification.header(headerName, headerValue);
}

public void multiPart(File file) {
specification.multiPart(file);
}

// TODO
public void multiPart(String controlName, File file, String mimeType) {
specification.multiPart(controlName, file, mimeType);
Expand Down

0 comments on commit deec44f

Please sign in to comment.