Search in sources :

Example 1 with SeatCategory

use of jodd.json.model.cat.SeatCategory in project jodd by oblac.

the class CatalogTest method assertCatalog.

private void assertCatalog(Catalog catalog) {
    assertNotNull(catalog);
    Map<Long, String> map;
    // areaNames
    map = catalog.getAreaNames();
    assertNotNull(map);
    assertEquals(17, map.size());
    assertEquals("1er balcon jardin", map.get(Long.valueOf(205706005)));
    // audienceSubCategoryNames
    map = catalog.getAudienceSubCategoryNames();
    assertEquals(1, map.size());
    assertEquals("Abonné", map.get(Long.valueOf(337100890)));
    // events
    Map<Long, Event> events = catalog.getEvents();
    assertNotNull(events);
    assertEquals(184, events.size());
    Event event = events.get(Long.valueOf(138586341));
    assertNotNull(event);
    assertNull(event.getDescription());
    assertEquals(138586341, event.getId().longValue());
    assertNull(event.getLogo());
    assertEquals("30th Anniversary Tour", event.getName());
    Long[] subTopicIds = event.getSubTopicIds();
    assertEquals(2, subTopicIds.length);
    assertEquals(337184269, subTopicIds[0].longValue());
    assertEquals(337184283, subTopicIds[1].longValue());
    assertNull(event.getSubjectCode());
    assertNull(event.getSubtitle());
    Long[] topicIds = event.getTopicIds();
    assertEquals(2, topicIds.length);
    assertEquals(324846099, topicIds[0].longValue());
    assertEquals(107888604, topicIds[1].longValue());
    // performances
    List<Performance> performances = catalog.getPerformances();
    assertNotNull(performances);
    assertEquals(243, performances.size());
    Performance performance = performances.get(0);
    assertEquals(138586341, performance.getEventId().longValue());
    assertEquals(339887544, performance.getId().longValue());
    assertNull(performance.getLogo());
    assertNull(performance.getName());
    List<Price> prices = performance.getPrices();
    assertEquals(2, prices.size());
    Price price = prices.get(0);
    assertEquals(90250, price.getAmount());
    assertEquals(337100890, price.getAudienceSubCategoryId().longValue());
    assertEquals(338937295, price.getSeatCategoryId().longValue());
    List<SeatCategory> seatCategories = performance.getSeatCategories();
    assertEquals(2, seatCategories.size());
    SeatCategory seatCategory = seatCategories.get(0);
    assertEquals(338937295, seatCategory.getSeatCategoryId().longValue());
    List<Area> areas = seatCategory.getAreas();
    assertEquals(11, areas.size());
    Area area = areas.get(0);
    assertEquals(205705999, area.getAreaId().longValue());
    assertEquals(0, area.getBlockIds().length);
    JDateTime start = performance.getStart();
    assertEquals(1372701600000L, start.getTimeInMillis());
    assertEquals("PLEYEL_PLEYEL", performance.getVenueCode());
    // seatCategoryNames
    map = catalog.getSeatCategoryNames();
    assertEquals(64, map.size());
    assertEquals("catétgorie unique", map.get(Long.valueOf(342752792)));
    // subTopicNames
    map = catalog.getSubTopicNames();
    assertEquals(19, map.size());
    assertEquals("Jazz", map.get(Long.valueOf(337184269)));
    // topicNames
    map = catalog.getTopicNames();
    assertEquals(4, map.size());
    assertEquals("Genre", map.get(Long.valueOf(324846099)));
    // topicSubTopics
    Map<Long, Long[]> map2 = catalog.getTopicSubTopics();
    assertEquals(4, map2.size());
    Long[] longs = map2.get(Long.valueOf(107888604));
    assertEquals(2, longs.length);
    assertEquals(337184283L, longs[0].longValue());
    // venueNames
    Map<String, String> map3 = catalog.getVenueNames();
    assertEquals(1, map3.size());
    assertEquals("Salle Pleyel", map3.get("PLEYEL_PLEYEL"));
}
Also used : SeatCategory(jodd.json.model.cat.SeatCategory) Area(jodd.json.model.cat.Area) Price(jodd.json.model.cat.Price) JDateTime(jodd.datetime.JDateTime) Event(jodd.json.model.cat.Event) Performance(jodd.json.model.cat.Performance)

Aggregations

JDateTime (jodd.datetime.JDateTime)1 Area (jodd.json.model.cat.Area)1 Event (jodd.json.model.cat.Event)1 Performance (jodd.json.model.cat.Performance)1 Price (jodd.json.model.cat.Price)1 SeatCategory (jodd.json.model.cat.SeatCategory)1