title: Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: Resource not found
body: <p>I try to write a test of pubsub:</p>
  
  <pre><code>@Test
  public void sendTopic() throws Exception {
  
      CustomSubscriber customSubscriber = new CustomSubscriber();
      customSubscriber.startAndWait();
  
      CustomPublisher customPublisher = new CustomPublisher();
      customPublisher.publish("123");
  }
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>public CustomSubscriber() {
      this.subscriptionName = SubscriptionName.create(SdkServiceConfig.s.GCP_PROJECT_ID, SdkServiceConfig.s.TOPIC_ID );
      this.receiveMsgAction = (message, consumer) -&gt; {
          // handle incoming message, then ack/nack the received message
          System.out.println("Id : " + message.getMessageId());
          System.out.println("Data : " + message.getData().toStringUtf8());
          consumer.ack();
      };
      this.afterStopAction = new ApiFutureEmpty();
  }
  
  // [TARGET startAsync()]
  public void startAndWait() throws Exception {
      Subscriber subscriber = createSubscriberWithCustomCredentials();
      subscriber.startAsync();
  
      // Wait for a stop signal.
      afterStopAction.get();
      subscriber.stopAsync().awaitTerminated();
  }
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>public ApiFuture&lt;String&gt; publish(String message) throws Exception {
      ByteString data = ByteString.copyFromUtf8(message);
      PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
      ApiFuture&lt;String&gt; messageIdFuture = publisher.publish(pubsubMessage);
  
      ApiFutures.addCallback(messageIdFuture, new ApiFutureCallback&lt;String&gt;() {
          public void onSuccess(String messageId) {
              System.out.println("published with message id: " + messageId);
          }
  
          public void onFailure(Throwable t) {
              System.out.println("failed to publish: " + t);
          }
      });
      return messageIdFuture;
  }
  
  /**
   * Example of creating a {@code Publisher}.
   */
  // [TARGET newBuilder(TopicName)]
  // [VARIABLE "my_project"]
  // [VARIABLE "my_topic"]
  public void createPublisher(String projectId, String topicId) throws Exception {
      TopicName topic = TopicName.create(projectId, topicId);
      try {
          publisher = createPublisherWithCustomCredentials(topic);
  
      } finally {
          // When finished with the publisher, make sure to shutdown to free up resources.
          publisher.shutdown();
      }
  }
  </code></pre>
  
  <p>When i run the code i get this error:</p>
  
  <pre><code>Caused by: io.grpc.StatusRuntimeException: NOT_FOUND: Resource not found (resource=add-partner-request).
  </code></pre>
  
  <p>What am i missing?</p>