Files
gerrit/gerrit-util-http/BUCK
Dave Borowitz 054b8f385f Add fake HttpServlet{Request,Response} for testing
Instead of relying on mocks, provide mostly-featureful fakes that
allow inspection of the structured data passed to them. The fake
methods other than path getters are not really used yet.

These classes are largely copied from the Gitiles project at 4434b800;
the entirety of the copied code was authored by Google employees at
Google, so it is safe to include in this project.

Change-Id: I57af5d32cfabda6498744382100b4781e4f23d49
2015-12-03 10:27:44 -05:00

40 lines
809 B
Python

java_library(
name = 'http',
srcs = glob(['src/main/java/**/*.java']),
provided_deps = ['//lib:servlet-api-3_1'],
visibility = ['PUBLIC'],
)
TESTUTIL_SRCS = glob(['src/test/**/testutil/**/*.java'])
java_library(
name = 'testutil',
srcs = TESTUTIL_SRCS,
deps = [
'//gerrit-extension-api:api',
'//lib:guava',
'//lib:servlet-api-3_1',
'//lib/jgit:jgit',
],
visibility = ['PUBLIC'],
)
java_test(
name = 'http_tests',
srcs = glob(
['src/test/java/**/*.java'],
excludes = TESTUTIL_SRCS,
),
deps = [
':http',
':testutil',
'//lib:junit',
'//lib:servlet-api-3_1',
'//lib:truth',
'//lib/easymock:easymock',
],
source_under_test = [':http'],
# TODO(sop) Remove after Buck supports Eclipse
visibility = ['//tools/eclipse:classpath'],
)