Skip to content

bcanvural/crisp-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unit Testing with CRISP API

  • Tests are at site/src/test
  • AbstractCrispTest class is the base testing class

Testing using ResourceBroker and HippoServiceRegistry

  • See com.bloomreach.ResourceBrokerExampleTest

Testing the resource resolver defined in your Hippo project:

  • See com.bloomreach.MarketoCrispTest for a minimal setup

  • Copy paste from /hippo:configuration/hippo:modules/crispregistry/hippo:moduleconfig/crisp:resourceresolvercontainer/<your_resource_resolver_name>/@crisp:beandefinition to an xml file at src/main/test/resources/crisp-resource-resolvers/<your_bean_definition_in_console>.xml

  • If you have more than one resource resolver xml definitions, give each of them a unique id so you can fetch it with @Qualifier annotation. Otherwise Spring does not know which bean to autowire since there are multiple of same type.

  • Then you can fetch your resource resolver beans like:

 @Autowired
 @Qualifier(RESOURCE_RESOLVER_NAME)
 SimpleJacksonRestTemplateResourceResolver marketoResourceResolver;
  • It is also possible to autowire the Spring application context like:
@Autowired
ApplicationContext applicationContext;

About

Unit testing boilerplate for CRISP API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages