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

Avoid using token in testcase #704

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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 @@ -331,7 +331,7 @@ public void shouldBeAbleToGetExistedPAT()
BitbucketPersonalAccessToken result = bitbucketServer.getPersonalAccessToken("5", "token");
// then
assertNotNull(result);
assertEquals(result.getToken(), "MTU4OTEwNTMyOTA5Ohc88HcY8k7gWOzl2mP5TtdtY5Qs");
Copy link
Member

Choose a reason for hiding this comment

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

cc: @artaleks9 isn't it a dummy token?

Copy link
Contributor

@artaleks9 artaleks9 Jul 22, 2024

Choose a reason for hiding this comment

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

I guess yes..It looks like a dummy token.
Actually it's an unit test/tests, probably @vinokurig can say more.
Anyway the tests of 'git-zero' flow on ci-openshift, where are used actual PATs are hide at all and not visible.

Copy link
Author

@netomi netomi Jul 23, 2024

Choose a reason for hiding this comment

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

fyi: I created that PR due to a secret scanning alert. If the token is a dummy one, this is not necessary, though I suggest to use dummy tokens that are clearly identifiable as such to avoid false alarms, e.g. adding dummy_ as prefix.

assertEquals(result.getToken(), "xxxx");
}

@Test(expectedExceptions = ScmItemNotFoundException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
]
}
},
"token": "MTU4OTEwNTMyOTA5Ohc88HcY8k7gWOzl2mP5TtdtY5Qs"
}
"token": "xxxx"
}
Loading