Source:
<code>public void shouldSaveASequentialIdentifierGenerator() throws Exception { long initialIdentifierSourceCount = getAllCount(); SimpleObject identifierSource = new SimpleObject(); identifierSource.add("name", "test sequential identifier"); identifierSource.add("description", "test sequential identifier"); identifierSource.add("identifierType", IDENTIFIER_TYPE_UUID); identifierSource.add("firstIdentifierBase", "1"); identifierSource.add("prefix", "ABC"); identifierSource.add("suffix", "XYZ"); identifierSource.add("minLength", "36"); identifierSource.add("maxLength", "38"); identifierSource.add("baseCharacterSet", "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); identifierSource.add("sourceType", "SequentialIdentifierGenerator"); String jsonIdentifierSource = new ObjectMapper().writeValueAsString(identifierSource); MockHttpServletRequest req = newPostRequest(getURI(), jsonIdentifierSource); handle(req); <START> assertEquals(service.getAllIdentifierSources(false).get(7).getName(), "test sequential identifier"); <END> assertEquals(initialIdentifierSourceCount + 1, getAllCount()); }</code><technical_language>assert of properties posted saved</technical_language>

Target:
public void shouldSaveASequentialIdentifierGenerator() throws Exception { long initialIdentifierSourceCount = getAllCount(); SimpleObject identifierSource = new SimpleObject(); identifierSource.add("name", "test sequential identifier"); identifierSource.add("description", "This is a test description for the sequential identifier"); identifierSource.add("identifierType", IDENTIFIER_TYPE_UUID); identifierSource.add("firstIdentifierBase", "1"); identifierSource.add("prefix", "ABC"); identifierSource.add("suffix", "XYZ"); identifierSource.add("minLength", "36"); identifierSource.add("maxLength", "38"); identifierSource.add("baseCharacterSet", "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); identifierSource.add("sourceType", SEQUENTIAL_IDENTIFIER_SOURCE_TYPE); String jsonIdentifierSource = new ObjectMapper().writeValueAsString(identifierSource); MockHttpServletRequest req = newPostRequest(getURI(), jsonIdentifierSource); SimpleObject newIdentifierSource = deserialize(handle(req)); String newIdentifierSourceUuid = PropertyUtils.getProperty(newIdentifierSource, "uuid").toString(); SequentialIdentifierGenerator generatedIdentifierSource = (SequentialIdentifierGenerator) service.getIdentifierSourceByUuid(newIdentifierSourceUuid); assertEquals(newIdentifierSourceUuid, generatedIdentifierSource.getUuid()); assertEquals(generatedIdentifierSource.getName(), "test sequential identifier"); assertEquals(generatedIdentifierSource.getDescription(), "This is a test description for the sequential identifier"); assertEquals(generatedIdentifierSource.getFirstIdentifierBase(), "1"); assertEquals(generatedIdentifierSource.getPrefix(), "ABC"); assertEquals(generatedIdentifierSource.getSuffix(), "XYZ"); assertEquals(generatedIdentifierSource.getMinLength().toString(), "36"); assertEquals(generatedIdentifierSource.getMaxLength().toString(), "38"); assertEquals(generatedIdentifierSource.getBaseCharacterSet(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); assertEquals(generatedIdentifierSource.getIdentifierType().getUuid(), IDENTIFIER_TYPE_UUID); assertEquals(initialIdentifierSourceCount + 1, getAllCount()); }