diff options
| author | Kristen Kozak <sebright@google.com> | 2017-05-07 13:59:17 -0700 |
|---|---|---|
| committer | Kristen Kozak <sebright@google.com> | 2017-05-07 14:02:38 -0700 |
| commit | c34c42ad309fe9932c0c54f8b50688a31d7eb78e (patch) | |
| tree | 7f41d023e0a40499350f2ced1618b9c22aec48d9 | |
| parent | 576216de96b451a86de98a4ceb74e5e6daf64539 (diff) | |
| download | platform_external_opencensus-java-c34c42ad309fe9932c0c54f8b50688a31d7eb78e.tar.gz platform_external_opencensus-java-c34c42ad309fe9932c0c54f8b50688a31d7eb78e.tar.bz2 platform_external_opencensus-java-c34c42ad309fe9932c0c54f8b50688a31d7eb78e.zip | |
Test that ViewDescriptor.Names cannot be created with null strings.
| -rw-r--r-- | core/src/test/java/com/google/instrumentation/stats/ViewDescriptorTest.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/test/java/com/google/instrumentation/stats/ViewDescriptorTest.java b/core/src/test/java/com/google/instrumentation/stats/ViewDescriptorTest.java index 1385b9a8..89f843c4 100644 --- a/core/src/test/java/com/google/instrumentation/stats/ViewDescriptorTest.java +++ b/core/src/test/java/com/google/instrumentation/stats/ViewDescriptorTest.java @@ -161,6 +161,11 @@ public final class ViewDescriptorTest { assertThat(ViewDescriptor.Name.create("my name").asString()).isEqualTo("my name"); } + @Test(expected = NullPointerException.class) + public void preventNullNameString() { + ViewDescriptor.Name.create(null); + } + @Test public void testViewDescriptorNameEquals() { new EqualsTester() |
