Package org.molgenis.mock

Examples of org.molgenis.mock.MockDatabase


  }

  @Test
  public void testNotAuthenticated() throws Exception
  {
    MockDatabase db = new MockDatabase();
    db.setLogin(new MockLogin(false));

    Model model = when(mock(Model.class).getEntities(false, false)).thenReturn(new Vector<Entity>()).getMock();
    db.setMetaData(model);

    molgenisRequest.setDatabase(db);
    molgenisRequest.setServicePath(API_FIND_URI);
    mockHttpServletRequest.setPathInfo(API_FIND_URI + "/");
View Full Code Here


  }

  @Test
  public void testAuthenticated() throws Exception
  {
    MockDatabase db = new MockDatabase();
    db.setLogin(new MockLogin(true));

    Model model = when(mock(Model.class).getEntities(false, false)).thenReturn(new Vector<Entity>()).getMock();
    db.setMetaData(model);

    molgenisRequest.setDatabase(db);
    molgenisRequest.setServicePath(API_FIND_URI);
    mockHttpServletRequest.setPathInfo(API_FIND_URI + "/");
View Full Code Here

  }

  @Test
  public void testNotExistingOrSystemEntity() throws ParseException, DatabaseException, IOException
  {
    MockDatabase db = new MockDatabase();
    db.setLogin(new MockLogin(true));

    Model model = when(mock(Model.class).getEntities(false, false)).thenReturn(new Vector<Entity>()).getMock();
    db.setMetaData(model);

    molgenisRequest.setDatabase(db);
    molgenisRequest.setServicePath(API_FIND_URI);
    mockHttpServletRequest.setPathInfo(API_FIND_URI + "/XXXX");
View Full Code Here

TOP

Related Classes of org.molgenis.mock.MockDatabase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.