Search in sources :

Example 1 with Campus

use of org.baeldung.spring.data.couchbase.model.Campus in project tutorials by eugenp.

the class CampusServiceImplIntegrationTest method whenFindByLocationNearNewYorkCity_thenResultContainsColumbia.

@Test
public final void whenFindByLocationNearNewYorkCity_thenResultContainsColumbia() throws Exception {
    Set<Campus> campuses = campusService.findByLocationNear(NewYorkCity, new Distance(1, Metrics.NEUTRAL));
    assertFalse(campuses.isEmpty());
    assertTrue(campuses.contains(Columbia));
    assertFalse(campuses.contains(Harvard));
}
Also used : Campus(org.baeldung.spring.data.couchbase.model.Campus) Distance(org.springframework.data.geo.Distance) Test(org.junit.Test) MultiBucketIntegationTest(org.baeldung.spring.data.couchbase2b.MultiBucketIntegationTest)

Example 2 with Campus

use of org.baeldung.spring.data.couchbase.model.Campus in project tutorials by eugenp.

the class CampusServiceImplIntegrationTest method whenFindByLocationNearBoston_thenResultContainsHarvard.

@Test
public final void whenFindByLocationNearBoston_thenResultContainsHarvard() throws Exception {
    Set<Campus> campuses = campusService.findByLocationNear(Boston, new Distance(1, Metrics.NEUTRAL));
    assertFalse(campuses.isEmpty());
    assertTrue(campuses.contains(Harvard));
    assertFalse(campuses.contains(Columbia));
}
Also used : Campus(org.baeldung.spring.data.couchbase.model.Campus) Distance(org.springframework.data.geo.Distance) Test(org.junit.Test) MultiBucketIntegationTest(org.baeldung.spring.data.couchbase2b.MultiBucketIntegationTest)

Example 3 with Campus

use of org.baeldung.spring.data.couchbase.model.Campus in project tutorials by eugenp.

the class CampusServiceImplIntegrationTest method givenHarvardId_whenFind_thenReturnsHarvard.

@Test
public final void givenHarvardId_whenFind_thenReturnsHarvard() throws Exception {
    Campus actual = campusService.find(Harvard.getId());
    assertNotNull(actual);
    assertEquals(Harvard, actual);
}
Also used : Campus(org.baeldung.spring.data.couchbase.model.Campus) Test(org.junit.Test) MultiBucketIntegationTest(org.baeldung.spring.data.couchbase2b.MultiBucketIntegationTest)

Aggregations

Campus (org.baeldung.spring.data.couchbase.model.Campus)3 MultiBucketIntegationTest (org.baeldung.spring.data.couchbase2b.MultiBucketIntegationTest)3 Test (org.junit.Test)3 Distance (org.springframework.data.geo.Distance)2