use of de.spring.example.persistence.domain.Ad in project JavaForFun by gumartinm.
the class AdRespositoryIntegrationShould method find_one_ad_by_id.
@Test
public void find_one_ad_by_id() {
Ad ad = createAd();
Ad createdAd = adRepository.save(ad);
Ad storedAd = adRepository.findOne(createdAd.getId());
assertThat(createdAd, is(storedAd));
}
use of de.spring.example.persistence.domain.Ad in project JavaForFun by gumartinm.
the class AdTest method whenCallingConstructorWithParametersThenCreateObject.
@Test
public void whenCallingConstructorWithParametersThenCreateObject() {
Ad ad = createAd();
assertThat(ad.getAdDescriptions(), is(AD_DESCRIPTIONS));
assertThat(ad.getAdMobileImage(), is(AD_MOBILE_IMAGE));
assertThat(ad.getCompanyCategId(), is(COMPANY_CATEG_ID));
assertThat(ad.getCompanyId(), is(COMPANY_ID));
assertThat(ad.getCreatedAt(), is(CREATED_AT));
assertThat(ad.getUpdatedAt(), is(UPDATED_AT));
assertThat(ad.getId(), is(AD_ID));
}
use of de.spring.example.persistence.domain.Ad in project JavaForFun by gumartinm.
the class AdController method findAll.
@Override
public Flux<Ad> findAll() {
Flux<Ad> entities = repository.findAll();
return entities.flatMap(ad -> {
return Mono.subscriberContext().map(context -> {
UsernameContext usernameContext = context.get(UsernameContext.class);
UsernameContext lol = usernameContext;
return ad;
});
});
}
use of de.spring.example.persistence.domain.Ad in project JavaForFun by gumartinm.
the class AdRespositoryIntegrationShould method find_one_ad_by_id_using_native_query.
@Test
public void find_one_ad_by_id_using_native_query() {
Ad ad = createAd();
Ad createdAd = adRepository.save(ad);
Ad storedAd = adRepository.findByIdNativeQuery(createdAd.getId());
assertThat(createdAd, is(storedAd));
}
use of de.spring.example.persistence.domain.Ad in project JavaForFun by gumartinm.
the class AdRespositoryIntegrationShould method find_one_ad_by_id_using_named_query.
@Test
public void find_one_ad_by_id_using_named_query() {
Ad ad = createAd();
Ad createdAd = adRepository.save(ad);
Ad storedAd = adRepository.findByIdQuery(createdAd.getId());
assertThat(createdAd, is(storedAd));
}
Aggregations