@@ -152,7 +152,6 @@ public void testCRUDContent() throws Exception {
152152 * @throws Exception
153153 * the exception
154154 */
155- @ SuppressWarnings ("deprecation" )
156155 @ Test
157156 public void testCreateWithAuthorCommitter () throws Exception {
158157 GHRepository ghRepository = getTempRepository ();
@@ -161,8 +160,32 @@ public void testCreateWithAuthorCommitter() throws Exception {
161160 .path ("author-committer-test.md" )
162161 .content ("test content\n " )
163162 .author ("John Doe" , "john@example.com" )
164- .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
165163 .committer ("Service Account" , "service@example.com" )
164+ .commit ();
165+
166+ assertThat (response .getContent (), notNullValue ());
167+ assertThat (response .getCommit (), notNullValue ());
168+ assertThat (response .getCommit ().getAuthor ().getName (), equalTo ("John Doe" ));
169+ assertThat (response .getCommit ().getAuthor ().getEmail (), equalTo ("john@example.com" ));
170+ assertThat (response .getCommit ().getCommitter ().getName (), equalTo ("Service Account" ));
171+ assertThat (response .getCommit ().getCommitter ().getEmail (), equalTo ("service@example.com" ));
172+ }
173+
174+ /**
175+ * Test creating content with custom author and committer with date via GHContentBuilder.
176+ *
177+ * @throws Exception
178+ * the exception
179+ */
180+ @ SuppressWarnings ("deprecation" )
181+ @ Test
182+ public void testCreateWithAuthorCommitterAndDate () throws Exception {
183+ GHRepository ghRepository = getTempRepository ();
184+ GHContentUpdateResponse response = ghRepository .createContent ()
185+ .message ("Creating with custom author and committer" )
186+ .path ("author-committer-test.md" )
187+ .content ("test content\n " )
188+ .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
166189 .committer ("Service Account" , "service@example.com" , new Date (1234567890000L ))
167190 .commit ();
168191
@@ -180,16 +203,37 @@ public void testCreateWithAuthorCommitter() throws Exception {
180203 * @throws Exception
181204 * the exception
182205 */
183- @ SuppressWarnings ("deprecation" )
184206 @ Test
185207 public void testDeleteWithAuthorCommitter () throws Exception {
186208 GHContent content = repo .getFileContent ("ghcontent-ro/a-file-with-content" );
187209 GHContentUpdateResponse response = content .createDelete ()
188210 .message ("Deleting with custom author and committer" )
189211 .branch ("main" )
190212 .author ("John Doe" , "john@example.com" )
191- .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
192213 .committer ("Service Account" , "service@example.com" )
214+ .commit ();
215+
216+ assertThat (response .getCommit (), notNullValue ());
217+ assertThat (response .getCommit ().getAuthor ().getName (), equalTo ("John Doe" ));
218+ assertThat (response .getCommit ().getAuthor ().getEmail (), equalTo ("john@example.com" ));
219+ assertThat (response .getCommit ().getCommitter ().getName (), equalTo ("Service Account" ));
220+ assertThat (response .getCommit ().getCommitter ().getEmail (), equalTo ("service@example.com" ));
221+ }
222+
223+ /**
224+ * Test deleting content with custom author and committer with date via GHContentDeleter.
225+ *
226+ * @throws Exception
227+ * the exception
228+ */
229+ @ SuppressWarnings ("deprecation" )
230+ @ Test
231+ public void testDeleteWithAuthorCommitterAndDate () throws Exception {
232+ GHContent content = repo .getFileContent ("ghcontent-ro/a-file-with-content" );
233+ GHContentUpdateResponse response = content .createDelete ()
234+ .message ("Deleting with custom author and committer" )
235+ .branch ("main" )
236+ .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
193237 .committer ("Service Account" , "service@example.com" , new Date (1234567890000L ))
194238 .commit ();
195239
@@ -381,7 +425,6 @@ public void testMIMESmall() throws IOException {
381425 * @throws Exception
382426 * the exception
383427 */
384- @ SuppressWarnings ("deprecation" )
385428 @ Test
386429 public void testUpdateWithAuthorCommitter () throws Exception {
387430 GHContent content = repo .getFileContent ("ghcontent-ro/a-file-with-content" );
@@ -390,8 +433,32 @@ public void testUpdateWithAuthorCommitter() throws Exception {
390433 .message ("Updating with custom author and committer" )
391434 .branch ("main" )
392435 .author ("John Doe" , "john@example.com" )
393- .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
394436 .committer ("Service Account" , "service@example.com" )
437+ .commit ();
438+
439+ assertThat (response .getContent (), notNullValue ());
440+ assertThat (response .getCommit (), notNullValue ());
441+ assertThat (response .getCommit ().getAuthor ().getName (), equalTo ("John Doe" ));
442+ assertThat (response .getCommit ().getAuthor ().getEmail (), equalTo ("john@example.com" ));
443+ assertThat (response .getCommit ().getCommitter ().getName (), equalTo ("Service Account" ));
444+ assertThat (response .getCommit ().getCommitter ().getEmail (), equalTo ("service@example.com" ));
445+ }
446+
447+ /**
448+ * Test updating content with custom author and committer with date via GHContentUpdater.
449+ *
450+ * @throws Exception
451+ * the exception
452+ */
453+ @ SuppressWarnings ("deprecation" )
454+ @ Test
455+ public void testUpdateWithAuthorCommitterAndDate () throws Exception {
456+ GHContent content = repo .getFileContent ("ghcontent-ro/a-file-with-content" );
457+ GHContentUpdateResponse response = content .createUpdate ()
458+ .content ("updated content\n " )
459+ .message ("Updating with custom author and committer" )
460+ .branch ("main" )
461+ .author ("John Doe" , "john@example.com" , new Date (1234567890000L ))
395462 .committer ("Service Account" , "service@example.com" , new Date (1234567890000L ))
396463 .commit ();
397464
0 commit comments