test_class.file: server/src/test/java/io/spine/server/tenant/TenantAwareOperationTest.java
test_class.identifier: TenantAwareOperationTest
test_case.body: @Test
      @DisplayName("create instance for non-command execution context")
      void createForNonCommand() {
          TenantId tenant = generate();
          CurrentTenant.set(tenant);
  
          TenantAwareOperation op = createOperation();
  
          assertEquals(tenant, op.tenantId());
  
          op.execute();
  
          assertEquals(tenant, getTenantFromRun(op));
      }
test_case.class_method_signature: TenantAwareOperationTest.createForNonCommand()
test_case.full_signature: @Test @DisplayName("create instance for non-command execution context") void createForNonCommand()
test_case.identifier: createForNonCommand
test_case.invocations: generate set createOperation assertEquals tenantId execute assertEquals getTenantFromRun
test_case.modifiers: @Test @DisplayName("create instance for non-command execution context")
test_case.parameters: ()
test_case.return: void
test_case.signature: void createForNonCommand()
focal_class.file: server/src/main/java/io/spine/server/tenant/TenantAwareOperation.java
focal_class.identifier: TenantAwareOperation
focal_class.interfaces: implements Runnable
focal_class.class_method_signature: TenantAwareOperation.TenantAwareOperation()
focal_class.full_signature: protected  TenantAwareOperation()
focal_class.identifier: TenantAwareOperation
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  TenantAwareOperation()
focal_class.class_method_signature: TenantAwareOperation.TenantAwareOperation(TenantId tenantId)
focal_class.full_signature: protected  TenantAwareOperation(TenantId tenantId)
focal_class.identifier: TenantAwareOperation
focal_class.modifiers: protected
focal_class.parameters: (TenantId tenantId)
focal_class.signature:  TenantAwareOperation(TenantId tenantId)
focal_class.class_method_signature: TenantAwareOperation.execute()
focal_class.full_signature: public void execute()
focal_class.identifier: execute
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.superclass: extends TenantAware
focal_method.body: public void execute() {
          Optional<TenantId> remembered = CurrentTenant.get();
          try {
              CurrentTenant.set(tenantId());
              run();
          } finally {
              if (remembered.isPresent()) {
                  CurrentTenant.set(remembered.get());
              } else {
                  CurrentTenant.clear();
              }
          }
      }
focal_method.class_method_signature: TenantAwareOperation.execute()
focal_method.full_signature: public void execute()
focal_method.identifier: execute
focal_method.invocations: get set tenantId run isPresent set get clear
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()