use of com.furyviewer.domain.ChapterSeen in project FuryViewer by TheDoctor-95.
the class ChapterSeenResourceIntTest method equalsVerifier.
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(ChapterSeen.class);
ChapterSeen chapterSeen1 = new ChapterSeen();
chapterSeen1.setId(1L);
ChapterSeen chapterSeen2 = new ChapterSeen();
chapterSeen2.setId(chapterSeen1.getId());
assertThat(chapterSeen1).isEqualTo(chapterSeen2);
chapterSeen2.setId(2L);
assertThat(chapterSeen1).isNotEqualTo(chapterSeen2);
chapterSeen1.setId(null);
assertThat(chapterSeen1).isNotEqualTo(chapterSeen2);
}
use of com.furyviewer.domain.ChapterSeen in project FuryViewer by TheDoctor-95.
the class ChapterSeenResource method getChapterSeen.
/**
* GET /chapter-seens/:id : get the "id" chapterSeen.
*
* @param id the id of the chapterSeen to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the chapterSeen, or with status 404 (Not Found)
*/
@GetMapping("/chapter-seens/{id}")
@Timed
public ResponseEntity<ChapterSeen> getChapterSeen(@PathVariable Long id) {
log.debug("REST request to get ChapterSeen : {}", id);
ChapterSeen chapterSeen = chapterSeenRepository.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(chapterSeen));
}
use of com.furyviewer.domain.ChapterSeen in project FuryViewer by TheDoctor-95.
the class ChapterSeenResourceIntTest method updateChapterSeen.
@Test
@Transactional
public void updateChapterSeen() throws Exception {
// Initialize the database
chapterSeenRepository.saveAndFlush(chapterSeen);
int databaseSizeBeforeUpdate = chapterSeenRepository.findAll().size();
// Update the chapterSeen
ChapterSeen updatedChapterSeen = chapterSeenRepository.findOne(chapterSeen.getId());
updatedChapterSeen.seen(UPDATED_SEEN).date(UPDATED_DATE);
restChapterSeenMockMvc.perform(put("/api/chapter-seens").contentType(TestUtil.APPLICATION_JSON_UTF8).content(TestUtil.convertObjectToJsonBytes(updatedChapterSeen))).andExpect(status().isOk());
// Validate the ChapterSeen in the database
List<ChapterSeen> chapterSeenList = chapterSeenRepository.findAll();
assertThat(chapterSeenList).hasSize(databaseSizeBeforeUpdate);
ChapterSeen testChapterSeen = chapterSeenList.get(chapterSeenList.size() - 1);
assertThat(testChapterSeen.isSeen()).isEqualTo(UPDATED_SEEN);
assertThat(testChapterSeen.getDate()).isEqualTo(UPDATED_DATE);
}
use of com.furyviewer.domain.ChapterSeen in project FuryViewer by TheDoctor-95.
the class ChapterSeenResourceIntTest method createChapterSeen.
@Test
@Transactional
public void createChapterSeen() throws Exception {
int databaseSizeBeforeCreate = chapterSeenRepository.findAll().size();
// Create the ChapterSeen
restChapterSeenMockMvc.perform(post("/api/chapter-seens").contentType(TestUtil.APPLICATION_JSON_UTF8).content(TestUtil.convertObjectToJsonBytes(chapterSeen))).andExpect(status().isCreated());
// Validate the ChapterSeen in the database
List<ChapterSeen> chapterSeenList = chapterSeenRepository.findAll();
assertThat(chapterSeenList).hasSize(databaseSizeBeforeCreate + 1);
ChapterSeen testChapterSeen = chapterSeenList.get(chapterSeenList.size() - 1);
assertThat(testChapterSeen.isSeen()).isEqualTo(DEFAULT_SEEN);
assertThat(testChapterSeen.getDate()).isEqualTo(DEFAULT_DATE);
}
use of com.furyviewer.domain.ChapterSeen in project FuryViewer by TheDoctor-95.
the class ChapterSeenResource method createChapterSeen.
/**
* POST /chapter-seens : Create a new chapterSeen.
*
* @param chapterSeen the chapterSeen to create
* @return the ResponseEntity with status 201 (Created) and with body the new chapterSeen, or with status 400 (Bad Request) if the chapterSeen has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/chapter-seens")
@Timed
public ResponseEntity<ChapterSeen> createChapterSeen(@RequestBody ChapterSeen chapterSeen) throws URISyntaxException {
log.debug("REST request to save ChapterSeen : {}", chapterSeen);
if (chapterSeen.getId() != null) {
throw new BadRequestAlertException("A new chapterSeen cannot already have an ID", ENTITY_NAME, "idexists");
}
ChapterSeen result = chapterSeenRepository.save(chapterSeen);
return ResponseEntity.created(new URI("/api/chapter-seens/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Aggregations