Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
453 changes: 239 additions & 214 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.contentful.java</groupId>
<artifactId>java-sdk</artifactId>
<version>10.6.0</version>
<version>10.6.1</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void manuallyFetchedContentTypeIsCached() {

CDAContentType fake = client.fetch(CDAContentType.class).one("fake");
assertThat(client.cache.types()).hasSize(6);
assertThat(client.cache.types().get(fake.id())).isSameAs(fake);
assertThat(client.cache.types().get(fake.id())).isSameInstanceAs(fake);
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/contentful/java/cda/EntryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void assertNyanCat(CDAEntry entry) {

Object bestFriend = entry.getField("bestFriend");
assertThat(bestFriend).isInstanceOf(CDAEntry.class);
assertThat(entry).isSameAs(((CDAEntry) bestFriend).getField("bestFriend"));
assertThat(entry).isSameInstanceAs(((CDAEntry) bestFriend).getField("bestFriend"));

// Localization
assertThat(entry.defaultLocale).isEqualTo("en-US");
Expand All @@ -246,7 +246,7 @@ public void arrayItemsContainOnlyTopLevelEntries() {

assertThat(array.items()).hasSize(1);
assertThat(array.entries()).hasSize(2);
assertThat(array.entries().values()).containsAllIn(array.items());
assertThat(array.entries().values()).containsAtLeastElementsIn(array.items());

CDAEntry parent = array.entries().get("7Avw18DWveMI60a0WWwyCi");
assertThat(parent).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testPreserveOrderOfElements() {
final Response<CDAArray> inputArrayResponse = Response.success(inputArray);
final CDAArray outputArray = ResourceFactory.array(inputArrayResponse, client);

assertThat(outputArray.entries().values()).containsAllIn(inputArray.items);
assertThat(outputArray.entries().values()).containsAtLeastElementsIn(inputArray.items);
}

private CDAEntry createCdaEntry(String id) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/contentful/java/cda/SyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void assertUpdate(SynchronizedSpace space) {
assertThat(nyanCat.<String>getField("color")).isEqualTo("red");
likes = nyanCat.getField("likes");
assertThat(likes).containsExactly("a", "b", "c");
assertThat(nyanCat.<CDAEntry>getField("bestFriend")).isSameAs(superCat);
assertThat(nyanCat.<CDAEntry>getField("bestFriend")).isSameInstanceAs(superCat);
}

private void assertInitial(SynchronizedSpace space) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void onSuccess(Collection<Cat> result) {

assertThat(catsCaught.size()).isEqualTo(3);
assertThat(catsCaught.stream().map(it -> it.name).toArray())
.asList().containsAllOf("Happy Cat", "Garfield", "Nyan Cat");
.asList().containsAtLeast("Happy Cat", "Garfield", "Nyan Cat");
}

@ContentfulEntryModel("post")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ void assertNyanCat(CDAEntry entry) {

Object bestFriend = entry.getField("bestFriend");
assertThat(bestFriend).isInstanceOf(CDAEntry.class);
assertThat(entry).isSameAs(((CDAEntry) bestFriend).getField("bestFriend"));
assertThat(entry).isSameInstanceAs(((CDAEntry) bestFriend).getField("bestFriend"));

// Localization
final LocalizedResource.Localizer localizedCat = entry.localize("tlh");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class IntegrationWithMasterEnvironment extends Integration {

Object bestFriend = entry.getField("bestFriend");
assertThat(bestFriend).isInstanceOf(CDAEntry.class);
assertThat(entry).isSameAs(((CDAEntry) bestFriend).getField("bestFriend"));
assertThat(entry).isSameInstanceAs(((CDAEntry) bestFriend).getField("bestFriend"));

// Localization
final LocalizedResource.Localizer localized = entry.localize("tlh");
Expand Down