use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.
the class PermissionsEndpointTest method beforeEach.
@Before
public void beforeEach() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
RequestHelper.setPassword(mockMvc, credentialName, "testpassword", CredentialWriteMode.NO_OVERWRITE.mode);
auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.
the class RegenerationEndpointTest method beforeEach.
@Before
public void beforeEach() throws Exception {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
MockHttpServletRequestBuilder generatePasswordRequest = post(API_V1_DATA_ENDPOINT).header("Authorization", "Bearer " + AuthConstants.UAA_OAUTH2_PASSWORD_GRANT_TOKEN).accept(APPLICATION_JSON).contentType(APPLICATION_JSON).content("{\n" + " \"name\" : \"picard\",\n" + " \"type\" : \"password\",\n" + " \"additional_permissions\":\n" + " [\n" + " {\n" + " \"actor\": \" " + AuthConstants.UAA_OAUTH2_CLIENT_CREDENTIALS_ACTOR_ID + "\",\n" + " \"operations\": [\"write\", \"read\"]\n" + " }\n" + " ]\n" + "}");
String generatePasswordResult = this.mockMvc.perform(generatePasswordRequest).andDo(print()).andExpect(status().isOk()).andReturn().getResponse().getContentAsString();
originalPassword = (new JSONObject(generatePasswordResult)).getString("value");
assertThat(originalPassword, notNullValue());
}
use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.
the class CredentialsControllerTypeSpecificSetTest method setUp.
@Before
public void setUp() throws Exception {
Consumer<Long> fakeTimeSetter = mockOutCurrentTimeProvider(mockCurrentTimeProvider);
fakeTimeSetter.accept(FROZEN_TIME.toEpochMilli());
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.
the class CredentialDeleteTest method beforeEach.
@Before
public void beforeEach() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
use of org.cloudfoundry.credhub.helper.AuditingHelper in project credhub by cloudfoundry-incubator.
the class CredentialFindTest method beforeEach.
@Before
public void beforeEach() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
auditingHelper = new AuditingHelper(requestAuditRecordRepository, eventAuditRecordRepository);
}
Aggregations