some cleanup

This commit is contained in:
Andreas Penski 2020-05-03 16:52:55 +02:00
parent 1a001a1af4
commit 7dc62012a6
22 changed files with 144 additions and 50 deletions

View file

@ -38,8 +38,6 @@ public class CreateReportActionTest {
private ContentRepository repository;
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Before
public void setup() {
@ -72,15 +70,15 @@ public class CreateReportActionTest {
@Test
public void testExecutionException() throws SaxonApiException {
this.expectedException.expect(IllegalStateException.class);
this.expectedException.expectMessage(Matchers.containsString("Can not create final report"));
final Processor p = mock(Processor.class);
final DocumentBuilder documentBuilder = mock(DocumentBuilder.class);
this.action = new CreateReportAction(p, new ConversionService(), null);
when(p.newDocumentBuilder()).thenReturn(documentBuilder);
when(documentBuilder.build(any(Source.class))).thenThrow(new SaxonApiException("mocked"));
this.action.check(TestBagBuilder.createBag(InputFactory.read(Simple.SIMPLE_VALID), true));
final Bag bag = TestBagBuilder.createBag(InputFactory.read(Simple.SIMPLE_VALID), true);
this.action.check(bag);
assertThat(bag.isStopped()).isTrue();
}
}