In the previous post, I wrote how you can use Spring’s FactoryBean to facilitate the creation of mock objects for Spring integration tests. Now, it is time to use the EasyMockFactoryBean (in this post EasyMock has been used for creating mock objects, but a similar approach applies to Mockito as well. Start by looking at [...]
Spring Integration Tests, Part II, Using Mock Objects
December 12th, 2011 by Mattias Severson — Java, Testing
Tags: easymock, mock, mockito, spring
Autowiring Morphia entities
December 7th, 2011 by Jan Kronquist — Java
My current project is using Morphia to handle object mapping to/from mongoDB and I wanted to add dependency injection using Spring to my entities like this: @Entity public class MyEntity { … @Autowired @Transient private SomeService someService; } Notice the @Transient annotation that tells Morphia to avoid persisting this field! I solved this problem by [...]
Tags: mongodb, morphia, spring
Spring Integration Tests, Part I, Creating Mock Objects
November 30th, 2011 by Mattias Severson — Java, Testing
When writing integration tests with Spring, it can sometimes be convenient to mock one or more of Spring bean dependencies. However, during some circumstances strange things may happen… (In this post, Mockito has been used for creating mock objects, but the same problem applies to EasyMock as well. You can find the corresponding files if [...]
Tags: easymock, factory-method, factorybean, mock, mockito, spring
Spring Web Flow + Roo – a simple example
May 18th, 2011 by Anders Davoust — Java
The other day I was trying to implement a new user registration. The goal was to validate user input data and save it to a database. I am using Spring Roo in my project so Spring Web Flow would be a good candidate for the task. Since Roo has support for Web Flow I thought [...]
Tags: roo, spring, spring web flow
Dynamic FTP Client using Apache Camel and Spring
August 12th, 2010 by Mattias Severson — Java
I was recently asked to develop an FTP client that could transmit files to various FTP servers as a part of a delivery system in a Java enterprise application. The requirements dictated a flexible implementation: Three different FTP protocols should be supported, namely FTP, FTPS and SFTP It should be possible to transmit different files [...]
Tags: apache, camel, FTP, spring
REST and XML using Spring MVC and Groovy
April 9th, 2010 by Mattias Hellborg Arthursson — Java
There’s one particular thing Groovy is really good for and that is working with XML. When I started playing around with the REST support in the latest version of Spring MVC I wanted to try using Spring for the controller infrastructure and delegate to Groovy for producing XML responses. It turned out this wasn’t as [...]
Tags: groovy, hateoas, rest, spring, xml
Load-time weaving, Spring and Maven.
December 15th, 2009 by Mattias Ask — Java, Tips & Tricks
As some of you might have read in my earlier post, I’m using load-time weaving in the project that I’m working on. Lately I’ve run in to some problems with getting the tests to play nice with Maven. So what was the problem? Well, I’ve been using @Configurable and @Autowired to inject stuff in my [...]
Tags: frameworks, javaagent, load-time weaving, ltw, maven, spring
Referential Integrity using Spring LDAP
December 7th, 2009 by Vlado Palczynski — Java
The directory servers of today are packed with a lot of nice features, one of them being Referential Integrity which performs integrity updates on attributes like member, uniqueMember, owner etc. Simpler put, when an entry updates its distinguished name, all references using the old distinguished name get updated to the new one. However, there can [...]
Tags: open source, programming, referential integrity, spring, spring ldap
Spring Security For Real with Grails
November 23rd, 2009 by Mattias Hellborg Arthursson — Java, Tips & Tricks
Spring Security is one of the basic building blocks I use pretty much every time I’m constructing a web application. It’s a very mature and incredibly powerful security framework, one of its main benefits being its versatility. There are hooks and plugs everywhere, allowing you to extend and combine basically any way you want. Now, [...]
Tags: grails, security, spring, spring security, web
Spring and load-time weaving of Neo4j-based domain objects
May 26th, 2009 by Mattias Ask — Architecture, Java
What do you do when your Spring configuration isn’t in charge of creating your objects that needs to be injected with stuff? This became a real problem for me when I tried doing some non-anemic domain object implementations persisted as Neo4j Nodes. I was playing around with creating a Twitter clone, in my opinion the [...]
Tags: aop, ddd, frameworks, neo4j, programming, spring
Simple Authentication Using Spring LDAP
February 2nd, 2009 by Mattias Hellborg Arthursson — Java
It’s with great pleasure that we can now finally announce the final 1.3.0 version of Spring LDAP. It’s been a while since we’ve made a major release, but there’s quite a bit in this one to make up for it. Among the highlights of this release are the improvements in the authentication area, which is [...]
Tags: 1.3.0, authentication, bind, howto, ldap, security, spring, spring ldap, tutorial
Devoxx highlights
December 23rd, 2008 by Jacob Mattsson — Agile, Events, Java
In order to embrace the true Christmas spirit, I thought I’d share a few goodies from the Devoxx conference that took place in Antwerp, Belgium in mid December. Devoxx is the former JavaPolis that has changed name due to trademarking issues with Sun. Nonetheless, it’s still the worlds largest independent Java conference, where the 3200 [...]
Tags: bdd, concurrency, conference, frameworks, spring, spring dm
Encrypting Properties With Jasypt
December 9th, 2008 by Ulrik Sandberg — Java, Tips & Tricks
Properties are used in many Java applications as a simple way of separating parts that are likely to change, from the parts that are not that likely to change. Consider for example this typical bean definition in a Spring configuration file: <bean id="traditionalPersonDao" class="org.springframework.ldap.samples.article.dao.TraditionalPersonDaoImpl"> <property name="url" value="ldap://localhost:3901" /> <property name="base" value="dc=jayway,dc=se" /> <property name="userDn" [...]
Tags: properties, security, spring, tools
What’s New in Spring LDAP 1.3
October 27th, 2008 by Mattias Hellborg Arthursson — Java
We recently released Spring LDAP 1.3.0.RC1. This long awaited release contains a number of new features and bug fixes. In this post I’ll highlight some of the changes, pointing out some of my favorite Spring LDAP features. Simple Authentication Mechanism By far the most requested feature for inclusion in Spring LDAP has been the ability [...]
Tags: authentication, spring, spring ldap, tls
Testing Among the Clouds, Part 2
October 20th, 2008 by Mattias Hellborg Arthursson — Cloud, Java, Testing
In a recent post I wrote about the particular problems we’ve been having with integration testing the Spring LDAP project and the use we’ve made of Amazon EC2 for solving these problems. In this post I’ll present the implementation details. Prerequisites In order to keep this reasonably brief I’ll have to refer to the getting [...]
Tags: automated testing, ec2, junit, spring, spring ldap, tdd, typica
