package lv.ctco.cukes.rabbitmq.api.then;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import cucumber.api.java.en.Then;
import lv.ctco.cukes.rabbitmq.facade.ResponseFacade;
import lv.ctco.cukesrest.internal.context.InflateContext;
import org.apache.commons.lang3.NotImplementedException;

@Singleton
@InflateContext
public class MessageAssertionSteps {

    @Inject
    ResponseFacade responseFacade;

    @Then("^message body is empty$")
    public void assertMessageBodyIsEmpty() {
        throw new NotImplementedException("Not yet implemented");
    }

    @Then("^message body is not empty$")
    public void assertMessageBodyIsNotEmpty() {
        throw new NotImplementedException("Not yet implemented");
    }

    @Then("^message body equals to \"(.*)\"$")
    public void assertMessageBodyEqualsTo(String body) {
        responseFacade.assertMessageBodyEqualsTo(body);
    }

    @Then("^message body not equal to \"(.*)\"$")
    public void assertMessageBodyDoesNotEqualTo(String body) {
        throw new NotImplementedException("Not yet implemented");
    }

    @Then("^message body contains \"(.+)\"$")
    public void assertMessageBodyContains(String body) {
        throw new NotImplementedException("Not yet implemented");
    }

    @Then("^message body does not contain \"(.+)\"$")
    public void assertMessageBodyDoesNotContain(String body) {
            throw new NotImplementedException("Not yet implemented");
    }

    @Then("^message body contains property \"(.+)\" containing phrase \"(.*)\"$")
    public void assertMessageContainsPropertyWithPhrase(String path, String phrase) {
        responseFacade.assertMessageContainsPropertyWithPhrase(path, phrase);
    }

    @Then("^message body contains property \"(.+)\" with value \"(.*)\"$")
    public void assertMessageContainsPropertyWithValue(String path, String value) {
        responseFacade.assertMessageContainsPropertyWithValue(path, value);
    }

}

@@ -420,16 +420,213 @@
 acade;%0A%0A
+    @Then(%22%5Elet variable %5C%22(.+)%5C%22 equal to message body%22)%0A    public void variableAssignedFromMessageBody(String varName) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A
     @The
@@ -646,32 +646,32 @@
 ody is empty$%22)%0A
-
     public void 
@@ -1576,28 +1576,24 @@
 ing body) %7B%0A
-    
         thro
@@ -1638,32 +1638,32 @@
  implemented%22);%0A
+
     %7D%0A%0A    @Then
@@ -2061,24 +2061,24 @@
 ng value) %7B%0A
-
         resp
@@ -2148,10 +2148,1914 @@
 %0A    %7D%0A%0A
+    @Then(%22%5Emessage body contains property %5C%22(.+)%5C%22 with value other than %5C%22(.*)%5C%22$%22)%0A    public void assertMessageBodyContainsPathWithOtherValue(String path, String value) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains property %5C%22(.+)%5C%22 of type %5C%22(.+)%5C%22$%22)%0A    public void assertMessageBodyContainsPathOfType(String path, String type) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains an array %5C%22(.+)%5C%22 of size (%3E=%7C%3E%7C%3C=%7C%3C%7C%3C%3E) (%5C%5Cd+)$%22)%0A    public void assertMessageBodyContainsArrayWithSize(String path, String operator, Integer size) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains an array %5C%22(.+)%5C%22 of size (%5C%5Cd+)$%22)%0A    public void assertMessageBodyContainsArrayWithSize(String path, Integer size) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains an array %5C%22(.+)%5C%22 with value %5C%22(.*)%5C%22$%22)%0A    public void assertMessageBodyContainsArrayWithEntryHavingValue(String path, String value) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body does not contain property %5C%22(.+)%5C%22%22)%0A    public void assertMessageBodyDoesNotContainPath(String path) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains property %5C%22(.+)%5C%22 matching pattern %5C%22(.+)%5C%22$%22)%0A    public void assertMessageBodyContainsPathMatchingPattern(String path, String pattern) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A    @Then(%22%5Emessage body contains property %5C%22(.+)%5C%22 not matching pattern %5C%22(.+)%5C%22$%22)%0A    public void assertMessageBodyContainsPathNotMatchingPattern(String path, String pattern) %7B%0A        throw new NotImplementedException(%22Not yet implemented%22);%0A    %7D%0A%0A
 %7D%0A

Add JSON support #9 -- Step definitions added