Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-72611] Do not update credentials ID in BaseTest #65

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

public class BaseTest {

private static final String UPDATED_CRED_ID = "Custom-ID-Updated";
private static final String CRED_ID = "Custom-ID";

@Rule
Expand All @@ -50,7 +49,7 @@ public void setup(){
@Test
public void secretTextBaseTest() throws IOException {
StringCredentialsImpl credential = new StringCredentialsImpl(CredentialsScope.GLOBAL, CRED_ID, "Test Secret Text", Secret.fromString("password"));
StringCredentialsImpl updatedCredential = new StringCredentialsImpl(credential.getScope(), UPDATED_CRED_ID, credential.getDescription(), credential.getSecret());
StringCredentialsImpl updatedCredential = new StringCredentialsImpl(credential.getScope(), CRED_ID, credential.getDescription(), credential.getSecret());
testCreateUpdateDelete(credential, updatedCredential);
}

Expand All @@ -75,7 +74,7 @@ private void secretFileTest(boolean useDeprecatedConstructor) throws IOException
credential = new FileCredentialsImpl(CredentialsScope.GLOBAL, CRED_ID, "Test Secret file", fileItem, "keys.txt", SecretBytes.fromBytes(fileItem.get()));
}

FileCredentialsImpl updatedCredential = new FileCredentialsImpl(credential.getScope(), UPDATED_CRED_ID, credential.getDescription(), fileItem, credential.getFileName(), credential.getSecretBytes());
FileCredentialsImpl updatedCredential = new FileCredentialsImpl(credential.getScope(), CRED_ID, credential.getDescription(), fileItem, credential.getFileName(), credential.getSecretBytes());
testCreateUpdateDelete(credential, updatedCredential);
}

Expand Down Expand Up @@ -108,7 +107,7 @@ private <T extends BaseStandardCredentials> void testCreateUpdateDelete(T creden
assertThat(credentials.size(), is(1));
cred = credentials.get(0);
assertThat(cred, instanceOf(credential.getClass()));
assertThat(cred.getId(), is(UPDATED_CRED_ID));
assertThat(cred.getId(), is(CRED_ID));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comment at the top of this block :)


// Delete credential
store.removeCredentials(Domain.global(), cred);
Expand Down