Skip to content

Commit

Permalink
Fixing failing tests
Browse files Browse the repository at this point in the history
(cherry picked from commit c8f42ae)
  • Loading branch information
dkayiwa committed Oct 11, 2016
1 parent 099d653 commit 6b55b67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public boolean onFlushDirty(Object entity, Serializable id, Object[] currentStat
if (log.isDebugEnabled()) {
log.debug("The following fields cannot be changed for " + getSupportedType() + ":" + changedProperties);
}
throw new APIException("Editing some fields: " + changedProperties + " on " + getSupportedType().getSimpleName() + " is not allowed");
throw new APIException("Editing some fields " + changedProperties + " on " + getSupportedType().getSimpleName() + " is not allowed");
}
}

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3219,7 +3219,7 @@ could.not.encrypt.text=Could not encrypt text
could.not.generate.cipher.key=Could not generate cipher key
DataSetProvider.not.found=No DataSetProvider found for ({0}) {1}
does.not.have.string.constructor={0} does not have a string constructor
editing.fields.not.allowed=Editing some fields on {0} is not allowed
editing.fields.not.allowed=Editing some fields {0} on {1} is not allowed
error.occurred.on.remote.server=An error occurred on the remote server
failed.change.property.value=Failed to change property value from empty string to null for {0}
failed.instantiate.assignment.handler=Failed to instantiate assignment handler object for class: {0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void shouldFailIfAnEditedOrderIsFlushed() throws Exception {
assertFalse(encounter.getOrders().isEmpty());
encounter.getOrders().iterator().next().setInstructions("new");
expectedException.expect(APIException.class);
expectedException.expectMessage(Matchers.is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { Order.class.getSimpleName() }, null)));
expectedException.expectMessage(Matchers.is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { "[instructions]", Order.class.getSimpleName() }, null)));
encounterService.saveEncounter(encounter);
Context.flushSession();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void onFlushDirty_shouldFailIfAnEntityHasAChangedProperty() throws Except
String[] currentState = new String[] { "new" };
ImmutableEntityInterceptor interceptor = new SomeImmutableEntityInterceptor();
expectedException.expect(APIException.class);
expectedException.expectMessage(is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { Order.class.getSimpleName() }, null)));
expectedException.expectMessage(is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { "[immutable]", Order.class.getSimpleName() }, null)));
interceptor.onFlushDirty(new Order(), null, currentState, previousState, propertyNames, null);
}

Expand Down Expand Up @@ -100,7 +100,7 @@ public void onFlushDirty_shouldFailIfTheEditedObjectIsVoidedOrRetiredAndIgnoreIs
String[] currentState = new String[] { "new" };
ImmutableEntityInterceptor interceptor = new SomeImmutableEntityInterceptor();
expectedException.expect(APIException.class);
expectedException.expectMessage(is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { Order.class.getSimpleName() }, null)));
expectedException.expectMessage(is(Context.getMessageSourceService().getMessage("editing.fields.not.allowed", new Object[] { "[immutable]", Order.class.getSimpleName() }, null)));
Order order = new Order();
order.setVoided(true);
interceptor.onFlushDirty(order, null, currentState, previousState, propertyNames, null);
Expand Down

0 comments on commit 6b55b67

Please sign in to comment.