@Test
@DirtiesContext // adding a bean with empty context if the test fails
public void testCreateWithoutGeometry() throws Exception {

	PersistTransactionRequest request = new PersistTransactionRequest();
	request.setCrs(CRS);
	FeatureTransaction featureTransaction = new FeatureTransaction();
	featureTransaction.setLayerId(LAYER_ID);
	Feature feature = new Feature();
	featureTransaction.setNewFeatures(new Feature[] {feature});
	request.setFeatureTransaction(featureTransaction);
	PersistTransactionResponse response = (PersistTransactionResponse) dispatcher.execute(
			PersistTransactionRequest.COMMAND, request, null, "en");
	assertThat(response.isError()).isTrue();
	Throwable error = response.getErrors().get(0);
	assertThat(error).isInstanceOf(LayerException.class);
	assertThat(((LayerException) error).getExceptionCode()).isEqualTo(
			ExceptionCode.LAYER_EMPTY_GEOMETRY_NOT_ALLOWED);
	/*
	if (response.isError()) {
		response.getErrors().get(0).printStackTrace();
	}
	Assert.assertFalse(response.isError());
	Assert.assertNotNull(response.getFeatureTransaction());
	Feature[] newFeatures = response.getFeatureTransaction().getNewFeatures();
	assertThat(newFeatures.length).isEqualTo(1);
	assertThat(newFeatures[0].getId()).isNotNull();
	assertThat(newFeatures[0].getGeometry()).isNotNull();
	*/
}