Browse Source

DATAMONGO-1176 - Polishing.

- Remove dropDups assertion as the MongoDB 3 driver does no longer provide dropDups even if running agains a MongoDB v2.6.7.
- Remove mongo-next build profile as we're based on the Mongo 3 driver now.
- Map update object and merge set operations.
pull/411/merge
Mark Paluch 10 years ago committed by Oliver Gierke
parent
commit
2d3efdc0b4
  1. 1
      .travis.yml
  2. 16
      pom.xml
  3. 16
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java
  4. 66
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java
  5. 12
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java
  6. 124
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/UpdateMapperUnitTests.java

1
.travis.yml

@ -9,7 +9,6 @@ before_script: @@ -9,7 +9,6 @@ before_script:
env:
matrix:
- PROFILE=ci
- PROFILE=mongo-next
- PROFILE=mongo3
- PROFILE=mongo3-next
- PROFILE=mongo31

16
pom.xml

@ -113,22 +113,6 @@ @@ -113,22 +113,6 @@
</developers>
<profiles>
<profile>
<id>mongo-next</id>
<properties>
<mongo>2.15.0-SNAPSHOT</mongo>
</properties>
<repositories>
<repository>
<id>mongo-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
</profile>
<profile>
<id>mongo3</id>

16
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

@ -1225,19 +1225,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware { @@ -1225,19 +1225,9 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
UpdateOptions opts = new UpdateOptions();
opts.upsert(upsert);
// TODO hack - split up update and replaces
boolean useUpdate = false;
for (String s : updateObj.keySet()) {
if (s.startsWith("$")) {
useUpdate = true;
break;
}
}
collection = writeConcernToUse != null ? collection.withWriteConcern(writeConcernToUse) : collection;
if (!useUpdate) {
if (!UpdateMapper.isUpdateObject(updateObj)) {
return collection.replaceOne(queryObj, updateObj, opts);
} else {
if (multi) {
@ -1661,7 +1651,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware { @@ -1661,7 +1651,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
}
/**
* Returns the potentially mapped results of the given {@commandResult} contained some.
* Returns the potentially mapped results of the given {@code commandResult}.
*
* @param outputType
* @param commandResult
@ -2200,7 +2190,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware { @@ -2200,7 +2190,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
* @param exceptionTranslator the {@link PersistenceExceptionTranslator} to be used for translation
* @return
*/
private static RuntimeException potentiallyConvertRuntimeException(RuntimeException ex,
static RuntimeException potentiallyConvertRuntimeException(RuntimeException ex,
PersistenceExceptionTranslator exceptionTranslator) {
RuntimeException resolved = exceptionTranslator.translateExceptionIfPossible(ex);
return resolved == null ? ex : resolved;

66
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/UpdateMapper.java

@ -18,6 +18,7 @@ package org.springframework.data.mongodb.core.convert; @@ -18,6 +18,7 @@ package org.springframework.data.mongodb.core.convert;
import java.util.Map.Entry;
import org.bson.Document;
import org.bson.conversions.Bson;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.mapping.Association;
import org.springframework.data.mapping.context.MappingContext;
@ -35,6 +36,7 @@ import org.springframework.data.util.TypeInformation; @@ -35,6 +36,7 @@ import org.springframework.data.util.TypeInformation;
* @author Thomas Darimont
* @author Oliver Gierke
* @author Christoph Strobl
* @author Mark Paluch
*/
public class UpdateMapper extends QueryMapper {
@ -51,6 +53,70 @@ public class UpdateMapper extends QueryMapper { @@ -51,6 +53,70 @@ public class UpdateMapper extends QueryMapper {
this.converter = converter;
}
/*
* (non-Javadoc)
* @see org.springframework.data.mongodb.core.convert.QueryMapper#getMappedObject(Bson, MongoPersistentEntity)
*/
@Override
public Document getMappedObject(Bson query, MongoPersistentEntity<?> entity) {
Document document = super.getMappedObject(query, entity);
boolean hasOperators = false;
boolean hasFields = false;
Document set = null;
for (String s : document.keySet()) {
if (s.startsWith("$")) {
if(s.equals("$set")){
set = document.get(s, Document.class);
}
hasOperators = true;
} else {
hasFields = true;
}
}
if (hasOperators && hasFields) {
Document updateObject = new Document();
Document fieldsToSet = set == null ? new Document() : set;
for (String s : document.keySet()) {
if (s.startsWith("$")) {
updateObject.put(s, document.get(s));
} else {
fieldsToSet.put(s, document.get(s));
}
}
updateObject.put("$set", fieldsToSet);
return updateObject;
}
return document;
}
/**
* Returns {@literal true} if the given {@link Document} is an update object that uses update operators.
* @param updateObj
* @return {@literal true} if the given {@link Document} is an update object.
*/
public static boolean isUpdateObject(Document updateObj) {
if (updateObj == null) {
return false;
}
for (String s : updateObj.keySet()) {
if (s.startsWith("$")) {
return true;
}
}
return false;
}
/**
* Converts the given source object to a mongo type retaining the original type information of the source type on the
* mongo type.

12
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java

@ -360,20 +360,14 @@ public class MongoTemplateTests { @@ -360,20 +360,14 @@ public class MongoTemplateTests {
assertThat(indexInfo.size(), is(2));
Object indexKey = null;
boolean unique = false;
boolean dropDupes = false;
for (org.bson.Document ix : indexInfo) {
if ("age_-1".equals(ix.get("name"))) {
indexKey = ix.get("key");
unique = (Boolean) ix.get("unique");
if (mongoVersion.isLessThan(TWO_DOT_EIGHT)) {
dropDupes = (Boolean) ix.get("dropDups");
assertThat(dropDupes, is(true));
} else {
assertThat(ix.get("dropDups"), is(nullValue()));
}
}
}
assertThat(((org.bson.Document) indexKey), IsMapContaining.<String, Object> hasEntry("age", -1));
assertThat(unique, is(true));
@ -382,13 +376,7 @@ public class MongoTemplateTests { @@ -382,13 +376,7 @@ public class MongoTemplateTests {
assertThat(indexInfoList.size(), is(2));
IndexInfo ii = indexInfoList.get(1);
assertThat(ii.isUnique(), is(true));
if (mongoVersion.isLessThan(TWO_DOT_EIGHT)) {
assertThat(ii.isDropDuplicates(), is(true));
} else {
assertThat(ii.isDropDuplicates(), is(false));
}
assertThat(ii.isSparse(), is(false));
List<IndexField> indexFields = ii.getIndexFields();

124
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/UpdateMapperUnitTests.java

@ -44,9 +44,6 @@ import org.springframework.data.convert.WritingConverter; @@ -44,9 +44,6 @@ import org.springframework.data.convert.WritingConverter;
import org.springframework.data.mapping.model.MappingException;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.DBObjectTestUtils;
import org.springframework.data.mongodb.core.convert.UpdateMapperUnitTests.ClassWithEnum.Allocation;
import org.springframework.data.mongodb.core.convert.UpdateMapperUnitTests.ClassWithEnum.AllocationToStringConverter;
import org.springframework.data.mongodb.core.convert.UpdateMapperUnitTests.ClassWithEnum.StringToAllocationConverter;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.query.Criteria;
@ -105,7 +102,7 @@ public class UpdateMapperUnitTests { @@ -105,7 +102,7 @@ public class UpdateMapperUnitTests {
Document push = getAsDocument(mappedObject, "$push");
Document list = getAsDocument(push, "aliased");
assertThat(list.get("_class"), is((Object) ConcreteChildClass.class.getName()));
assertThat(list.get("_class"), is(ConcreteChildClass.class.getName()));
}
/**
@ -171,7 +168,7 @@ public class UpdateMapperUnitTests { @@ -171,7 +168,7 @@ public class UpdateMapperUnitTests {
Document set = getAsDocument(mappedObject, "$set");
Document modelDbObject = getAsDocument(set, "aliased.$");
assertThat(modelDbObject.get("_class"), is((Object) ConcreteChildClass.class.getName()));
assertThat(modelDbObject.get("_class"), is(ConcreteChildClass.class.getName()));
}
/**
@ -187,8 +184,8 @@ public class UpdateMapperUnitTests { @@ -187,8 +184,8 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(ParentClass.class));
Document set = getAsDocument(mappedObject, "$set");
assertThat(set.get("aliased.$.value"), is((Object) "foo"));
assertThat(set.get("aliased.$.otherValue"), is((Object) "bar"));
assertThat(set.get("aliased.$.value"), is("foo"));
assertThat(set.get("aliased.$.otherValue"), is("bar"));
}
/**
@ -204,12 +201,12 @@ public class UpdateMapperUnitTests { @@ -204,12 +201,12 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(ParentClass.class));
Document dbo = getAsDocument(mappedObject, "$set");
assertThat(dbo.get("aliased.$.value"), is((Object) "foo"));
assertThat(dbo.get("aliased.$.value"), is("foo"));
Document someObject = getAsDocument(dbo, "aliased.$.someObject");
assertThat(someObject, is(notNullValue()));
assertThat(someObject.get("_class"), is((Object) ConcreteChildClass.class.getName()));
assertThat(someObject.get("value"), is((Object) "bubu"));
assertThat(someObject.get("_class"), is(ConcreteChildClass.class.getName()));
assertThat(someObject.get("value"), is("bubu"));
}
/**
@ -229,7 +226,7 @@ public class UpdateMapperUnitTests { @@ -229,7 +226,7 @@ public class UpdateMapperUnitTests {
assertThat(push.get("_class"), nullValue());
assertThat(values.get("_class"), nullValue());
assertThat(each, IsIterableContainingInOrder.<Object> contains("spring", "data", "mongodb"));
assertThat(each, IsIterableContainingInOrder.contains("spring", "data", "mongodb"));
}
/**
@ -264,7 +261,7 @@ public class UpdateMapperUnitTests { @@ -264,7 +261,7 @@ public class UpdateMapperUnitTests {
List<Object> each = getAsDBList(model, "$each");
List<Object> values = getAsDBList((Document) each.get(0), "values");
assertThat(values, IsIterableContainingInOrder.<Object> contains("spring", "data", "mongodb"));
assertThat(values, IsIterableContainingInOrder.contains("spring", "data", "mongodb"));
}
/**
@ -312,7 +309,7 @@ public class UpdateMapperUnitTests { @@ -312,7 +309,7 @@ public class UpdateMapperUnitTests {
Document key = getAsDocument(push, "key");
assertThat(key.containsKey("$position"), is(true));
assertThat((Integer) key.get("$position"), is(2));
assertThat(key.get("$position"), is(2));
assertThat(getAsDocument(push, "key").containsKey("$each"), is(true));
}
@ -330,7 +327,7 @@ public class UpdateMapperUnitTests { @@ -330,7 +327,7 @@ public class UpdateMapperUnitTests {
Document key = getAsDocument(push, "key");
assertThat(key.containsKey("$position"), is(true));
assertThat((Integer) key.get("$position"), is(0));
assertThat(key.get("$position"), is(0));
assertThat(getAsDocument(push, "key").containsKey("$each"), is(true));
}
@ -382,7 +379,7 @@ public class UpdateMapperUnitTests { @@ -382,7 +379,7 @@ public class UpdateMapperUnitTests {
Document key = getAsDocument(push, "key");
assertThat(key.containsKey("$slice"), is(true));
assertThat((Integer) key.get("$slice"), is(5));
assertThat(key.get("$slice"), is(5));
assertThat(key.containsKey("$each"), is(true));
}
@ -401,13 +398,13 @@ public class UpdateMapperUnitTests { @@ -401,13 +398,13 @@ public class UpdateMapperUnitTests {
Document key = getAsDocument(push, "key");
assertThat(key.containsKey("$slice"), is(true));
assertThat((Integer) key.get("$slice"), is(5));
assertThat(key.get("$slice"), is(5));
assertThat(key.containsKey("$each"), is(true));
Document key2 = getAsDocument(push, "key-2");
assertThat(key2.containsKey("$slice"), is(true));
assertThat((Integer) key2.get("$slice"), is(-2));
assertThat(key2.get("$slice"), is(-2));
assertThat(key2.containsKey("$each"), is(true));
}
@ -439,7 +436,7 @@ public class UpdateMapperUnitTests { @@ -439,7 +436,7 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(DocumentWithDBRefCollection.class));
Document pullClause = getAsDocument(mappedObject, "$pull");
assertThat(pullClause.get("dbRefAnnotatedList"), is((Object) new DBRef("entity", "2")));
assertThat(pullClause.get("dbRefAnnotatedList"), is(new DBRef("entity", "2")));
}
/**
@ -456,7 +453,7 @@ public class UpdateMapperUnitTests { @@ -456,7 +453,7 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(DocumentWithDBRefCollection.class));
Document pullClause = getAsDocument(mappedObject, "$pull");
assertThat(pullClause.get("dbRefAnnotatedList"), is((Object) new DBRef("entity", entity.id)));
assertThat(pullClause.get("dbRefAnnotatedList"), is(new DBRef("entity", entity.id)));
}
/**
@ -497,7 +494,7 @@ public class UpdateMapperUnitTests { @@ -497,7 +494,7 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(DocumentWithDBRefCollection.class));
Document setClause = getAsDocument(mappedObject, "$set");
assertThat(setClause.get("dbRefProperty"), is((Object) new DBRef("entity", entity.id)));
assertThat(setClause.get("dbRefProperty"), is(new DBRef("entity", entity.id)));
}
/**
@ -532,7 +529,7 @@ public class UpdateMapperUnitTests { @@ -532,7 +529,7 @@ public class UpdateMapperUnitTests {
Document idClause = getAsDocument(options, "_id");
List<Object> inClause = getAsDBList(idClause, "$in");
assertThat(inClause, IsIterableContainingInOrder.<Object> contains(1L, 2L));
assertThat(inClause, IsIterableContainingInOrder.contains(1L, 2L));
}
/**
@ -550,7 +547,7 @@ public class UpdateMapperUnitTests { @@ -550,7 +547,7 @@ public class UpdateMapperUnitTests {
Document values = getAsDocument(addToSet, "values");
List<Object> each = getAsDBList(values, "$each");
assertThat(each, IsIterableContainingInOrder.<Object> contains("spring", "data", "mongodb"));
assertThat(each, IsIterableContainingInOrder.contains("spring", "data", "mongodb"));
}
/**
@ -588,7 +585,7 @@ public class UpdateMapperUnitTests { @@ -588,7 +585,7 @@ public class UpdateMapperUnitTests {
Object model = $set.get("referencedDocument");
DBRef expectedDBRef = new DBRef("interfaceDocumentDefinitionImpl", "1");
assertThat(model, allOf(instanceOf(DBRef.class), IsEqual.<Object> equalTo(expectedDBRef)));
assertThat(model, allOf(instanceOf(DBRef.class), IsEqual.equalTo(expectedDBRef)));
}
/**
@ -606,7 +603,7 @@ public class UpdateMapperUnitTests { @@ -606,7 +603,7 @@ public class UpdateMapperUnitTests {
Document value = DBObjectTestUtils.getAsDocument(list, "value");
List<Object> $in = DBObjectTestUtils.getAsDBList(value, "$in");
assertThat($in, IsIterableContainingInOrder.<Object> contains("foo", "bar"));
assertThat($in, IsIterableContainingInOrder.contains("foo", "bar"));
}
/**
@ -719,7 +716,7 @@ public class UpdateMapperUnitTests { @@ -719,7 +716,7 @@ public class UpdateMapperUnitTests {
public void mappingShouldRetainTypeInformationOfNestedListWhenUpdatingConcreteyParentType() {
ListModelWrapper lmw = new ListModelWrapper();
lmw.models = Collections.<Model> singletonList(new ModelImpl(1));
lmw.models = Collections.singletonList(new ModelImpl(1));
Update update = new Update().set("concreteTypeWithListAttributeOfInterfaceType", lmw);
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(),
@ -778,7 +775,7 @@ public class UpdateMapperUnitTests { @@ -778,7 +775,7 @@ public class UpdateMapperUnitTests {
@Test
public void mappingShouldRetrainTypeInformationWhenValueTypeOfMapDoesNotMatchItsDeclaration() {
Map<Object, Object> map = Collections.<Object, Object> singletonMap("szeth", new NestedDocument("son-son-vallano"));
Map<Object, Object> map = Collections.singletonMap("szeth", new NestedDocument("son-son-vallano"));
Update update = new Update().set("map", map);
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(),
@ -794,7 +791,7 @@ public class UpdateMapperUnitTests { @@ -794,7 +791,7 @@ public class UpdateMapperUnitTests {
@Test
public void mappingShouldNotContainTypeInformationWhenValueTypeOfMapMatchesDeclaration() {
Map<Object, NestedDocument> map = Collections.<Object, NestedDocument> singletonMap("jasnah",
Map<Object, NestedDocument> map = Collections.singletonMap("jasnah",
new NestedDocument("kholin"));
Update update = new Update().set("concreteMap", map);
@ -813,7 +810,7 @@ public class UpdateMapperUnitTests { @@ -813,7 +810,7 @@ public class UpdateMapperUnitTests {
public void mapsUpdateWithBothReadingAndWritingConverterRegistered() {
CustomConversions conversions = new CustomConversions(
Arrays.asList(AllocationToStringConverter.INSTANCE, StringToAllocationConverter.INSTANCE));
Arrays.asList(ClassWithEnum.AllocationToStringConverter.INSTANCE, ClassWithEnum.StringToAllocationConverter.INSTANCE));
MongoMappingContext mappingContext = new MongoMappingContext();
mappingContext.setSimpleTypeHolder(conversions.getSimpleTypeHolder());
@ -825,11 +822,11 @@ public class UpdateMapperUnitTests { @@ -825,11 +822,11 @@ public class UpdateMapperUnitTests {
UpdateMapper mapper = new UpdateMapper(converter);
Update update = new Update().set("allocation", Allocation.AVAILABLE);
Update update = new Update().set("allocation", ClassWithEnum.Allocation.AVAILABLE);
Document result = mapper.getMappedObject(update.getUpdateObject(),
mappingContext.getPersistentEntity(ClassWithEnum.class));
assertThat(result, isBsonObject().containing("$set.allocation", Allocation.AVAILABLE.code));
assertThat(result, isBsonObject().containing("$set.allocation", ClassWithEnum.Allocation.AVAILABLE.code));
}
/**
@ -907,7 +904,7 @@ public class UpdateMapperUnitTests { @@ -907,7 +904,7 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(SimpleValueHolder.class));
Document $set = DBObjectTestUtils.getAsDocument(mappedUpdate, "$set");
assertThat($set.get("intValue"), Is.<Object> is(10));
assertThat($set.get("intValue"), Is.is(10));
}
/**
@ -921,7 +918,7 @@ public class UpdateMapperUnitTests { @@ -921,7 +918,7 @@ public class UpdateMapperUnitTests {
context.getPersistentEntity(SimpleValueHolder.class));
Document $set = DBObjectTestUtils.getAsDocument(mappedUpdate, "$set");
assertThat($set.get("primIntValue"), Is.<Object> is(10));
assertThat($set.get("primIntValue"), Is.is(10));
}
/**
@ -958,7 +955,7 @@ public class UpdateMapperUnitTests { @@ -958,7 +955,7 @@ public class UpdateMapperUnitTests {
public void mappingShouldConsiderCustomConvertersForEnumMapKeys() {
CustomConversions conversions = new CustomConversions(
Arrays.asList(AllocationToStringConverter.INSTANCE, StringToAllocationConverter.INSTANCE));
Arrays.asList(ClassWithEnum.AllocationToStringConverter.INSTANCE, ClassWithEnum.StringToAllocationConverter.INSTANCE));
MongoMappingContext mappingContext = new MongoMappingContext();
mappingContext.setSimpleTypeHolder(conversions.getSimpleTypeHolder());
@ -970,7 +967,7 @@ public class UpdateMapperUnitTests { @@ -970,7 +967,7 @@ public class UpdateMapperUnitTests {
UpdateMapper mapper = new UpdateMapper(converter);
Update update = new Update().set("enumAsMapKey", Collections.singletonMap(Allocation.AVAILABLE, 100));
Update update = new Update().set("enumAsMapKey", Collections.singletonMap(ClassWithEnum.Allocation.AVAILABLE, 100));
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(),
mappingContext.getPersistentEntity(ClassWithEnum.class));
@ -981,6 +978,51 @@ public class UpdateMapperUnitTests { @@ -981,6 +978,51 @@ public class UpdateMapperUnitTests {
assertThat(enumAsMapKey.get("AVAILABLE"), is(100));
}
/**
* @see DATAMONGO-1176
*/
@Test
public void mappingShouldPrepareUpdateObjectForMixedOperatorsAndFields() {
Document document = new Document("key", "value").append("$set", new Document("a", "b").append("x", "y"));
Document mappedObject = mapper.getMappedObject(document, context.getPersistentEntity(SimpleValueHolder.class));
assertThat(mappedObject.get("$set"), is(equalTo(new Document("a", "b").append("x", "y").append("key", "value"))));
assertThat(mappedObject.size(), is(1));
}
/**
* @see DATAMONGO-1176
*/
@Test
public void mappingShouldReturnReplaceObject() {
Document document = new Document("key", "value").append("a", "b").append("x", "y");
Document mappedObject = mapper.getMappedObject(document, context.getPersistentEntity(SimpleValueHolder.class));
assertThat(mappedObject.get("key"), is(equalTo("value")));
assertThat(mappedObject.get("a"), is(equalTo("b")));
assertThat(mappedObject.get("x"), is(equalTo("y")));
assertThat(mappedObject.size(), is(3));
}
/**
* @see DATAMONGO-1176
*/
@Test
public void mappingShouldReturnUpdateObject() {
Document document = new Document("$push", new Document("x", "y")).append("$set", new Document("a", "b"));
Document mappedObject = mapper.getMappedObject(document, context.getPersistentEntity(SimpleValueHolder.class));
assertThat(mappedObject.get("$push"), is(equalTo(new Document("x", "y"))));
assertThat(mappedObject.get("$set"), is(equalTo(new Document("a", "b"))));
assertThat(mappedObject.size(), is(2));
}
/**
* @see DATAMONGO-1486
*/
@ -1011,7 +1053,7 @@ public class UpdateMapperUnitTests { @@ -1011,7 +1053,7 @@ public class UpdateMapperUnitTests {
}
@org.springframework.data.mongodb.core.mapping.Document(collection = "DocumentWithReferenceToInterface")
static interface DocumentWithReferenceToInterface {
interface DocumentWithReferenceToInterface {
String getId();
@ -1019,7 +1061,7 @@ public class UpdateMapperUnitTests { @@ -1019,7 +1061,7 @@ public class UpdateMapperUnitTests {
}
static interface InterfaceDocumentDefinitionWithoutId {
interface InterfaceDocumentDefinitionWithoutId {
String getValue();
}
@ -1068,7 +1110,7 @@ public class UpdateMapperUnitTests { @@ -1068,7 +1110,7 @@ public class UpdateMapperUnitTests {
}
static interface Model {}
interface Model {}
static class ModelImpl implements Model {
public int value;
@ -1226,13 +1268,13 @@ public class UpdateMapperUnitTests { @@ -1226,13 +1268,13 @@ public class UpdateMapperUnitTests {
Allocation allocation;
Map<Allocation, String> enumAsMapKey;
static enum Allocation {
enum Allocation {
AVAILABLE("V"), ALLOCATED("A");
String code;
private Allocation(String code) {
Allocation(String code) {
this.code = code;
}
@ -1248,7 +1290,7 @@ public class UpdateMapperUnitTests { @@ -1248,7 +1290,7 @@ public class UpdateMapperUnitTests {
}
}
static enum AllocationToStringConverter implements Converter<Allocation, String> {
enum AllocationToStringConverter implements Converter<Allocation, String> {
INSTANCE;
@ -1258,7 +1300,7 @@ public class UpdateMapperUnitTests { @@ -1258,7 +1300,7 @@ public class UpdateMapperUnitTests {
}
}
static enum StringToAllocationConverter implements Converter<String, Allocation> {
enum StringToAllocationConverter implements Converter<String, Allocation> {
INSTANCE;

Loading…
Cancel
Save