File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1
samples/snippets/src/test/java/pubsub Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1342,6 +1342,7 @@ public void testPublishOpenTelemetryTracing() throws Exception {
13421342 fakeExecutor .advanceTime (Duration .ofSeconds (5 ));
13431343 assertEquals ("1" , publishFuture .get ());
13441344 fakeExecutor .advanceTime (Duration .ofSeconds (5 ));
1345+ shutdownTestPublisher (publisher );
13451346
13461347 List <SpanData > allSpans = openTelemetryTesting .getSpans ();
13471348 assertEquals (4 , allSpans .size ());
Original file line number Diff line number Diff line change @@ -81,8 +81,8 @@ public class AdminIT {
8181 private static final String cloudStorageInputFormat = "text" ;
8282 private static final String cloudStorageTextDelimiter = "," ;
8383 private static final String cloudStorageMatchGlob = "**.txt" ;
84- private static final String cloudStorageMinimumObjectCreateTime = "1970-01-01T00:00:00Z " ;
85- private static final String cloudStorageMinimumObjectCreateTimeSeconds = "0 " ;
84+ private static final String cloudStorageMinimumObjectCreateTime = "1970-01-01T00:00:01Z " ;
85+ private static final String cloudStorageMinimumObjectCreateTimeSeconds = "seconds: 1 " ;
8686
8787 private static final TopicName topicName = TopicName .of (projectId , topicId );
8888 private static final TopicName kinesisIngestionTopicName =
Original file line number Diff line number Diff line change 3939import java .util .List ;
4040import java .util .UUID ;
4141import org .junit .After ;
42+ import org .junit .AfterClass ;
4243import org .junit .Before ;
4344import org .junit .BeforeClass ;
4445import org .junit .Rule ;
4546import org .junit .Test ;
4647import org .junit .rules .Timeout ;
4748
4849public class SubscriberIT {
49- private ByteArrayOutputStream bout ;
50- private PrintStream out ;
50+ private static ByteArrayOutputStream bout ;
51+ private static PrintStream out ;
5152
5253 private static final String projectId = System .getenv ("GOOGLE_CLOUD_PROJECT" );
5354 private static final String _suffix = UUID .randomUUID ().toString ();
@@ -129,8 +130,8 @@ public static void checkRequirements() {
129130 requireEnvVar ("GOOGLE_CLOUD_PROJECT" );
130131 }
131132
132- @ Before
133- public void setUp () throws Exception {
133+ @ BeforeClass
134+ public static void setUp () throws Exception {
134135 bout = new ByteArrayOutputStream ();
135136 out = new PrintStream (bout );
136137 System .setOut (out );
@@ -162,8 +163,8 @@ public void setUp() throws Exception {
162163 }
163164 }
164165
165- @ After
166- public void tearDown () throws Exception {
166+ @ AfterClass
167+ public static void tearDown () throws Exception {
167168 try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient .create ()) {
168169 subscriptionAdminClient .deleteSubscription (subscriptionName .toString ());
169170 subscriptionAdminClient .deleteSubscription (subscriptionEodName .toString ());
You can’t perform that action at this time.
0 commit comments