Exemplo n.º 1
0
  private MessageHandler fdAddEntityTagRequest() {
    HttpRequestExecutingMessageHandler handler =
        new HttpRequestExecutingMessageHandler(getEntityTagUrl());

    handler.setExpectedResponseType(String.class);
    return handler;
  }
 @Test
 public void withAdvice() {
   HttpRequestExecutingMessageHandler handler =
       (HttpRequestExecutingMessageHandler)
           new DirectFieldAccessor(this.withAdvice).getPropertyValue("handler");
   handler.handleMessage(new GenericMessage<String>("foo"));
   assertEquals(1, adviceCalled);
 }
Exemplo n.º 3
0
  private MessageHandler neoFindEntityTags() {
    SpelExpressionParser expressionParser = new SpelExpressionParser();

    HttpRequestExecutingMessageHandler handler =
        new HttpRequestExecutingMessageHandler(getEntityTags());

    handler.setExpectedResponseTypeExpression(
        expressionParser.parseExpression("T (org.flockdata.model.EntityTag[])"));
    Map<String, Expression> vars = new HashMap<>();
    vars.put("entityId", expressionParser.parseExpression("payload[0]"));
    handler.setUriVariableExpressions(vars);

    handler.setHttpMethod(HttpMethod.GET);
    return handler;
  }
Exemplo n.º 4
0
  private MessageHandler neoFindEntityTag() {
    SpelExpressionParser expressionParser = new SpelExpressionParser();

    HttpRequestExecutingMessageHandler handler =
        new HttpRequestExecutingMessageHandler(getEntityTag());

    handler.setExpectedResponseType(AbstractEntityTag.class);
    Map<String, Expression> vars = new HashMap<>();
    vars.put("entityId", expressionParser.parseExpression("payload[0]"));
    vars.put("tagType", expressionParser.parseExpression("payload[1]"));
    vars.put("tagCode", expressionParser.parseExpression("payload[2]"));
    vars.put("relationshipType", expressionParser.parseExpression("payload[3]"));
    handler.setUriVariableExpressions(vars);

    handler.setHttpMethod(HttpMethod.GET);
    return handler;
  }