@Test
  public void shouldReturnUnparsableClassIfErrorOccursWhileParsing() {
    ClassParser parser = mock(ClassParser.class);
    when(parser.getClass("MyClassName")).thenThrow(new RuntimeException(new NotFoundException("")));

    builder = new JavaClassBuilder(parser);

    Assert.assertThat(builder.createClass("MyClassName"), instanceOf(UnparsableClass.class));
  }
Exemplo n.º 2
0
 private void assertInvariant() {
   Assert.ensure(
       mSpeechRecognitionConfiguration != null || mDtmfRecognitionConfiguration != null,
       "Must provide a non-null configuration for speech or DTMF");
 }