-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from Sybit-Education/develop
Feature enhancements: offset loading, destroy
- Loading branch information
Showing
171 changed files
with
1,967 additions
and
4,621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,58 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
* The MIT License (MIT) | ||
* Copyright (c) 2017 Sybit GmbH | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
*/ | ||
package com.sybit.airtable; | ||
|
||
import com.sybit.airtable.Base; | ||
import com.sybit.airtable.Table; | ||
import com.sybit.airtable.exception.AirtableException; | ||
import com.sybit.airtable.movies.Actor; | ||
import com.sybit.airtable.mock.WireMockBaseTest; | ||
import java.util.List; | ||
import org.apache.http.client.HttpResponseException; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
/** | ||
* | ||
* @author fzr | ||
*/ | ||
public class TableDestroyTest extends WireMockBaseTest { | ||
|
||
|
||
|
||
|
||
@Test | ||
public void testDestroyMovie() throws AirtableException, HttpResponseException{ | ||
|
||
Base base = airtable.base("appe9941ff07fffcc"); | ||
public void testDestroyMovie() throws AirtableException, HttpResponseException { | ||
|
||
Table<Actor> actorTable = base.table("Actors", Actor.class); | ||
|
||
actorTable.destroy("recapJ3Js8AEwt0Bf"); | ||
|
||
|
||
boolean destroyed = actorTable.destroy("recAt6z10EYD6NtEH"); | ||
assertTrue(destroyed); | ||
|
||
} | ||
|
||
/** | ||
* No Condition found under which Airtable returns false for deleting an Object. Either it doesent find it, which results in a 404 HTTP Exception | ||
* Or something else is wrong with the Syntax, which results in another Exception. | ||
* Therefore this test is Ignored as long as we dont have an Example of a failed delete from Airtable. | ||
* @throws AirtableException | ||
*/ | ||
|
||
@Test (expected = AirtableException.class) | ||
public void testDestroyMovieException() throws AirtableException{ | ||
Base base = airtable.base("appe9941ff07fffcc"); | ||
@Ignore | ||
@Test | ||
public void testDestroyMovieFailure() throws AirtableException { | ||
|
||
Table<Actor> actorTable = base.table("Actors", Actor.class); | ||
|
||
actorTable.destroy("not succesfull"); | ||
|
||
boolean destroyed = actorTable.destroy("failed"); | ||
assertFalse(destroyed); | ||
} | ||
|
||
|
||
@Test(expected = AirtableException.class) | ||
public void testDestroyMovieException() throws AirtableException { | ||
|
||
Table<Actor> actorTable = base.table("Actors", Actor.class); | ||
boolean destroyed = actorTable.destroy("not succesfull"); | ||
} | ||
|
||
} |
Oops, something went wrong.