Skip to content

Commit bd87b26

Browse files
committed
test: simplify tests
1 parent 206f7ad commit bd87b26

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • sdk-platform-java/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it

sdk-platform-java/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelTracing.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
import static com.google.common.truth.Truth.assertThat;
3434
import static org.junit.Assert.assertThrows;
3535

36-
import java.util.UUID;
3736
import com.google.api.client.http.javanet.NetHttpTransport;
38-
import com.google.showcase.v1beta1.GetUserRequest;
3937
import com.google.api.gax.core.NoCredentialsProvider;
4038
import com.google.api.gax.retrying.RetrySettings;
4139
import com.google.api.gax.rpc.StatusCode;
@@ -49,6 +47,7 @@
4947
import com.google.showcase.v1beta1.EchoClient;
5048
import com.google.showcase.v1beta1.EchoRequest;
5149
import com.google.showcase.v1beta1.EchoSettings;
50+
import com.google.showcase.v1beta1.GetUserRequest;
5251
import com.google.showcase.v1beta1.IdentityClient;
5352
import com.google.showcase.v1beta1.User;
5453
import com.google.showcase.v1beta1.it.util.TestClientInitializer;
@@ -246,10 +245,8 @@ void testTracing_successfulIdentityGetUser_httpjson() throws Exception {
246245
attemptSpan
247246
.getAttributes()
248247
.get(AttributeKey.longKey(ObservabilityAttributes.HTTP_RESPONSE_BODY_SIZE));
249-
if (observedMagnitude != null) {
250-
assertThat(observedMagnitude).isAtLeast((long) (expectedMagnitude * (1 - 0.15)));
251-
assertThat(observedMagnitude).isAtMost((long) (expectedMagnitude * (1 + 0.15)));
252-
}
248+
assertThat(observedMagnitude).isNotNull();
249+
assertThat(observedMagnitude).isAtLeast((long) (expectedMagnitude * (1 - 0.15)));
253250
}
254251
}
255252

0 commit comments

Comments
 (0)