DATACMNS-874 - Fix Scala Option unwrapping.

We now correctly unwrap empty Scala Options so the unwrapping no longer fails.

Original pull request: #165.
This commit is contained in:
Mark Paluch
2016-06-23 13:20:28 +02:00
committed by Oliver Gierke
parent c787073357
commit 20653a7ebc
2 changed files with 29 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2015 the original author or authors.
* Copyright 2014-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,7 @@ import com.google.common.base.Optional;
* Unit tests for {@link QueryExecutionConverters}.
*
* @author Oliver Gierke
* @author Mark Paluch
*/
public class QueryExecutionConvertersUnitTests {
@@ -163,4 +164,12 @@ public class QueryExecutionConvertersUnitTests {
public void unwrapsScalaOption() {
assertThat(QueryExecutionConverters.unwrap(Option.apply("foo")), is((Object) "foo"));
}
/**
* @see DATACMNS-874
*/
@Test
public void unwrapsEmptyScalaOption() {
assertThat(QueryExecutionConverters.unwrap(Option.empty()), is((Object) null));
}
}