Skip to content

Commit ccb805d

Browse files
Gregory PettGregory Pett
authored andcommitted
spotless
1 parent d39b694 commit ccb805d

File tree

2 files changed

+156
-156
lines changed

2 files changed

+156
-156
lines changed
Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
//package org.kohsuke.github;
1+
// package org.kohsuke.github;
22
//
3-
//import org.junit.Assume;
4-
//import org.junit.Before;
5-
//import org.junit.Test;
3+
// import org.junit.Assume;
4+
// import org.junit.Before;
5+
// import org.junit.Test;
66
//
7-
//import java.io.IOException;
8-
//import java.util.List;
7+
// import java.io.IOException;
8+
// import java.util.List;
99
//
10-
//import static org.hamcrest.Matchers.greaterThanOrEqualTo;
11-
//import static org.hamcrest.Matchers.not;
10+
// import static org.hamcrest.Matchers.greaterThanOrEqualTo;
11+
// import static org.hamcrest.Matchers.not;
1212
//
13-
///**
13+
/// **
1414
// * <p>
1515
// * Note : As the code scanning alerts cannot be tailored as part of test setup, lot of the test cases are dependent on
1616
// * manual setup of the mock repo. Assertions and verifications will often simply check that the values are non-null
1717
// * rather than depending on hard-coded values, to prevent making the tests flimsy
1818
// * </p>
1919
// */
20-
//public class GHCodeScanningAlertInstanceTest extends AbstractGitHubWireMockTest {
21-
// private static final String REPO_NAME = "Pixi";
22-
// private GHCodeScanningAlert alert;
20+
// public class GHCodeScanningAlertInstanceTest extends AbstractGitHubWireMockTest {
21+
// private static final String REPO_NAME = "Pixi";
22+
// private GHCodeScanningAlert alert;
2323
//
24-
// /**
25-
// * Gets the first dismissed alert from the mock repo
26-
// *
27-
// * @throws Exception
28-
// * the exception
29-
// */
30-
// @Before
31-
// public void setUp() throws Exception {
32-
// GHRepository repo = gitHub.getRepository(GITHUB_API_TEST_ORG + "/" + REPO_NAME);
33-
// alert = getAlertFromRepo(repo);
34-
// }
24+
// /**
25+
// * Gets the first dismissed alert from the mock repo
26+
// *
27+
// * @throws Exception
28+
// * the exception
29+
// */
30+
// @Before
31+
// public void setUp() throws Exception {
32+
// GHRepository repo = gitHub.getRepository(GITHUB_API_TEST_ORG + "/" + REPO_NAME);
33+
// alert = getAlertFromRepo(repo);
34+
// }
3535
//
36-
// private GHCodeScanningAlert getAlertFromRepo(GHRepository repo) {
37-
// List<GHCodeScanningAlert> dismissedAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.DISMISSED)
38-
// ._iterator(1)
39-
// .nextPage();
40-
// Assume.assumeThat(dismissedAlerts.size(), greaterThanOrEqualTo(1));
41-
// return dismissedAlerts.get(0);
42-
// }
36+
// private GHCodeScanningAlert getAlertFromRepo(GHRepository repo) {
37+
// List<GHCodeScanningAlert> dismissedAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.DISMISSED)
38+
// ._iterator(1)
39+
// .nextPage();
40+
// Assume.assumeThat(dismissedAlerts.size(), greaterThanOrEqualTo(1));
41+
// return dismissedAlerts.get(0);
42+
// }
4343
//
44-
// /**
45-
// * Test list alert instances payload
46-
// *
47-
// * @throws IOException
48-
// * Signals that an I/O exception has occurred.
49-
// */
50-
// @Test
51-
// public void testListAlertInstances() throws IOException {
52-
// // Arrange
44+
// /**
45+
// * Test list alert instances payload
46+
// *
47+
// * @throws IOException
48+
// * Signals that an I/O exception has occurred.
49+
// */
50+
// @Test
51+
// public void testListAlertInstances() throws IOException {
52+
// // Arrange
5353
//
54-
// // Act
55-
// List<GHCodeScanningAlertInstance> results = alert.listAlertInstances().toList();
54+
// // Act
55+
// List<GHCodeScanningAlertInstance> results = alert.listAlertInstances().toList();
5656
//
57-
// // Assert
58-
// assertThat(results.size(), greaterThanOrEqualTo(1));
59-
// GHCodeScanningAlertInstance instance = results.get(0);
60-
// // Can't assert on exact values with having to hardcode values from
61-
// // json file, hence making the assertions generics
62-
// assertThat(instance.getRef(), not((Object) null));
63-
// assertThat(instance.getCommitSha(), not((Object) null));
64-
// assertThat(instance.getState(), not((Object) null));
65-
// assertThat(instance.getMessage(), not((Object) null));
66-
// assertThat(instance.getLocation(), not((Object) null));
57+
// // Assert
58+
// assertThat(results.size(), greaterThanOrEqualTo(1));
59+
// GHCodeScanningAlertInstance instance = results.get(0);
60+
// // Can't assert on exact values with having to hardcode values from
61+
// // json file, hence making the assertions generics
62+
// assertThat(instance.getRef(), not((Object) null));
63+
// assertThat(instance.getCommitSha(), not((Object) null));
64+
// assertThat(instance.getState(), not((Object) null));
65+
// assertThat(instance.getMessage(), not((Object) null));
66+
// assertThat(instance.getLocation(), not((Object) null));
6767
//
68-
// GHCodeScanningAlertInstance.Location location = instance.getLocation();
69-
// // Can't assert on exact values with having to hardcode values from
70-
// // json file, hence making the assertions generics
71-
// assertThat(location.getPath(), not((Object) null));
72-
// assertThat(location.getStartLine(), greaterThanOrEqualTo(0L));
73-
// assertThat(location.getEndLine(), greaterThanOrEqualTo(0L));
74-
// assertThat(location.getStartColumn(), greaterThanOrEqualTo(0L));
75-
// assertThat(location.getStartColumn(), greaterThanOrEqualTo(0L));
76-
// }
77-
//}
68+
// GHCodeScanningAlertInstance.Location location = instance.getLocation();
69+
// // Can't assert on exact values with having to hardcode values from
70+
// // json file, hence making the assertions generics
71+
// assertThat(location.getPath(), not((Object) null));
72+
// assertThat(location.getStartLine(), greaterThanOrEqualTo(0L));
73+
// assertThat(location.getEndLine(), greaterThanOrEqualTo(0L));
74+
// assertThat(location.getStartColumn(), greaterThanOrEqualTo(0L));
75+
// assertThat(location.getStartColumn(), greaterThanOrEqualTo(0L));
76+
// }
77+
// }
Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
1-
//package org.kohsuke.github;
1+
// package org.kohsuke.github;
22
//
3-
//import org.junit.Assume;
4-
//import org.junit.Before;
5-
//import org.junit.Test;
3+
// import org.junit.Assume;
4+
// import org.junit.Before;
5+
// import org.junit.Test;
66
//
7-
//import java.io.IOException;
8-
//import java.util.List;
7+
// import java.io.IOException;
8+
// import java.util.List;
99
//
10-
//import static org.hamcrest.Matchers.equalTo;
11-
//import static org.hamcrest.Matchers.greaterThanOrEqualTo;
12-
//import static org.hamcrest.Matchers.is;
13-
//import static org.hamcrest.Matchers.not;
10+
// import static org.hamcrest.Matchers.equalTo;
11+
// import static org.hamcrest.Matchers.greaterThanOrEqualTo;
12+
// import static org.hamcrest.Matchers.is;
13+
// import static org.hamcrest.Matchers.not;
1414
//
15-
///**
15+
/// **
1616
// * <p>
1717
// * Note : As the code scanning alerts cannot be tailored as part of test setup, lot of the test cases are dependent on
1818
// * manual setup of the mock repo. Assertions and verifications will often simply check that the values are non-null
1919
// * rather than depending on hard-coded values, to prevent making the tests flimsy
2020
// * </p>
2121
// */
22-
//public class GHCodeScanningAlertTest extends AbstractGitHubWireMockTest {
23-
// private static final String REPO_NAME = "Pixi";
24-
// private GHRepository repo;
25-
//
26-
// /**
27-
// * Gets the mock repo
28-
// *
29-
// * @throws Exception
30-
// * the exception
31-
// */
32-
// @Before
33-
// public void setUp() throws Exception {
34-
// repo = gitHub.getRepository(GITHUB_API_TEST_ORG + "/" + REPO_NAME);
35-
// }
36-
//
37-
// /**
38-
// * Test list code scanning alert payload
39-
// */
40-
// @Test
41-
// public void testListCodeScanningAlerts() {
42-
// // Arrange
43-
//
44-
// // Act - Search by filtering on code scanning tool
45-
// List<GHCodeScanningAlert> codeQlAlerts = repo.listCodeScanningAlerts("CodeQL")._iterator(2).nextPage();
46-
//
47-
// // Assert
48-
// assertThat(codeQlAlerts.size(), equalTo(2)); // This assertion is based on manual setup done on repo to
49-
// // guarantee there are atleast 2 issues
50-
//
51-
// GHCodeScanningAlert alert = codeQlAlerts.get(0);
52-
//
53-
// // Verify the code scanning tool details
54-
// assertThat(alert.getTool(), not((Object) null));
55-
// GHCodeScanningAlert.Tool tool = alert.getTool();
56-
// assertThat(tool.getName(), is("CodeQL"));
57-
// assertThat(tool.getVersion(), not((Object) null));
58-
//
59-
// // Verify that fields of the code scanning rule are non-null
60-
// assertThat(alert.getRule(), not((Object) null));
61-
// GHCodeScanningAlert.Rule rule = alert.getRule();
62-
// assertThat(rule.getId(), not((Object) null));
63-
// assertThat(rule.getName(), not((Object) null));
64-
// assertThat(rule.getSeverity(), not((Object) null));
65-
//
66-
// // Act - Search by filtering on alert status
67-
// List<GHCodeScanningAlert> openAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.OPEN)
68-
// ._iterator(2)
69-
// .nextPage(); // This assertion is based on manual setup done on repo to
70-
// // guarantee there are atleast 2 issues
71-
//
72-
// // Assert
73-
// assertThat(openAlerts.size(), equalTo(2));
74-
// GHCodeScanningAlert openAlert = openAlerts.get(0);
75-
// assertThat(openAlert.getState(), is(GHCodeScanningAlertState.OPEN));
76-
// }
77-
//
78-
// /**
79-
// * Test get code scanning alert payload
80-
// *
81-
// * @throws IOException
82-
// * Signals that an I/O exception has occurred.
83-
// */
84-
// @Test
85-
// public void testGetCodeScanningAlert() throws IOException {
86-
// // Arrange
87-
// List<GHCodeScanningAlert> dismissedAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.DISMISSED)
88-
// ._iterator(1)
89-
// .nextPage();
90-
// Assume.assumeThat(dismissedAlerts.size(), greaterThanOrEqualTo(1));
91-
// GHCodeScanningAlert dismissedAlert = dismissedAlerts.get(0);
92-
// long idOfDismissed = dismissedAlert.getId();
93-
//
94-
// // Act
95-
// GHCodeScanningAlert result = repo.getCodeScanningAlert(idOfDismissed);
96-
//
97-
// // Assert
98-
// assertThat(result, not((Object) null));
99-
// assertThat(result.getId(), equalTo(idOfDismissed));
100-
// assertThat(result.getDismissedReason(), equalTo(dismissedAlert.getDismissedReason()));
101-
// assertThat(result.getDismissedAt(), equalTo(dismissedAlert.getDismissedAt()));
102-
// assertThat(result.getDismissedBy().login, equalTo(dismissedAlert.getDismissedBy().login));
103-
// }
104-
//
105-
//}
22+
// public class GHCodeScanningAlertTest extends AbstractGitHubWireMockTest {
23+
// private static final String REPO_NAME = "Pixi";
24+
// private GHRepository repo;
25+
//
26+
// /**
27+
// * Gets the mock repo
28+
// *
29+
// * @throws Exception
30+
// * the exception
31+
// */
32+
// @Before
33+
// public void setUp() throws Exception {
34+
// repo = gitHub.getRepository(GITHUB_API_TEST_ORG + "/" + REPO_NAME);
35+
// }
36+
//
37+
// /**
38+
// * Test list code scanning alert payload
39+
// */
40+
// @Test
41+
// public void testListCodeScanningAlerts() {
42+
// // Arrange
43+
//
44+
// // Act - Search by filtering on code scanning tool
45+
// List<GHCodeScanningAlert> codeQlAlerts = repo.listCodeScanningAlerts("CodeQL")._iterator(2).nextPage();
46+
//
47+
// // Assert
48+
// assertThat(codeQlAlerts.size(), equalTo(2)); // This assertion is based on manual setup done on repo to
49+
// // guarantee there are atleast 2 issues
50+
//
51+
// GHCodeScanningAlert alert = codeQlAlerts.get(0);
52+
//
53+
// // Verify the code scanning tool details
54+
// assertThat(alert.getTool(), not((Object) null));
55+
// GHCodeScanningAlert.Tool tool = alert.getTool();
56+
// assertThat(tool.getName(), is("CodeQL"));
57+
// assertThat(tool.getVersion(), not((Object) null));
58+
//
59+
// // Verify that fields of the code scanning rule are non-null
60+
// assertThat(alert.getRule(), not((Object) null));
61+
// GHCodeScanningAlert.Rule rule = alert.getRule();
62+
// assertThat(rule.getId(), not((Object) null));
63+
// assertThat(rule.getName(), not((Object) null));
64+
// assertThat(rule.getSeverity(), not((Object) null));
65+
//
66+
// // Act - Search by filtering on alert status
67+
// List<GHCodeScanningAlert> openAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.OPEN)
68+
// ._iterator(2)
69+
// .nextPage(); // This assertion is based on manual setup done on repo to
70+
// // guarantee there are atleast 2 issues
71+
//
72+
// // Assert
73+
// assertThat(openAlerts.size(), equalTo(2));
74+
// GHCodeScanningAlert openAlert = openAlerts.get(0);
75+
// assertThat(openAlert.getState(), is(GHCodeScanningAlertState.OPEN));
76+
// }
77+
//
78+
// /**
79+
// * Test get code scanning alert payload
80+
// *
81+
// * @throws IOException
82+
// * Signals that an I/O exception has occurred.
83+
// */
84+
// @Test
85+
// public void testGetCodeScanningAlert() throws IOException {
86+
// // Arrange
87+
// List<GHCodeScanningAlert> dismissedAlerts = repo.listCodeScanningAlerts(GHCodeScanningAlertState.DISMISSED)
88+
// ._iterator(1)
89+
// .nextPage();
90+
// Assume.assumeThat(dismissedAlerts.size(), greaterThanOrEqualTo(1));
91+
// GHCodeScanningAlert dismissedAlert = dismissedAlerts.get(0);
92+
// long idOfDismissed = dismissedAlert.getId();
93+
//
94+
// // Act
95+
// GHCodeScanningAlert result = repo.getCodeScanningAlert(idOfDismissed);
96+
//
97+
// // Assert
98+
// assertThat(result, not((Object) null));
99+
// assertThat(result.getId(), equalTo(idOfDismissed));
100+
// assertThat(result.getDismissedReason(), equalTo(dismissedAlert.getDismissedReason()));
101+
// assertThat(result.getDismissedAt(), equalTo(dismissedAlert.getDismissedAt()));
102+
// assertThat(result.getDismissedBy().login, equalTo(dismissedAlert.getDismissedBy().login));
103+
// }
104+
//
105+
// }

0 commit comments

Comments
 (0)