mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 00:42:12 +02:00
mv com/google/domain/registry google/registry
This change renames directories in preparation for the great package rename. The repository is now in a broken state because the code itself hasn't been updated. However this should ensure that git correctly preserves history for each file.
This commit is contained in:
parent
a41677aea1
commit
5012893c1d
2396 changed files with 0 additions and 0 deletions
85
javatests/google/registry/tmch/TmchActionTestCase.java
Normal file
85
javatests/google/registry/tmch/TmchActionTestCase.java
Normal file
|
@ -0,0 +1,85 @@
|
|||
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.domain.registry.tmch;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_OK;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import com.google.appengine.api.urlfetch.HTTPRequest;
|
||||
import com.google.appengine.api.urlfetch.HTTPResponse;
|
||||
import com.google.appengine.api.urlfetch.URLFetchService;
|
||||
import com.google.domain.registry.testing.AppEngineRule;
|
||||
import com.google.domain.registry.testing.BouncyCastleProviderRule;
|
||||
import com.google.domain.registry.testing.ExceptionRule;
|
||||
import com.google.domain.registry.testing.FakeClock;
|
||||
import com.google.domain.registry.testing.InjectRule;
|
||||
import com.google.domain.registry.testing.RegistryConfigRule;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Captor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
/** Common code for unit tests of classes that extend {@link Marksdb}. */
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class TmchActionTestCase {
|
||||
|
||||
static final String MARKSDB_LOGIN = "lolcat:attack";
|
||||
static final String MARKSDB_LOGIN_BASE64 = "bG9sY2F0OmF0dGFjaw==";
|
||||
static final String MARKSDB_URL = "http://127.0.0.1/love";
|
||||
|
||||
@Rule
|
||||
public final AppEngineRule appEngine = AppEngineRule.builder()
|
||||
.withDatastore()
|
||||
.build();
|
||||
|
||||
@Rule
|
||||
public final BouncyCastleProviderRule bouncy = new BouncyCastleProviderRule();
|
||||
|
||||
@Rule
|
||||
public final RegistryConfigRule configRule = new RegistryConfigRule();
|
||||
|
||||
@Rule
|
||||
public final ExceptionRule thrown = new ExceptionRule();
|
||||
|
||||
@Rule
|
||||
public final InjectRule inject = new InjectRule();
|
||||
|
||||
@Mock
|
||||
URLFetchService fetchService;
|
||||
|
||||
@Captor
|
||||
ArgumentCaptor<HTTPRequest> httpRequest;
|
||||
|
||||
@Mock
|
||||
HTTPResponse httpResponse;
|
||||
|
||||
final FakeClock clock = new FakeClock();
|
||||
final Marksdb marksdb = new Marksdb();
|
||||
|
||||
@Before
|
||||
public void commonBefore() throws Exception {
|
||||
inject.setStaticField(TmchCertificateAuthority.class, "clock", clock);
|
||||
marksdb.fetchService = fetchService;
|
||||
marksdb.tmchMarksdbUrl = MARKSDB_URL;
|
||||
marksdb.marksdbPublicKey = TmchData.loadPublicKey(TmchTestData.loadBytes("pubkey"));
|
||||
when(fetchService.fetch(any(HTTPRequest.class))).thenReturn(httpResponse);
|
||||
when(httpResponse.getResponseCode()).thenReturn(SC_OK);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue