use of io.crnk.core.mock.models.TaskLinks in project crnk-framework by crnk-project.
the class JsonApiRequestProcessorTest method setup.
@Before
public void setup() {
TaskRepository.clear();
boot = new CrnkBoot();
boot.addModule(new Module() {
@Override
public String getModuleName() {
return "test";
}
@Override
public void setupModule(ModuleContext context) {
moduleContext = context;
}
});
boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost:8080"));
boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
boot.boot();
Task task = new Task();
task.setId(1L);
task.setName("SomeTask");
task.setLinksInformation(new TaskLinks());
TaskRepository tasks = new TaskRepository();
tasks.save(task);
processor = new JsonApiRequestProcessor(moduleContext);
requestContextBase = Mockito.mock(HttpRequestContextBase.class);
requestContext = new HttpRequestContextBaseAdapter(requestContextBase);
HttpRequestContextProvider requestContextProvider = boot.getModuleRegistry().getHttpRequestContextProvider();
requestContextProvider.onRequestStarted(requestContext);
}
Aggregations