use of org.cloudfoundry.credhub.request.CertificateGenerationRequestParameters in project credhub by cloudfoundry-incubator.
the class CertificateGenerationParametersTest method constructor_prependsForwardSlashToCaName.
@Test
public void constructor_prependsForwardSlashToCaName() throws Exception {
final CertificateGenerationRequestParameters requestParameters1 = new CertificateGenerationRequestParameters();
requestParameters1.setCaName("ca-name");
requestParameters1.setCommonName("a-common-name");
final CertificateGenerationRequestParameters requestParameters2 = new CertificateGenerationRequestParameters();
requestParameters2.setCaName("/ca-name");
requestParameters2.setCommonName("a-common-name");
final CertificateGenerationParameters parameters1 = new CertificateGenerationParameters(requestParameters1);
final CertificateGenerationParameters parameters2 = new CertificateGenerationParameters(requestParameters2);
assertThat(parameters1.equals(parameters2), equalTo(true));
}
use of org.cloudfoundry.credhub.request.CertificateGenerationRequestParameters in project credhub by cloudfoundry-incubator.
the class CertificateGenerationParametersTest method equals_returnsFalseWhenKeyUsagesAreDifferent.
@Test
public void equals_returnsFalseWhenKeyUsagesAreDifferent() throws Exception {
final CertificateGenerationRequestParameters requestParameters1 = new CertificateGenerationRequestParameters();
final String[] keyUsages1 = new String[] { "data_encipherment", "digital_signature", "non_repudiation", "key_encipherment" };
final String[] keyUsages2 = new String[] { "data_encipherment", "digital_signature", "non_repudiation" };
requestParameters1.setKeyUsage(keyUsages1);
requestParameters1.setCommonName("a-common-name");
final CertificateGenerationRequestParameters requestParameters2 = new CertificateGenerationRequestParameters();
requestParameters2.setKeyUsage(keyUsages2);
requestParameters2.setCommonName("a-common-name");
final CertificateGenerationParameters parameters1 = new CertificateGenerationParameters(requestParameters1);
final CertificateGenerationParameters parameters2 = new CertificateGenerationParameters(requestParameters2);
assertThat(parameters1.equals(parameters2), equalTo(false));
}
Aggregations