Package ch.ralscha.extdirectspring.bean

Examples of ch.ralscha.extdirectspring.bean.ExtDirectResponse


    MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
    List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
        .getResponse().getContentAsByteArray());

    assertThat(responses).hasSize(1);
    ExtDirectResponse resp = responses.get(0);
    assertThat(resp.getAction()).isEqualTo("remoteProviderSimple");
    assertThat(resp.getMethod()).isEqualTo("method4b");
    assertThat(resp.getType()).isEqualTo("exception");
    assertThat(resp.getTid()).isEqualTo(2);
    assertThat(resp.getMessage()).isEqualTo("Houston, we have a problem");
    assertThat(resp.getResult()).isNull();
    assertThat(resp.getWhere()).isEqualTo("Space");
  }
View Full Code Here


    MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
    List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
        .getResponse().getContentAsByteArray());

    assertThat(responses).hasSize(1);
    ExtDirectResponse resp = responses.get(0);
    assertThat(resp.getAction()).isEqualTo("remoteProviderSimple2");
    assertThat(resp.getMethod()).isEqualTo("method4");
    assertThat(resp.getType()).isEqualTo("exception");
    assertThat(resp.getTid()).isEqualTo(2);
    assertThat(resp.getMessage()).isEqualTo("Server Error");
    assertThat(resp.getResult()).isNull();
    assertThat(resp.getWhere()).isNull();

  }
View Full Code Here

    MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
    List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
        .getResponse().getContentAsByteArray());

    assertThat(responses).hasSize(1);
    ExtDirectResponse resp = responses.get(0);
    assertThat(resp.getAction()).isEqualTo("remoteProviderSimple");
    assertThat(resp.getMethod()).isEqualTo("method11b");
    assertThat(resp.getType()).isEqualTo("exception");
    assertThat(resp.getTid()).isEqualTo(3);
    assertThat(resp.getMessage()).isEqualTo("Houston, we have a problem");
    assertThat(resp.getResult()).isNull();
    assertThat(resp.getWhere()).isEqualTo("Space");
  }
View Full Code Here

    MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
    List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
        .getResponse().getContentAsByteArray());

    assertThat(responses).hasSize(1);
    ExtDirectResponse resp = responses.get(0);
    assertThat(resp.getAction()).isEqualTo("remoteProviderSimple");
    assertThat(resp.getMethod()).isEqualTo("method11");
    assertThat(resp.getType()).isEqualTo("exception");
    assertThat(resp.getTid()).isEqualTo(3);
    assertThat(resp.getMessage()).isEqualTo("Houston, we have a problem");
    assertThat(resp.getResult()).isNull();
    assertThat(resp.getWhere()).isEqualTo("Space");

  }
View Full Code Here

  @Test
  public void testExceptionNameAsMessage() throws Exception {
    Configuration configuration = new Configuration();
    configuration.setSendExceptionMessage(true);
    ExtDirectResponse resp = runTest(configuration);
    assertThat(resp.getMessage()).isEqualTo("For input string: \"xxx\"");
    assertThat(resp.getWhere()).isNull();
  }
View Full Code Here

  public void testExceptionToMessage() throws Exception {
    Configuration configuration = new Configuration();
    Map<Class<?>, String> exceptionMessageMapping = new HashMap<Class<?>, String>();
    exceptionMessageMapping.put(NullPointerException.class, "null pointer");
    configuration.setExceptionToMessage(exceptionMessageMapping);
    ExtDirectResponse resp = runTest11(configuration);
    assertThat(resp.getMessage()).isEqualTo("null pointer");
    assertThat(resp.getWhere()).isNull();
  }
View Full Code Here

    Configuration configuration = new Configuration();
    configuration.setSendExceptionMessage(false);
    Map<Class<?>, String> exceptionMessageMapping = new HashMap<Class<?>, String>();
    exceptionMessageMapping.put(NumberFormatException.class, null);
    configuration.setExceptionToMessage(exceptionMessageMapping);
    ExtDirectResponse resp = runTest(configuration);
    assertThat(resp.getMessage()).isEqualTo("For input string: \"xxx\"");
    assertThat(resp.getWhere()).isNull();
  }
View Full Code Here

  @Test
  public void testDefaultExceptionMessageWithStacktrace() throws Exception {
    Configuration configuration = new Configuration();
    configuration.setSendStacktrace(true);
    configuration.setDefaultExceptionMessage("an error occured");
    ExtDirectResponse resp = runTest(configuration);
    assertThat(resp.getMessage()).isEqualTo("an error occured");
    assertThat(resp.getWhere()).startsWith("java.lang.NumberFormatException");
  }
View Full Code Here

  @Test
  public void testExceptionNameAsMessageWithStacktrace() throws Exception {
    Configuration configuration = new Configuration();
    configuration.setSendStacktrace(true);
    configuration.setSendExceptionMessage(true);
    ExtDirectResponse resp = runTest(configuration);
    assertThat(resp.getMessage()).isEqualTo("For input string: \"xxx\"");
    assertThat(resp.getWhere()).startsWith("java.lang.NumberFormatException");

  }
View Full Code Here

    Configuration configuration = new Configuration();
    configuration.setSendStacktrace(true);
    Map<Class<?>, String> exceptionMessageMapping = new HashMap<Class<?>, String>();
    exceptionMessageMapping.put(NullPointerException.class, "null pointer");
    configuration.setExceptionToMessage(exceptionMessageMapping);
    ExtDirectResponse resp = runTest11(configuration);
    assertThat(resp.getMessage()).isEqualTo("null pointer");
    assertThat(resp.getWhere()).startsWith("java.lang.NullPointerException");
  }
View Full Code Here

TOP

Related Classes of ch.ralscha.extdirectspring.bean.ExtDirectResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.