Search in sources :

Example 16 with AuditingHelper

use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.

the class CredentialRegenerateTest method beforeEach.

@Before
public void beforeEach() {
    fakeTimeSetter = mockOutCurrentTimeProvider(mockCurrentTimeProvider);
    fakeTimeSetter.accept(FROZEN_TIME.toEpochMilli());
    mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
    auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
Also used : AuditingHelper(org.cloudfoundry.credhub.helper.AuditingHelper) Before(org.junit.Before)

Example 17 with AuditingHelper

use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.

the class BulkRegenerateTest method beforeEach.

@Before
public void beforeEach() throws Exception {
    canaries = encryptionKeyCanaryRepository.findAll();
    mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
    auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
    generateRootCA("/ca-to-rotate", "original ca");
    generateRootCA("/other-ca", "other ca");
    generateSignedCertificate("/cert-to-regenerate", "cert to regenerate", "/ca-to-rotate");
    generateSignedCertificate("/cert-to-regenerate", "cert to regenerate", "/ca-to-rotate");
    generateSignedCertificate("/cert-to-regenerate-as-well", "cert to regenerate as well", "/ca-to-rotate");
    generateSignedCertificate("/cert-not-to-regenerate", "cert not to regenerate", "/other-ca");
}
Also used : AuditingHelper(org.cloudfoundry.credhub.helper.AuditingHelper) Before(org.junit.Before)

Example 18 with AuditingHelper

use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.

the class CertificateUpdateTransitionalVersionTest method beforeEach.

@Before
public void beforeEach() throws Exception {
    mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
    final String generateCaResponse = generateCa(mockMvc, caName, UAA_OAUTH2_PASSWORD_GRANT_TOKEN);
    caCertificate = JsonPath.parse(generateCaResponse).read("$.value.certificate");
    String response = getCertificateCredentialsByName(mockMvc, UAA_OAUTH2_PASSWORD_GRANT_TOKEN, caName);
    caCredentialUuid = JsonPath.parse(response).read("$.certificates[0].id");
    assertNotNull(caCertificate);
    auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
Also used : AuditingHelper(org.cloudfoundry.credhub.helper.AuditingHelper) Before(org.junit.Before)

Example 19 with AuditingHelper

use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.

the class PermissionsControllerTest method beforeEach.

@Before
public void beforeEach() {
    auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
    mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
}
Also used : AuditingHelper(org.cloudfoundry.credhub.helper.AuditingHelper) Before(org.junit.Before)

Aggregations

AuditingHelper (org.cloudfoundry.credhub.helper.AuditingHelper)19 Before (org.junit.Before)19 MockHttpServletRequestBuilder (org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder)2 CertificateCredentialValue (org.cloudfoundry.credhub.credential.CertificateCredentialValue)1 RsaCredentialValue (org.cloudfoundry.credhub.credential.RsaCredentialValue)1 SshCredentialValue (org.cloudfoundry.credhub.credential.SshCredentialValue)1 StringCredentialValue (org.cloudfoundry.credhub.credential.StringCredentialValue)1 UserCredentialValue (org.cloudfoundry.credhub.credential.UserCredentialValue)1 GenerationParameters (org.cloudfoundry.credhub.request.GenerationParameters)1 StringGenerationParameters (org.cloudfoundry.credhub.request.StringGenerationParameters)1 JSONObject (org.json.JSONObject)1 Matchers.anyString (org.mockito.Matchers.anyString)1