@Override
  public ProtobufSystemInfo.Section toProtobuf() {
    ProtobufSystemInfo.Section.Builder protobuf = ProtobufSystemInfo.Section.newBuilder();
    protobuf.setName("System");

    setAttribute(protobuf, "Server ID", server.getId());
    setAttribute(protobuf, "Version", getVersion());
    setAttribute(protobuf, "Edition", sonarRuntime.getEdition().getLabel());
    setAttribute(protobuf, NCLOC.getName(), statisticsSupport.getLinesOfCode());
    setAttribute(protobuf, "Container", containerSupport.isRunningInContainer());
    setAttribute(protobuf, "External Users and Groups Provisioning", commonSystemInformation.getManagedInstanceProviderName());
    setAttribute(protobuf, "External User Authentication", commonSystemInformation.getExternalUserAuthentication());
    addIfNotEmpty(protobuf, "Accepted external identity providers",
      commonSystemInformation.getEnabledIdentityProviders());
    addIfNotEmpty(protobuf, "External identity providers whose users are allowed to sign themselves up",
      commonSystemInformation.getAllowsToSignUpEnabledIdentityProviders());
    setAttribute(protobuf, "High Availability", false);
    setAttribute(protobuf, "Official Distribution", officialDistribution.check());
    setAttribute(protobuf, "Force authentication", commonSystemInformation.getForceAuthentication());
    setAttribute(protobuf, "Home Dir", config.get(PATH_HOME.getKey()).orElse(null));
    setAttribute(protobuf, "Data Dir", config.get(PATH_DATA.getKey()).orElse(null));
    setAttribute(protobuf, "Temp Dir", config.get(PATH_TEMP.getKey()).orElse(null));
    setAttribute(protobuf, "Processors", Runtime.getRuntime().availableProcessors());
    return protobuf.build();
  }
@Test
  public void toProtobuf_whenInstanceIsManaged_shouldWriteItsProviderName() {
    when(commonSystemInformation.getManagedInstanceProviderName()).thenReturn("Okta");

    ProtobufSystemInfo.Section protobuf = underTest.toProtobuf();
    assertThatAttributeIs(protobuf, "External Users and Groups Provisioning", "Okta");
  }