test_class.declarator: ORGANIZATION_ID_1 = UUID.randomUUID()
test_class.modifier: private static final
test_class.original_string: private static final UUID ORGANIZATION_ID_1 = UUID.randomUUID();
test_class.type: UUID
test_class.var_name: ORGANIZATION_ID_1
test_class.declarator: ORGANIZATION_ID_2 = UUID.randomUUID()
test_class.modifier: private static final
test_class.original_string: private static final UUID ORGANIZATION_ID_2 = UUID.randomUUID();
test_class.type: UUID
test_class.var_name: ORGANIZATION_ID_2
test_class.declarator: ORGANIZATION_IN_GOOD_STANDING = new Organization(ORGANIZATION_ID_1, "organization-name", null, null, null, null, null, false)
test_class.modifier: private static final
test_class.original_string: private static final Organization ORGANIZATION_IN_GOOD_STANDING = new Organization(ORGANIZATION_ID_1, "organization-name", null, null, null, null, null, false);
test_class.type: Organization
test_class.var_name: ORGANIZATION_IN_GOOD_STANDING
test_class.declarator: DISABLED_ORGANIZATION = new Organization(ORGANIZATION_ID_2, "organization-name", null, null, null, null, null, true)
test_class.modifier: private static final
test_class.original_string: private static final Organization DISABLED_ORGANIZATION = new Organization(ORGANIZATION_ID_2, "organization-name", null, null, null, null, null, true);
test_class.type: Organization
test_class.var_name: DISABLED_ORGANIZATION
test_class.declarator: organizationStatusValidator
test_class.modifier: private
test_class.original_string: private OrganizationStatusValidator organizationStatusValidator;
test_class.type: OrganizationStatusValidator
test_class.var_name: organizationStatusValidator
test_class.declarator: organizationsReadService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private OrganizationsReadService organizationsReadService;
test_class.type: OrganizationsReadService
test_class.var_name: organizationsReadService
test_class.file: command-validation-support/src/test/java/engineering/everest/lhotse/axon/command/validators/OrganizationStatusValidatorTest.java
test_class.identifier: OrganizationStatusValidatorTest
test_case.body: @Test
      void validate_WillFail_WhenOrganizationIsDisabled() {
          when(organizationsReadService.getById(ORGANIZATION_ID_2)).thenReturn(DISABLED_ORGANIZATION);
  
          assertThrows(IllegalStateException.class, () ->
                  organizationStatusValidator.validate((OrganizationStatusValidatableCommand) () -> ORGANIZATION_ID_2));
      }
test_case.class_method_signature: OrganizationStatusValidatorTest.validate_WillFail_WhenOrganizationIsDisabled()
test_case.full_signature: @Test void validate_WillFail_WhenOrganizationIsDisabled()
test_case.identifier: validate_WillFail_WhenOrganizationIsDisabled
test_case.invocations: thenReturn when getById assertThrows validate
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void validate_WillFail_WhenOrganizationIsDisabled()
focal_class.declarator: organizationsReadService
focal_class.modifier: private final
focal_class.original_string: private final OrganizationsReadService organizationsReadService;
focal_class.type: OrganizationsReadService
focal_class.var_name: organizationsReadService
focal_class.file: command-validation-support/src/main/java/engineering/everest/lhotse/axon/command/validators/OrganizationStatusValidator.java
focal_class.identifier: OrganizationStatusValidator
focal_class.interfaces: implements Validates<OrganizationStatusValidatableCommand>
focal_class.class_method_signature: OrganizationStatusValidator.OrganizationStatusValidator(OrganizationsReadService organizationsReadService)
focal_class.full_signature: public  OrganizationStatusValidator(OrganizationsReadService organizationsReadService)
focal_class.identifier: OrganizationStatusValidator
focal_class.modifiers: public
focal_class.parameters: (OrganizationsReadService organizationsReadService)
focal_class.signature:  OrganizationStatusValidator(OrganizationsReadService organizationsReadService)
focal_class.class_method_signature: OrganizationStatusValidator.validate(OrganizationStatusValidatableCommand command)
focal_class.full_signature: @Override public void validate(OrganizationStatusValidatableCommand command)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (OrganizationStatusValidatableCommand command)
focal_class.return: void
focal_class.signature: void validate(OrganizationStatusValidatableCommand command)
focal_method.body: @Override
      public void validate(OrganizationStatusValidatableCommand command) {
          Organization organization;
          try {
              organization = organizationsReadService.getById(command.getOrganizationId());
          } catch (NoSuchElementException e) {
              throw new IllegalStateException(String.format("Organization %s does not exist", command.getOrganizationId()), e);
          }
          Validate.validState(!organization.isDisabled(), "Organization %s is de-registered", command.getOrganizationId());
      }
focal_method.class_method_signature: OrganizationStatusValidator.validate(OrganizationStatusValidatableCommand command)
focal_method.full_signature: @Override public void validate(OrganizationStatusValidatableCommand command)
focal_method.identifier: validate
focal_method.invocations: getById getOrganizationId format getOrganizationId validState isDisabled getOrganizationId
focal_method.modifiers: @Override public
focal_method.parameters: (OrganizationStatusValidatableCommand command)
focal_method.return: void
focal_method.signature: void validate(OrganizationStatusValidatableCommand command)