File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
testutil-gcloud/src/test/java/io/spine/testing/server/storage/datastore Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,7 @@ void byResourceAtPath() {
105105 @ Test
106106 @ DisplayName ("the service account resource" )
107107 void byResource () {
108- Resource serviceAccount = Resource .file (
109- SPINE_DEV_JSON , TestDatastoresTest .class .getClassLoader ()
110- );
108+ Resource serviceAccount = localResource (SPINE_DEV_JSON );
111109 Datastore datastore = TestDatastores .remote (serviceAccount );
112110 String projectId = datastore .getOptions ()
113111 .getProjectId ();
@@ -118,9 +116,11 @@ void byResource() {
118116 @ Test
119117 @ DisplayName ("throw an `ISE` when can't properly parse account credentials from resource" )
120118 void throwOnInvalidResource () {
121- Resource resource = Resource .file (
122- "random.json" , TestDatastoresTest .class .getClassLoader ()
123- );
119+ Resource resource = localResource ("random.json" );
124120 assertThrows (IllegalStateException .class , () -> TestDatastores .remote (resource ));
125121 }
122+
123+ private static Resource localResource (String path ) {
124+ return Resource .file (path , TestDatastoresTest .class .getClassLoader ());
125+ }
126126}
You can’t perform that action at this time.
0 commit comments