Java Code Examples for org.springframework.credhub.support.CredentialType#PASSWORD

The following examples show how to use org.springframework.credhub.support.CredentialType#PASSWORD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CredHubCredentialsGeneratorTest.java    From spring-cloud-app-broker with Apache License 2.0 6 votes vote down vote up
@Test
void generateUser() {
	given(this.credHubOperations.credentials())
		.willReturn(credHubCredentialOperations);

	CredentialDetails<UserCredential> creds = new CredentialDetails<>("id",
		new SimpleCredentialName("app-service"), CredentialType.PASSWORD,
		new UserCredential("username", "password"));

	given(this.credHubCredentialOperations.generate(any(), eq(UserCredential.class)))
		.willReturn(Mono.just(creds));

	StepVerifier.create(generator.generateUser("foo", "bar", "hello", 12, false, false, false, false))
		.assertNext(tuple2 -> {
			assertThat(tuple2.getT1()).isEqualTo("username");
			assertThat(tuple2.getT2()).isEqualTo("password");
		})
		.verifyComplete();
}
 
Example 2
Source File: CredHubCredentialsGeneratorTest.java    From spring-cloud-app-broker with Apache License 2.0 6 votes vote down vote up
@Test
void generateString() {
	given(this.credHubOperations.credentials())
		.willReturn(credHubCredentialOperations);

	CredentialDetails<PasswordCredential> creds = new CredentialDetails<>("id",
		new SimpleCredentialName("app-service"), CredentialType.PASSWORD,
		new PasswordCredential("password"));

	given(this.credHubCredentialOperations.generate(any(), eq(PasswordCredential.class)))
		.willReturn(Mono.just(creds));

	StepVerifier.create(generator.generateString("foo", "bar", "hello", 12, false, false, false, false))
		.assertNext(password -> assertThat(password).isEqualTo("password"))
		.verifyComplete();
}
 
Example 3
Source File: PasswordCredentialRequest.java    From spring-credhub with Apache License 2.0 4 votes vote down vote up
/**
 * Initialize a {@link CredentialRequest}.
 */
PasswordCredentialRequest() {
	super(CredentialType.PASSWORD);
}
 
Example 4
Source File: PasswordParametersRequest.java    From spring-credhub with Apache License 2.0 4 votes vote down vote up
/**
 * Create a {@link PasswordParametersRequest}.
 */
PasswordParametersRequest() {
	super(CredentialType.PASSWORD);
}