Skip to content

Commit c5ce1f6

Browse files
committed
Move GHRepositoryChanges under Repository class
1 parent 075d627 commit c5ce1f6

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/main/java/org/kohsuke/github/GHEventPayload.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,17 +1445,6 @@ public void setRelease(GHRelease release) {
14451445
* @see <a href="https://docs.github.com/en/rest/reference/repos">Repositories</a>
14461446
*/
14471447
public static class Repository extends GHEventPayload {
1448-
1449-
}
1450-
1451-
/**
1452-
* A repository was renamed or transferred.
1453-
*
1454-
* @see <a href="https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#repository">
1455-
* repository event</a>
1456-
* @see <a href="https://docs.github.com/en/rest/reference/repos">Repositories</a>
1457-
*/
1458-
public static class RepositoryChanges extends GHEventPayload {
14591448
private GHRepositoryChanges changes;
14601449

14611450
/**
@@ -1466,6 +1455,7 @@ public static class RepositoryChanges extends GHEventPayload {
14661455
public GHRepositoryChanges getChanges() {
14671456
return changes;
14681457
}
1458+
14691459
}
14701460

14711461
/**

src/test/java/org/kohsuke/github/GHEventPayloadTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -780,8 +780,8 @@ public void repository() throws Exception {
780780
*/
781781
@Test
782782
public void repository_renamed() throws Exception {
783-
final GHEventPayload.RepositoryChanges event = GitHub.offline()
784-
.parseEventPayload(payload.asReader(), GHEventPayload.RepositoryChanges.class);
783+
final GHEventPayload.Repository event = GitHub.offline()
784+
.parseEventPayload(payload.asReader(), GHEventPayload.Repository.class);
785785
assertThat(event.getAction(), is("renamed"));
786786
assertThat(event.getChanges().getRepository().getName().getFrom(), is("react-workshop"));
787787
assertThat(event.getRepository().getName(), is("react-workshop-renamed"));
@@ -798,8 +798,8 @@ public void repository_renamed() throws Exception {
798798
*/
799799
@Test
800800
public void repository_transferred_to_org() throws Exception {
801-
final GHEventPayload.RepositoryChanges event = GitHub.offline()
802-
.parseEventPayload(payload.asReader(), GHEventPayload.RepositoryChanges.class);
801+
final GHEventPayload.Repository event = GitHub.offline()
802+
.parseEventPayload(payload.asReader(), GHEventPayload.Repository.class);
803803
assertThat(event.getAction(), is("transferred"));
804804
assertThat(event.getChanges().getOwner().getFrom().getUser().getLogin(), is("eleanorgoh"));
805805
assertThat(event.getChanges().getOwner().getFrom().getUser().getId(), is(66235606L));
@@ -814,8 +814,8 @@ public void repository_transferred_to_org() throws Exception {
814814
*/
815815
@Test
816816
public void repository_transferred_to_user() throws Exception {
817-
final GHEventPayload.RepositoryChanges event = GitHub.offline()
818-
.parseEventPayload(payload.asReader(), GHEventPayload.RepositoryChanges.class);
817+
final GHEventPayload.Repository event = GitHub.offline()
818+
.parseEventPayload(payload.asReader(), GHEventPayload.Repository.class);
819819
assertThat(event.getAction(), is("transferred"));
820820
assertThat(event.getChanges().getOwner().getFrom().getOrganization().getLogin(), is("EJG-Organization"));
821821
assertThat(event.getChanges().getOwner().getFrom().getOrganization().getId(), is(168135412L));

0 commit comments

Comments
 (0)