File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
db/cassandra/src/main/java/org/commonjava/indy/cassandra/data
models/core-java/src/test/java/org/commonjava/indy/model/model Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 2424import org .commonjava .indy .model .core .ArtifactStore ;
2525import org .commonjava .indy .model .core .Group ;
2626import org .commonjava .indy .model .core .HostedRepository ;
27+ import org .commonjava .indy .model .core .PathStyle ;
2728import org .commonjava .indy .model .core .RemoteRepository ;
2829import org .commonjava .indy .model .core .StoreKey ;
2930import org .commonjava .indy .model .core .StoreType ;
@@ -412,6 +413,7 @@ private ArtifactStore toArtifactStore( final DtxArtifactStore dtxArtifactStore )
412413 store .setPathMaskPatterns ( dtxArtifactStore .getPathMaskPatterns () );
413414 store .setDisableTimeout ( dtxArtifactStore .getDisableTimeout () );
414415 store .setAuthoritativeIndex ( dtxArtifactStore .getAuthoritativeIndex () );
416+ store .setPathStyle ( PathStyle .valueOf ( dtxArtifactStore .getPathStyle () ) );
415417 }
416418 return store ;
417419 }
Original file line number Diff line number Diff line change 2222import org .commonjava .indy .model .core .io .IndyObjectMapper ;
2323import org .junit .Test ;
2424
25+ import java .io .IOException ;
2526import java .lang .reflect .InvocationTargetException ;
2627import java .util .Collections ;
2728import java .util .stream .Stream ;
2829
2930import static org .hamcrest .CoreMatchers .equalTo ;
3031import static org .junit .Assert .assertThat ;
32+ import static org .junit .Assert .assertTrue ;
3133import static org .junit .Assert .fail ;
3234
3335/**
@@ -61,6 +63,23 @@ public void serializeRemoteWithKeyPemAndPassword()
6163 System .out .println ( json );
6264 }
6365
66+ @ Test
67+ public void serializeRemoteWithPathStyle () throws IOException
68+ {
69+ RemoteRepository remote = new RemoteRepository ( "generic-http" , "test" , "http://test.com/repo" );
70+ remote .setPathStyle ( PathStyle .hashed );
71+ IndyObjectMapper mapper = new IndyObjectMapper ( true );
72+ mapper .init ();
73+
74+ String json = mapper .writeValueAsString ( remote );
75+
76+ System .out .println ( json );
77+
78+ RemoteRepository ret = mapper .readValue ( json .getBytes (), RemoteRepository .class );
79+ System .out .println ( ret .getPathStyle () );
80+ assertTrue ( ret .getPathStyle () == PathStyle .hashed );
81+ }
82+
6483 @ Test
6584 public void copyFidelity ()
6685 {
You can’t perform that action at this time.
0 commit comments