use of com.icthh.xm.ms.entity.domain.XmEntity in project xm-ms-entity by xm-online.
the class AvatarUrlListenerUnitTest method testPostLoadWrongFormat.
@Test
public void testPostLoadWrongFormat() {
XmEntity entity = new XmEntity().avatarUrl("http://s3.hello.amazonaws.com/hello/hello.jpg");
target.postLoad(entity);
assertEquals(null, entity.getAvatarUrl());
}
use of com.icthh.xm.ms.entity.domain.XmEntity in project xm-ms-entity by xm-online.
the class AvatarUrlListenerUnitTest method testPrePersistSuccessNginx.
@Test
public void testPrePersistSuccessNginx() {
XmEntity entity = new XmEntity().avatarUrl("https://hello-rgw.icthh.test/hello.jpg");
target.prePersist(entity);
assertEquals("hello.jpg", entity.getAvatarUrl());
}
use of com.icthh.xm.ms.entity.domain.XmEntity in project xm-ms-entity by xm-online.
the class AvatarUrlListenerUnitTest method testPostLoadEmpty.
@Test
public void testPostLoadEmpty() {
XmEntity entity = new XmEntity().avatarUrl(null);
target.postLoad(entity);
assertEquals(null, entity.getAvatarUrl());
}
use of com.icthh.xm.ms.entity.domain.XmEntity in project xm-ms-entity by xm-online.
the class XmEntityResource method searchByTypeKeyAndQuery.
@GetMapping("/_search-with-typekey/xm-entities")
@Timed
public ResponseEntity<List<XmEntity>> searchByTypeKeyAndQuery(@RequestParam String typeKey, @RequestParam(required = false) String query, @ApiParam Pageable pageable) {
Page<XmEntity> page = xmEntityService.searchByQueryAndTypeKey(query, typeKey, pageable, null);
HttpHeaders headers = PaginationUtil.generateSearchPaginationHttpHeaders(typeKey, page, "/api/_search-with-typekey/xm-entities");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
use of com.icthh.xm.ms.entity.domain.XmEntity in project xm-ms-entity by xm-online.
the class XmEntityResource method getAllXmEntities.
/**
* GET /xm-entities : get all the xmEntities.
*
* @param pageable the pagination information
* @return the ResponseEntity with status 200 (OK) and the list of xmEntities in body
*/
@GetMapping("/xm-entities")
@Timed
public ResponseEntity<List<XmEntity>> getAllXmEntities(@ApiParam Pageable pageable, @RequestParam(required = false) String typeKey) {
Page<XmEntity> page = xmEntityService.findAll(pageable, typeKey, null);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/xm-entities");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}
Aggregations