package tv.pluto;

import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import tv.pluto.core.BaseTest;
import tv.pluto.grpc.channels.ChannelsClient;
import tv.pluto.grpc.config.ConfigClient;
import tv.pluto.grpc.samsung_channel_properties.SamsungChannelPropertiesClient;

public class ProductionTestSuite extends BaseTest {
  private ChannelsClient channelsClient;
  private ConfigClient configClient;
  private SamsungChannelPropertiesClient samsungChannelPropertiesClient;

  @BeforeClass(alwaysRun = true)
  private void setUp() {
    channelsClient = new ChannelsClient(grpcChannelManager.getChannel(), false);
    configClient = new ConfigClient(grpcChannelManager.getChannel());
    samsungChannelPropertiesClient =
        new SamsungChannelPropertiesClient(grpcChannelManager.getChannel());
  }

  @Test(groups = {"production"})
  public void getStitchedActiveChannelIds() {
    Assert.assertFalse(channelsClient.getStitchedActiveChannelIds("us").getIdsList().isEmpty());
  }

  @Test(groups = {"production"})
  public void getNonStitchedChannelsWithMultipleScheduledClipsParams() {
    Assert.assertFalse(
        channelsClient
            .getNonStitchedChannelsWithMultipleScheduledClips()
            .getChannelsList()
            .isEmpty());
  }

  @Test(groups = {"production"})
  public void getSamsungChannelProperties() {
    Assert.assertTrue(samsungChannelPropertiesClient.getDocuments().hasNext());
  }

  @Test(groups = {"production"})
  public void getConfigInfo() {
    Assert.assertTrue(configClient.getConfigInfo().hasRepositories());
  }
}
