package springCouchbase;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
public class ApplicationTests {

	@Test
	public void contextLoads() {
	}

}

@@ -19,16 +19,170 @@
 hbase;%0A%0A
+import com.couchbase.client.protocol.views.ComplexKey;%0Aimport com.couchbase.client.protocol.views.Query;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0A
 import o
@@ -196,16 +196,17 @@
 t.Test;%0A
+%0A
 import o
@@ -230,16 +230,79 @@
 unWith;%0A
+import org.springframework.beans.factory.annotation.Autowired;%0A
 import o
@@ -498,16 +498,165 @@
 sRunner;
+%0Aimport springCouchbase.domain.Activity;%0Aimport springCouchbase.domain.ActivityRepository;%0A%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.*;
 %0A%0A@RunWi
@@ -808,47 +808,932 @@
  %7B%0A%0A
-%09@Test%0A%09public void contextLoads() %7B%0A%09%7D%0A
+    @Autowired%0A    private ActivityRepository activityRepository;%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A%0A    %7D%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A    %7D%0A%0A    @Test%0A%09public void contextLoads() %7B%0A        assertNotNull(activityRepository);%0A%09%7D%0A%0A    @Test%0A    public void testActivityRepository() throws Exception %7B%0A        Activity activity = new Activity();%0A        activity.setId(%22someId%22);%0A        activity.setContent(%22Tweet content%22);%0A        activity.setOrigin(%22twitter%22);%0A        Activity savedActivity = activityRepository.save(activity);%0A        assertNotNull(savedActivity);%0A        assertEquals(savedActivity.getOrigin(), %22twitter%22);%0A%0A        Query query = new Query();%0A        query.setKey(ComplexKey.of(%22twitter%22));%0A        List%3CActivity%3E activities = activityRepository.findByOrigin(query);%0A        assertNotNull(activities);%0A        assertFalse(activities.isEmpty());%0A%0A%0A    %7D
 %0A%7D%0A

add simple unit test