use of io.crnk.client.CrnkClient in project crnk-framework by crnk-project.
the class SecurityModuleIntTest method setup.
@Before
public void setup() {
identityManager.clear();
client = new CrnkClient(getBaseUri().toString());
client.addModule(SecurityModule.newClientModule());
client.setPushAlways(false);
client.getHttpAdapter().setReceiveTimeout(1000000, TimeUnit.MILLISECONDS);
taskRepo = client.getRepositoryForType(Task.class);
projectRepo = client.getRepositoryForType(Project.class);
relRepo = client.getRepositoryForType(Task.class, Project.class);
setBasicAuthentication(client, "doe", "doePass");
TaskRepository.clear();
ProjectRepository.clear();
}
use of io.crnk.client.CrnkClient in project crnk-framework by crnk-project.
the class BaseTest method before.
@Before
public final void before() {
RestAssured.port = port;
loadJsonApiSchema();
client = new CrnkClient("http://localhost:" + port + "/api");
client.addModule(ValidationModule.newInstance());
client.addModule(JpaModule.newClientModule());
}
use of io.crnk.client.CrnkClient in project crnk-framework by crnk-project.
the class AbstractJpaJerseyTest method setup.
@Before
public void setup() {
client = new CrnkClient(getBaseUri().toString());
client.setPushAlways(false);
JpaModule module = JpaModule.newClientModule();
setupModule(module, false);
client.addModule(module);
MetaModule clientMetaModule = MetaModule.create();
clientMetaModule.addMetaProvider(new ResourceMetaProvider());
client.addModule(clientMetaModule);
metaModule.getLookup().initialize();
setNetworkTimeout(client, 10000, TimeUnit.SECONDS);
}
use of io.crnk.client.CrnkClient in project crnk-framework by crnk-project.
the class ClientModuleFactoryTest method shouldDiscoverObjectLinkModules.
@Test
public void shouldDiscoverObjectLinkModules() {
CrnkClient client = new CrnkClient("http://something", CrnkClient.ClientType.OBJECT_LINKS);
client.findModules();
List<Module> modules = client.getModuleRegistry().getModules();
Assert.assertEquals(3, modules.size());
Assert.assertEquals(ClientModule.class, modules.get(0).getClass());
Assert.assertEquals(JacksonModule.class, modules.get(1).getClass());
Assert.assertEquals(ClientTestModule.class, modules.get(2).getClass());
}
use of io.crnk.client.CrnkClient in project crnk-framework by crnk-project.
the class ApprovalIntTest method setUp.
@Before
@Override
public void setUp() throws Exception {
super.setUp();
client = new CrnkClient(getBaseUri().toString());
client.getObjectMapper().registerModule(new JavaTimeModule());
HttpAdapter httpAdapter = client.getHttpAdapter();
httpAdapter.setReceiveTimeout(10000, TimeUnit.SECONDS);
scheduleRepo = client.getRepositoryForInterface(ScheduleRepository.class);
approvalRepo = client.getRepositoryForType(ScheduleApprovalProcessInstance.class);
processTaskRepo = client.getRepositoryForType(ScheduleApprovalProcessInstance.class, ApproveTask.class);
taskRepo = client.getRepositoryForType(ApproveTask.class);
approvalRelRepo = client.getRepositoryForType(Schedule.class, ScheduleApprovalProcessInstance.class);
formRepo = client.getRepositoryForType(ApproveForm.class);
}
Aggregations