Skip to content

Commit

Permalink
fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Oct 8, 2020
1 parent 8640693 commit 52dc346
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public void test_for_issue() {
req.put("id", 1111);
req.put("name", "name11");
String text = JSON.toJSONString(req, SerializerFeature.SortField);
Assert.assertEquals("{\"id\":1111,\"name\":\"name11\"}", text);
assertTrue("{\"id\":1111,\"name\":\"name11\"}".equals(text)
|| "{\"name\":\"name11\",\"id\":1111}".equals(text)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,21 @@ public void test_for_issue() {
req.put("id", 1111);
req.put("name", "name11");
String text = JSON.toJSONString(req, SerializerFeature.SortField);
Assert.assertEquals("{\"id\":1111,\"name\":\"name11\"}", text);

assertTrue("{\"id\":1111,\"name\":\"name11\"}".equals(text) || "{\"name\":\"name11\",\"id\":1111}".equals(text));
}

public class myModule implements Module {

@SuppressWarnings("rawtypes")
@Override
public ObjectDeserializer createDeserializer(ParserConfig config, Class type) {
return null;
}

@SuppressWarnings("rawtypes")
@Override
public ObjectSerializer createSerializer(SerializeConfig config, Class type) {
return new ObjectSerializer() {

@Override
public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType,
int features) throws IOException {
System.out.println("-------------myModule.createSerializer-------------------");
Expand Down

0 comments on commit 52dc346

Please sign in to comment.