@@ -0,0 +1,3362 @@
+package org.jfrog.artifactory.client.model.impl;%0A%0A%0Aimport org.testng.annotations.AfterClass;%0Aimport org.testng.annotations.AfterMethod;%0Aimport org.testng.annotations.BeforeClass;%0Aimport org.testng.annotations.BeforeMethod;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.Properties;%0Aimport java.util.Random;%0A%0Aimport org.jfrog.artifactory.client.Artifactory;%0Aimport org.jfrog.artifactory.client.ArtifactoryClientBuilder;%0Aimport org.jfrog.artifactory.client.ArtifactoryTestsBase;%0Aimport org.jfrog.artifactory.client.model.RemoteRepository;%0Aimport org.jfrog.artifactory.client.model.repository.settings.impl.GenericRepositorySettingsImpl;%0A%0Aimport static org.apache.commons.lang.StringUtils.isEmpty;%0Aimport static org.testng.Assert.assertEquals;%0Aimport static org.testng.Assert.assertNotNull;%0A%0Apublic class RemoteRepositoryImplTest %7B%0A  private static final Random rnd = new Random();%0A%0A  private Artifactory artifactory;%0A  private String localRepositoryKey;%0A%0A  @BeforeClass%0A  public void initClass() throws IOException %7B%0A    Properties props = new Properties();%0A    // This file is not in GitHub. Create your own in src/test/resources.%0A    InputStream inputStream = this.getClass().getResourceAsStream(%22/artifactory-client.properties%22);%0A    if (inputStream != null) %7B%0A      props.load(inputStream);%0A    %7D%0A%0A    String url = ArtifactoryTestsBase.readParam(props, %22url%22);%0A    if (!url.endsWith(%22/%22)) %7B%0A      url += %22/%22;%0A    %7D%0A    String username = ArtifactoryTestsBase.readParam(props, %22username%22);%0A    String password = ArtifactoryTestsBase.readParam(props, %22password%22);%0A    artifactory = ArtifactoryClientBuilder.create()%0A        .setUrl(url)%0A        .setUsername(username)%0A        .setPassword(password)%0A        .build();%0A  %7D%0A%0A  @BeforeMethod%0A  public void initTest() throws IOException %7B%0A    localRepositoryKey = %22remote-%22 + getClass().getSimpleName() + %22-%22 + rnd.nextInt();%0A  %7D%0A%0A  @AfterMethod%0A  public void cleanTest() throws IOException %7B%0A    deleteRepoIfExists(localRepositoryKey);%0A  %7D%0A%0A  protected void deleteRepoIfExists(String repoName) throws IOException %7B%0A    if (isEmpty(repoName)) %7B%0A      return;%0A    %7D%0A    try %7B%0A      artifactory.repository(repoName).delete();%0A    %7D catch (Exception ignored) %7B%0A      int i =0;%0A    %7D%0A  %7D%0A%0A  @AfterClass%0A  public void cleanClass() throws IOException %7B%0A    artifactory.close();%0A  %7D%0A%0A  /**%0A   * We have not ability to create certificate through java client.%0A   * @TODOs Remove %60(enabled = false)%60. Create certificate with name %22clientTlsCertificate%22.%0A   */%0A  @Test(enabled = false)%0A  public void testClientTlsCertificate() throws Exception %7B%0A    String clientTlsCertificate = %22clientTlsCertificate%22;%0A%0A    RemoteRepository remoteRepository = artifactory.repositories().builders().remoteRepositoryBuilder()%0A        .key(localRepositoryKey)%0A        .url(%22http://test.com/%22)%0A        .description(%22create remote repo with clientTlsCertificate%22)%0A        .clientTlsCertificate(clientTlsCertificate)%0A        .repositorySettings(new GenericRepositorySettingsImpl())%0A        .build();%0A%0A    artifactory.repositories().create(1, remoteRepository);%0A    RemoteRepository repository = (RemoteRepository) artifactory.repository(remoteRepository.getKey()).get();%0A%0A    assertNotNull(repository);%0A    assertEquals(repository.getClientTlsCertificate(), clientTlsCertificate);%0A  %7D%0A%7D%0A

test adding clientTlsCertificate to RemoteRepository