mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 15:50:52 +00:00
Enable automatic code formatter with CI validation
This may be controversial but it we're doing it. Having code formatting needs to be consistent and a non-issue during code review. I'm willing modify the configuration if people see a strong need, but formatting needs to be present and enforced.
This commit is contained in:
@@ -5,10 +5,11 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Kevin Harrington mad.hephaestus@gmail.com
|
||||
*/
|
||||
public class Github2faTest extends AbstractGitHubWireMockTest {
|
||||
public class Github2faTest extends AbstractGitHubWireMockTest {
|
||||
|
||||
@Test
|
||||
public void test2faToken() throws IOException {
|
||||
@@ -16,23 +17,23 @@ public class Github2faTest extends AbstractGitHubWireMockTest {
|
||||
|
||||
List<String> asList = Arrays.asList("repo", "gist", "write:packages", "read:packages", "delete:packages",
|
||||
"user", "delete_repo");
|
||||
String nameOfToken = "Test2faTokenCreate";//+timestamp;// use time stamp to ensure the token creations do not collide with older tokens
|
||||
String nameOfToken = "Test2faTokenCreate";// +timestamp;// use time stamp to ensure the token creations do not
|
||||
// collide with older tokens
|
||||
|
||||
GHAuthorization token=gitHub.createToken(
|
||||
asList,
|
||||
nameOfToken,
|
||||
"this is a test token created by a unit test", () -> {
|
||||
GHAuthorization token = gitHub.createToken(asList, nameOfToken, "this is a test token created by a unit test",
|
||||
() -> {
|
||||
String data = "111878";
|
||||
// TO UPDATE run this in debugger mode, put a breakpoint here, and enter the OTP you get into the value of Data
|
||||
// TO UPDATE run this in debugger mode, put a breakpoint here, and enter the OTP you get into the
|
||||
// value of Data
|
||||
return data;
|
||||
});
|
||||
assert token!=null;
|
||||
for(int i=0;i<asList.size();i++) {
|
||||
assert token != null;
|
||||
for (int i = 0; i < asList.size(); i++) {
|
||||
assertTrue(token.getScopes().get(i).contentEquals(asList.get(i)));
|
||||
}
|
||||
|
||||
String p = token.getToken();
|
||||
|
||||
assert p!=null;
|
||||
assert p != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user