@@ -0,0 +1,2876 @@
+// Copyright 2019 Google LLC%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     https://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.sps;%0A%0Aimport static org.mockito.Mockito.when;%0A%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport com.google.appengine.tools.development.testing.LocalURLFetchServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalUserServiceTestConfig;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonObject;%0Aimport com.google.gson.JsonParser;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.EntityNotFoundException;%0Aimport com.google.appengine.api.datastore.PreparedQuery;%0Aimport com.google.appengine.api.datastore.Query;%0Aimport com.google.appengine.api.datastore.Query.Filter;%0Aimport com.google.appengine.api.datastore.Query.FilterPredicate;%0Aimport com.google.appengine.api.datastore.Query.FilterOperator;%0Aimport com.google.api.client.util.Base64;%0Aimport com.google.api.services.gmail.Gmail;%0Aimport com.google.api.services.gmail.model.Message;%0Aimport com.google.sps.data.Email;%0Aimport com.google.sps.data.Post;%0Aimport com.google.sps.servlets.PostDataServlet;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.security.GeneralSecurityException;%0Aimport java.util.Properties;%0A%0Aimport javax.activation.DataHandler;%0Aimport javax.activation.DataSource;%0Aimport javax.activation.FileDataSource;%0Aimport javax.mail.MessagingException;%0Aimport javax.mail.Multipart;%0Aimport javax.mail.MessagingException;%0Aimport javax.mail.Session;%0Aimport javax.mail.internet.InternetAddress;%0Aimport javax.mail.internet.MimeBodyPart;%0Aimport javax.mail.internet.MimeMessage;%0Aimport javax.mail.internet.MimeMultipart;%0A%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0A%0A/** Tests creating and sending emails from an authorized account.*/%0A@RunWith(JUnit4.class)%0Apublic final class GmailConfigurationTest %7B%0A%0A%7D%0A

add gmail config set up test