Search in sources :

Example 1 with ExistsResponse

use of dk.dbc.search.solrdocstore.response.ExistsResponse in project solr-document-store by DBCDK.

the class ExistenceBeanIT method testBibliographicExisting.

@Test(timeout = 2_000L)
public void testBibliographicExisting() throws Exception {
    System.out.println("testBibliographicExisting");
    ExistsResponse existence = jpa(em -> {
        em.merge(new BibliographicEntity(870970, "clazzifier", "12345678", "repo", "work:1", "unit:1", false, null, "track:1"));
        return bean.bibliographicExists(870970, "clazzifier", "12345678");
    });
    assertThat(existence.exists, is(true));
}
Also used : BibliographicEntity(dk.dbc.search.solrdocstore.jpa.BibliographicEntity) ExistsResponse(dk.dbc.search.solrdocstore.response.ExistsResponse) Test(org.junit.Test)

Example 2 with ExistsResponse

use of dk.dbc.search.solrdocstore.response.ExistsResponse in project solr-document-store by DBCDK.

the class ExistenceBeanIT method testBibliographicDeleted.

@Test(timeout = 2_000L)
public void testBibliographicDeleted() throws Exception {
    System.out.println("testBibliographicDeleted");
    ExistsResponse existence = jpa(em -> {
        em.merge(new BibliographicEntity(870970, "clazzifier", "12345678", "repo", null, null, true, null, "track:1"));
        return bean.bibliographicExists(870970, "clazzifier", "12345678");
    });
    assertThat(existence.exists, is(false));
}
Also used : BibliographicEntity(dk.dbc.search.solrdocstore.jpa.BibliographicEntity) ExistsResponse(dk.dbc.search.solrdocstore.response.ExistsResponse) Test(org.junit.Test)

Example 3 with ExistsResponse

use of dk.dbc.search.solrdocstore.response.ExistsResponse in project solr-document-store by DBCDK.

the class ExistenceBeanIT method testHoldingsNonExisting.

@Test(timeout = 2_000L)
public void testHoldingsNonExisting() throws Exception {
    System.out.println("testHoldingsNonExisting");
    ExistsResponse existence = jpa(em -> {
        return bean.holdingExists(777777, "12345678");
    });
    assertThat(existence.exists, is(false));
}
Also used : ExistsResponse(dk.dbc.search.solrdocstore.response.ExistsResponse) Test(org.junit.Test)

Example 4 with ExistsResponse

use of dk.dbc.search.solrdocstore.response.ExistsResponse in project solr-document-store by DBCDK.

the class ExistenceBeanIT method testHoldingsExisting.

@Test(timeout = 2_000L)
public void testHoldingsExisting() throws Exception {
    System.out.println("testHoldingsExisting");
    ExistsResponse existence = jpa(em -> {
        em.merge(new HoldingsItemEntity(777777, "12345678", SolrIndexKeys.ON_SHELF, "track:1"));
        return bean.holdingExists(777777, "12345678");
    });
    assertThat(existence.exists, is(true));
}
Also used : HoldingsItemEntity(dk.dbc.search.solrdocstore.jpa.HoldingsItemEntity) ExistsResponse(dk.dbc.search.solrdocstore.response.ExistsResponse) Test(org.junit.Test)

Example 5 with ExistsResponse

use of dk.dbc.search.solrdocstore.response.ExistsResponse in project solr-document-store by DBCDK.

the class ExistenceBeanIT method testBibliographicNonExisting.

@Test(timeout = 2_000L)
public void testBibliographicNonExisting() throws Exception {
    System.out.println("testBibliographicNonExisting");
    ExistsResponse existence = jpa(em -> {
        return bean.bibliographicExists(870970, "clazzifier", "12345678");
    });
    assertThat(existence.exists, is(false));
}
Also used : ExistsResponse(dk.dbc.search.solrdocstore.response.ExistsResponse) Test(org.junit.Test)

Aggregations

ExistsResponse (dk.dbc.search.solrdocstore.response.ExistsResponse)7 Test (org.junit.Test)5 BibliographicEntity (dk.dbc.search.solrdocstore.jpa.BibliographicEntity)3 HoldingsItemEntity (dk.dbc.search.solrdocstore.jpa.HoldingsItemEntity)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 Timed (org.eclipse.microprofile.metrics.annotation.Timed)2 Operation (org.eclipse.microprofile.openapi.annotations.Operation)2 Parameters (org.eclipse.microprofile.openapi.annotations.parameters.Parameters)2 APIResponses (org.eclipse.microprofile.openapi.annotations.responses.APIResponses)2 AgencyClassifierItemKey (dk.dbc.search.solrdocstore.jpa.AgencyClassifierItemKey)1 AgencyItemKey (dk.dbc.search.solrdocstore.jpa.AgencyItemKey)1