/*
Copyright 2020 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.google.gpay.virtualqueue.backendservice.repository;

import static org.junit.Assert.assertEquals;
import java.util.UUID;

import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = InMemoryVirtualQueueRepository.class)
public class InMemoryVirtualQueueRepositoryTest {
    InMemoryVirtualQueueRepository inMemoryVirtualQueueRepository = new InMemoryVirtualQueueRepository();

    @BeforeEach
    public void setUp(){
        inMemoryVirtualQueueRepository.getTokenMap().clear();
        inMemoryVirtualQueueRepository.getShopMap().clear();
        inMemoryVirtualQueueRepository.getShopIdToListOfTokensMap().clear();
        inMemoryVirtualQueueRepository.getShopIdToLastAllotedTokenMap().clear();
        inMemoryVirtualQueueRepository.getShopOwnerMap().clear();
    }

    @Test
    public void testCreateShop() throws Exception {
        CreateShopRequest shop = new CreateShopRequest("uid", "shopName", "address", "+919012192800", "type");

        UUID shopId = inMemoryVirtualQueueRepository.createShop(shop);
        int size = inMemoryVirtualQueueRepository.getShopMap().size();
        
        assertEquals("size ", 1, size);
        assertEquals("Shop Owner Id ", "uid", inMemoryVirtualQueueRepository.getShopMap().get(shopId).getShopOwnerId());
        assertEquals("Shop Name ", "shopName", inMemoryVirtualQueueRepository.getShopMap().get(shopId).getShopName());
        assertEquals("Shop Address ", "address", inMemoryVirtualQueueRepository.getShopMap().get(shopId).getAddress());
        assertEquals("Shop Phone Number ", "+919012192800", inMemoryVirtualQueueRepository.getShopMap().get(shopId).getPhoneNumber());
        assertEquals("Shop Type ", "type", inMemoryVirtualQueueRepository.getShopMap().get(shopId).getShopType());
    }
}

@@ -1325,24 +1325,308 @@
 ository();%0A%0A
+    private static final String shopOwnerId = %22uid%22;%0A    private static final String shopName = %22shopName%22;%0A    private static final String shopAddress = %22address%22;%0A    private static final String phoneNumber = %22+919012192800%22;%0A    private static final String shopType = %22shopType%22;%0A%0A
     @BeforeE
@@ -1629,16 +1629,16 @@
 oreEach%0A
-
     publ
@@ -2129,24 +2129,29 @@
 est(
-%22uid%22
+shopOwnerId
 , 
-%22
 shopName
 %22, %22
@@ -2150,45 +2150,44 @@
 Name
-%22
 , 
-%22a
+shopA
 ddress
-%22
 , 
-%22+919012192800%22, %22t
+phoneNumber, shopT
 ype
-%22
 );%0A%0A
@@ -2328,24 +2328,16 @@
 size();%0A
-        
 %0A       
@@ -2356,16 +2356,26 @@
 s(%22size 
+of shopMap
 %22, 1, si
@@ -2418,21 +2418,27 @@
 r Id %22, 
-%22uid%22
+shopOwnerId
 , inMemo
@@ -2541,25 +2541,24 @@
 Name %22, 
-%22
 shopName
 %22, inMem
@@ -2549,17 +2549,16 @@
 shopName
-%22
 , inMemo
@@ -2661,25 +2661,27 @@
 ress %22, 
-%22a
+shopA
 ddress
-%22
 , inMemo
@@ -2788,31 +2788,27 @@
 mber %22, 
-%22+919012192800%22
+phoneNumber
 , inMemo
@@ -2915,14 +2915,16 @@
  %22, 
-%22t
+shopT
 ype
-%22
 , in

Add expected values as constants