Search in sources :

Example 1 with UsersOptions

use of easytests.core.options.UsersOptions in project easy-tests by malinink.

the class ObjectsControllerTest method testViewReturnsData.

@Test
public void testViewReturnsData() throws Exception {
    final UserModelInterface userModel = this.usersSupport.getModelFixtureMock(0);
    when(this.usersOptionsBuilder.forAuth()).thenReturn(new UsersOptions());
    when(this.usersService.find(any(Integer.class), any(UsersOptionsInterface.class))).thenReturn(userModel);
    mvc.perform(get("/v1/objects/1/").contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)).andReturn();
}
Also used : UserModelInterface(easytests.core.models.UserModelInterface) UsersOptions(easytests.core.options.UsersOptions) UsersOptionsInterface(easytests.core.options.UsersOptionsInterface) Test(org.junit.Test) WebMvcTest(org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)

Example 2 with UsersOptions

use of easytests.core.options.UsersOptions in project easy-tests by malinink.

the class UsersOptionsBuilderTest method testForDelete.

@Test
public void testForDelete() throws Exception {
    final SubjectsOptionsInterface subjectsOptions = new SubjectsOptions();
    given(this.subjectsOptionsBuilder.forDelete()).willReturn(subjectsOptions);
    final UsersOptionsInterface usersOptions = this.usersOptionsBuilder.forDelete();
    Assert.assertEquals(new UsersOptions().withSubjects(subjectsOptions), usersOptions);
}
Also used : SubjectsOptions(easytests.core.options.SubjectsOptions) UsersOptions(easytests.core.options.UsersOptions) UsersOptionsInterface(easytests.core.options.UsersOptionsInterface) SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Example 3 with UsersOptions

use of easytests.core.options.UsersOptions in project easy-tests by malinink.

the class UsersOptionsBuilderTest method testForAuth.

@Test
public void testForAuth() throws Exception {
    final UsersOptionsInterface usersOptions = this.usersOptionsBuilder.forAuth();
    Assert.assertEquals(new UsersOptions(), usersOptions);
}
Also used : UsersOptions(easytests.core.options.UsersOptions) UsersOptionsInterface(easytests.core.options.UsersOptionsInterface) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

UsersOptions (easytests.core.options.UsersOptions)3 UsersOptionsInterface (easytests.core.options.UsersOptionsInterface)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 UserModelInterface (easytests.core.models.UserModelInterface)1 SubjectsOptions (easytests.core.options.SubjectsOptions)1 SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)1 WebMvcTest (org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest)1