Commit 5e00edea by Shwetha GS

ATLAS-45 Entity submit fails (suma.shivaprasad via shwethags)

parent 41481672
...@@ -8,6 +8,7 @@ ATLAS-54 Rename configs in hive hook (shwethags) ...@@ -8,6 +8,7 @@ ATLAS-54 Rename configs in hive hook (shwethags)
ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags) ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS-45 Entity submit fails (suma.shivaprasad via shwethags)
ATLAS-46 Different data directory with restart (shwethags) ATLAS-46 Different data directory with restart (shwethags)
ATLAS-81 atlas debian packaing fails in maven build (vijay_k via shwethags) ATLAS-81 atlas debian packaing fails in maven build (vijay_k via shwethags)
ATLAS-36 Need separate persisted properties for HTTP and HTTPS ports (jmaron) ATLAS-36 Need separate persisted properties for HTTP and HTTPS ports (jmaron)
......
...@@ -87,6 +87,14 @@ public class DataTypes { ...@@ -87,6 +87,14 @@ public class DataTypes {
public abstract T nullValue(); public abstract T nullValue();
@Override
protected T convertNull(Multiplicity m) throws AtlasException {
if (!m.nullAllowed()) {
throw new ValueConversionException.NullConversionException(m);
}
return nullValue();
}
} }
public static class BooleanType extends PrimitiveType<Boolean> { public static class BooleanType extends PrimitiveType<Boolean> {
...@@ -455,7 +463,7 @@ public class DataTypes { ...@@ -455,7 +463,7 @@ public class DataTypes {
@Override @Override
public String convert(Object val, Multiplicity m) throws AtlasException { public String convert(Object val, Multiplicity m) throws AtlasException {
if (val != null && (!(val instanceof String) || StringUtils.isNotBlank((CharSequence) val))) { if (val != null && (!(val instanceof String) || StringUtils.isNotEmpty((CharSequence) val))) {
return val.toString(); return val.toString();
} }
return convertNull(m); return convertNull(m);
......
...@@ -98,7 +98,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT { ...@@ -98,7 +98,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@DataProvider @DataProvider
public Object[][] invalidAttrValues() { public Object[][] invalidAttrValues() {
return new Object[][]{{null}, {""}, {" "}}; return new Object[][]{{null}, {""}};
} }
@Test(dataProvider = "invalidAttrValues") @Test(dataProvider = "invalidAttrValues")
...@@ -109,7 +109,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT { ...@@ -109,7 +109,7 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
try { try {
createInstance(databaseInstance); createInstance(databaseInstance);
Assert.fail("Exptected MetadataServiceException"); Assert.fail("Expected AtlasServiceException");
} catch (AtlasServiceException e) { } catch (AtlasServiceException e) {
Assert.assertEquals(e.getStatus(), ClientResponse.Status.BAD_REQUEST); Assert.assertEquals(e.getStatus(), ClientResponse.Status.BAD_REQUEST);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment