Skip to content

Instantly share code, notes, and snippets.

@mgenov
Created January 19, 2011 10:00
Show Gist options
  • Save mgenov/785938 to your computer and use it in GitHub Desktop.
Save mgenov/785938 to your computer and use it in GitHub Desktop.
@Factories(value = PricingRequestFactory.class)
public class RequestFactorySampleTest extends RequestFactoryJreTest{
@Inject
PricingService pricingService;
@Inject
PricingRequestFactory rf;
@Test
public void findPricingTemplate() {
final PricingTemplate existingPricingTemplate = new PricingTemplate(1l, "Test");
expect(pricingService.findPricingTemplate(1l)).andReturn(existingPricingTemplate);
replay(pricingService);
rf.pricingRequest().findPricingTemplate(1l).fire(new Receiver<PricingTemplateProxy>() {
@Override
public void onSuccess(PricingTemplateProxy response) {
assertEquals("template name was different?",response.getName(), existingPricingTemplate.getName());
}
});
verify(pricingService);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment