test_class.declarator: ORG_CREATION_TIME = Instant.ofEpochSecond(6800L)
test_class.modifier: private static final
test_class.original_string: private static final Instant ORG_CREATION_TIME = Instant.ofEpochSecond(6800L);
test_class.type: Instant
test_class.var_name: ORG_CREATION_TIME
test_class.declarator: ORGANIZATION_ID = randomUUID()
test_class.modifier: private static final
test_class.original_string: private static final UUID ORGANIZATION_ID = randomUUID();
test_class.type: UUID
test_class.var_name: ORGANIZATION_ID
test_class.declarator: ORGANIZATION_NAME = "organization name"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_NAME = "organization name";
test_class.type: String
test_class.var_name: ORGANIZATION_NAME
test_class.declarator: ORGANIZATION_STREET = "street"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_STREET = "street";
test_class.type: String
test_class.var_name: ORGANIZATION_STREET
test_class.declarator: ORGANIZATION_CITY = "city"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_CITY = "city";
test_class.type: String
test_class.var_name: ORGANIZATION_CITY
test_class.declarator: ORGANIZATION_STATE = "state"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_STATE = "state";
test_class.type: String
test_class.var_name: ORGANIZATION_STATE
test_class.declarator: ORGANIZATION_COUNTRY = "country"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_COUNTRY = "country";
test_class.type: String
test_class.var_name: ORGANIZATION_COUNTRY
test_class.declarator: ORGANIZATION_POSTAL_CODE = "postal"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_POSTAL_CODE = "postal";
test_class.type: String
test_class.var_name: ORGANIZATION_POSTAL_CODE
test_class.declarator: ORGANIZATION_WEBSITE_URL = "website-url"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_WEBSITE_URL = "website-url";
test_class.type: String
test_class.var_name: ORGANIZATION_WEBSITE_URL
test_class.declarator: ORGANIZATION_CONTACT_NAME = "contact-name"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_CONTACT_NAME = "contact-name";
test_class.type: String
test_class.var_name: ORGANIZATION_CONTACT_NAME
test_class.declarator: ORGANIZATION_PHONE_NUMBER = "phone-number"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_PHONE_NUMBER = "phone-number";
test_class.type: String
test_class.var_name: ORGANIZATION_PHONE_NUMBER
test_class.declarator: ORGANIZATION_EMAIL_ADDRESS = "email@domain.com"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_EMAIL_ADDRESS = "email@domain.com";
test_class.type: String
test_class.var_name: ORGANIZATION_EMAIL_ADDRESS
test_class.declarator: ORGANIZATION_ADDRESS = new OrganizationAddress(ORGANIZATION_STREET,
              ORGANIZATION_CITY, ORGANIZATION_STATE, ORGANIZATION_COUNTRY, ORGANIZATION_POSTAL_CODE)
test_class.modifier: private static final
test_class.original_string: private static final OrganizationAddress ORGANIZATION_ADDRESS = new OrganizationAddress(ORGANIZATION_STREET,
              ORGANIZATION_CITY, ORGANIZATION_STATE, ORGANIZATION_COUNTRY, ORGANIZATION_POSTAL_CODE);
test_class.type: OrganizationAddress
test_class.var_name: ORGANIZATION_ADDRESS
test_class.declarator: ADDRESS = new Address(ORGANIZATION_STREET, ORGANIZATION_CITY,
              ORGANIZATION_STATE, ORGANIZATION_COUNTRY, ORGANIZATION_POSTAL_CODE)
test_class.modifier: private static final
test_class.original_string: private static final Address ADDRESS = new Address(ORGANIZATION_STREET, ORGANIZATION_CITY,
              ORGANIZATION_STATE, ORGANIZATION_COUNTRY, ORGANIZATION_POSTAL_CODE);
test_class.type: Address
test_class.var_name: ADDRESS
test_class.declarator: ORGANIZATION_NAME_UPDATE = "organization-name-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_NAME_UPDATE = "organization-name-update";
test_class.type: String
test_class.var_name: ORGANIZATION_NAME_UPDATE
test_class.declarator: ORGANIZATION_CONTACT_NAME_UPDATE = "contact-name-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_CONTACT_NAME_UPDATE = "contact-name-update";
test_class.type: String
test_class.var_name: ORGANIZATION_CONTACT_NAME_UPDATE
test_class.declarator: ORGANIZATION_PHONE_NUMBER_UPDATE = "phone-number-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_PHONE_NUMBER_UPDATE = "phone-number-update";
test_class.type: String
test_class.var_name: ORGANIZATION_PHONE_NUMBER_UPDATE
test_class.declarator: ORGANIZATION_EMAIL_UPDATE = "emailUpdate@domain.com"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_EMAIL_UPDATE = "emailUpdate@domain.com";
test_class.type: String
test_class.var_name: ORGANIZATION_EMAIL_UPDATE
test_class.declarator: ORGANIZATION_STREET_UPDATE = "street-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_STREET_UPDATE = "street-update";
test_class.type: String
test_class.var_name: ORGANIZATION_STREET_UPDATE
test_class.declarator: ORGANIZATION_CITY_UPDATE = "city-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_CITY_UPDATE = "city-update";
test_class.type: String
test_class.var_name: ORGANIZATION_CITY_UPDATE
test_class.declarator: ORGANIZATION_STATE_UPDATE = "state-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_STATE_UPDATE = "state-update";
test_class.type: String
test_class.var_name: ORGANIZATION_STATE_UPDATE
test_class.declarator: ORGANIZATION_COUNTRY_UPDATE = "country-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_COUNTRY_UPDATE = "country-update";
test_class.type: String
test_class.var_name: ORGANIZATION_COUNTRY_UPDATE
test_class.declarator: ORGANIZATION_POSTAL_CODE_UPDATE = "postal-code-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_POSTAL_CODE_UPDATE = "postal-code-update";
test_class.type: String
test_class.var_name: ORGANIZATION_POSTAL_CODE_UPDATE
test_class.declarator: ORGANIZATION_WEBSITE_UPDATE = "organization-website-update"
test_class.modifier: private static final
test_class.original_string: private static final String ORGANIZATION_WEBSITE_UPDATE = "organization-website-update";
test_class.type: String
test_class.var_name: ORGANIZATION_WEBSITE_UPDATE
test_class.declarator: organizationsEventHandler
test_class.modifier: private
test_class.original_string: private OrganizationsEventHandler organizationsEventHandler;
test_class.type: OrganizationsEventHandler
test_class.var_name: organizationsEventHandler
test_class.declarator: organizationsRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private OrganizationsRepository organizationsRepository;
test_class.type: OrganizationsRepository
test_class.var_name: organizationsRepository
test_class.file: organizations/src/test/java/engineering/everest/lhotse/organizations/eventhandlers/OrganizationsEventHandlerTest.java
test_class.identifier: OrganizationsEventHandlerTest
test_case.body: @Test
      void onOrganizationContactDetailsUpdatedByAdminEvent_WillPersistChanges_WhenFieldsHaveChanged() {
          var persistableOrganization = createPersistableOrganization();
  
          when(organizationsRepository.findById(ORGANIZATION_ID)).thenReturn(Optional.of(persistableOrganization));
  
          organizationsEventHandler.on(new OrganizationContactDetailsUpdatedEvent(ORGANIZATION_ID,
                  ORGANIZATION_CONTACT_NAME_UPDATE, ORGANIZATION_PHONE_NUMBER_UPDATE, ORGANIZATION_EMAIL_UPDATE, ORGANIZATION_WEBSITE_UPDATE, ADMIN_ID));
  
          assertEquals(ORGANIZATION_CONTACT_NAME_UPDATE, persistableOrganization.getContactName());
          assertEquals(ORGANIZATION_PHONE_NUMBER_UPDATE, persistableOrganization.getPhoneNumber());
          assertEquals(ORGANIZATION_EMAIL_UPDATE, persistableOrganization.getEmailAddress());
          assertEquals(ORGANIZATION_WEBSITE_UPDATE, persistableOrganization.getWebsiteUrl());
          verify(organizationsRepository).save(persistableOrganization);
      }
test_case.class_method_signature: OrganizationsEventHandlerTest.onOrganizationContactDetailsUpdatedByAdminEvent_WillPersistChanges_WhenFieldsHaveChanged()
test_case.full_signature: @Test void onOrganizationContactDetailsUpdatedByAdminEvent_WillPersistChanges_WhenFieldsHaveChanged()
test_case.identifier: onOrganizationContactDetailsUpdatedByAdminEvent_WillPersistChanges_WhenFieldsHaveChanged
test_case.invocations: createPersistableOrganization thenReturn when findById of on assertEquals getContactName assertEquals getPhoneNumber assertEquals getEmailAddress assertEquals getWebsiteUrl save verify
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void onOrganizationContactDetailsUpdatedByAdminEvent_WillPersistChanges_WhenFieldsHaveChanged()
focal_class.declarator: organizationsRepository
focal_class.modifier: private final
focal_class.original_string: private final OrganizationsRepository organizationsRepository;
focal_class.type: OrganizationsRepository
focal_class.var_name: organizationsRepository
focal_class.file: organizations/src/main/java/engineering/everest/lhotse/organizations/eventhandlers/OrganizationsEventHandler.java
focal_class.identifier: OrganizationsEventHandler
focal_class.interfaces: implements ReplayCompletionAware
focal_class.class_method_signature: OrganizationsEventHandler.OrganizationsEventHandler(OrganizationsRepository organizationsRepository)
focal_class.full_signature: @Autowired public  OrganizationsEventHandler(OrganizationsRepository organizationsRepository)
focal_class.identifier: OrganizationsEventHandler
focal_class.modifiers: @Autowired public
focal_class.parameters: (OrganizationsRepository organizationsRepository)
focal_class.signature:  OrganizationsEventHandler(OrganizationsRepository organizationsRepository)
focal_class.class_method_signature: OrganizationsEventHandler.prepareForReplay()
focal_class.full_signature: @ResetHandler public void prepareForReplay()
focal_class.identifier: prepareForReplay
focal_class.modifiers: @ResetHandler public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void prepareForReplay()
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_class.full_signature: @EventHandler void on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_class.return: void
focal_class.signature: void on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationDisabledByAdminEvent event)
focal_class.full_signature: @EventHandler void on(OrganizationDisabledByAdminEvent event)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationDisabledByAdminEvent event)
focal_class.return: void
focal_class.signature: void on(OrganizationDisabledByAdminEvent event)
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationEnabledByAdminEvent event)
focal_class.full_signature: @EventHandler void on(OrganizationEnabledByAdminEvent event)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationEnabledByAdminEvent event)
focal_class.return: void
focal_class.signature: void on(OrganizationEnabledByAdminEvent event)
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationNameChangedEvent event)
focal_class.full_signature: @EventHandler void on(OrganizationNameChangedEvent event)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationNameChangedEvent event)
focal_class.return: void
focal_class.signature: void on(OrganizationNameChangedEvent event)
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationContactDetailsUpdatedEvent event)
focal_class.full_signature: @EventHandler void on(OrganizationContactDetailsUpdatedEvent event)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationContactDetailsUpdatedEvent event)
focal_class.return: void
focal_class.signature: void on(OrganizationContactDetailsUpdatedEvent event)
focal_class.class_method_signature: OrganizationsEventHandler.on(OrganizationAddressUpdatedEvent event)
focal_class.full_signature: @EventHandler void on(OrganizationAddressUpdatedEvent event)
focal_class.identifier: on
focal_class.modifiers: @EventHandler
focal_class.parameters: (OrganizationAddressUpdatedEvent event)
focal_class.return: void
focal_class.signature: void on(OrganizationAddressUpdatedEvent event)
focal_class.class_method_signature: OrganizationsEventHandler.selectDesiredState(String desiredState, String currentState)
focal_class.full_signature: private String selectDesiredState(String desiredState, String currentState)
focal_class.identifier: selectDesiredState
focal_class.modifiers: private
focal_class.parameters: (String desiredState, String currentState)
focal_class.return: String
focal_class.signature: String selectDesiredState(String desiredState, String currentState)
focal_method.body: @EventHandler
      void on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime) {
          LOGGER.info("Creating new registered organization {}", event.getOrganizationId());
          var organizationAddress = new OrganizationAddress(event.getStreet(), event.getCity(), event.getState(),
                  event.getCountry(), event.getPostalCode());
          organizationsRepository.createOrganization(event.getOrganizationId(), event.getOrganizationName(),
                  organizationAddress, event.getWebsiteUrl(), event.getContactName(), event.getContactPhoneNumber(),
                  event.getContactEmail(), false, creationTime);
      }
focal_method.class_method_signature: OrganizationsEventHandler.on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_method.full_signature: @EventHandler void on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_method.identifier: on
focal_method.invocations: info getOrganizationId getStreet getCity getState getCountry getPostalCode createOrganization getOrganizationId getOrganizationName getWebsiteUrl getContactName getContactPhoneNumber getContactEmail
focal_method.modifiers: @EventHandler
focal_method.parameters: (OrganizationRegisteredEvent event, @Timestamp Instant creationTime)
focal_method.return: void
focal_method.signature: void on(OrganizationRegisteredEvent event, @Timestamp Instant creationTime)