@Test
public void testOnCompanyCreatedEventACompanyViewIsSaved() {

    CompanyId expectedCompanyId = new CompanyId();
    String expectedCompanyName = "companyName";
    int expectedCompanyValue = 1000;
    int expectedAmountOfShares = 500;
    CompanyCreatedEvent testEvent = new CompanyCreatedEvent(
            expectedCompanyId, expectedCompanyName, expectedCompanyValue, expectedAmountOfShares
    );
    testSubject.on(testEvent);
    ArgumentCaptor<CompanyView> companyViewCaptor = ArgumentCaptor.forClass(CompanyView.class);
    verify(companyViewRepository).save(companyViewCaptor.capture());
    CompanyView result = companyViewCaptor.getValue();
    assertNotNull(result);
    assertEquals(expectedCompanyId.getIdentifier(), result.getIdentifier());
    assertEquals(expectedCompanyName, result.getName());
    assertEquals(expectedCompanyValue, result.getValue());
    assertEquals(expectedAmountOfShares, result.getAmountOfShares());
}