A software engineering blog mainly focused on programming, web development and testing

Posts

  • Accessing Restful services. HTTP Message converters

    When accessing to Restful services, the Spring class RestTemplate maintains a list of message converters. This list will be used to marshal objects into the request body, or unmarshalling them from the response. When instantiating the RestTemplate class, it automatically fills a list with several converters:

    • ByteArrayHttpMessageConverter
    • StringHttpMessageConverter
    • ResourceHttpMessageConverter
    • SourceHttpMessageConverter
    • AllEncompassingFormHttpMessageConverter
     
  • Spring property-placeholder: External properties configuration

    A common way of setting the configuration of the web application is by defining it in a properties file. We can find this file in the classpath. The way of doing this is using the PropertyPlaceholderConfigurer class, or simplifying the configuration, using the context namespace property-placeholder.

    <context:property-placeholder location="datasource.properties"/>

    That’s ok but, what if you need a different configuration...

  • Create and test REST services with Spring MVC

    The first part of this example shows how to create and test REST services using Spring MVC. The controller contains CRUD operations on warehouses and its products. For this example, the repository is a stub that simulates access to the database.
    The second part will...
  • Testing Spring Webflow 2 with inheritance

    This blog entry shows how to test a flow with inheritance in Spring Webflow 2. The flow to be tested consists of a simple navigation which starts with a view state and ends getting to another view state that will depend on the result of the execution of a controller. This flow extends another flow which basically contains...